是否有任何文档指定如何通过 holoview 传递散景参数?我正在阅读教程,但我认为我错过了一些小东西。网上有一个例子在 Ipython 中描述了这一点,但我试图通过没有 Ipython 笔记本的 python 来做。 http://holoviews.org/Tutorials/Bokeh_Backend.html?highlight=bokeh
当我运行这个程序时,我得到了曲线,但颜色没有改变,我也得到这个错误:WARNING:root:Curve01537: Setting non-parameter attribute style={'line_color': 'green'} using a mechanism used only for参数
我们如何设置参数?
Code Example here
from pprint import pprint, pformat
import holoviews as hv
import numpy as np
import pathlib, os
import webbrowser
import lasio, las
from holoviews import Store
from holoviews.plotting.bokeh.element import (line_properties, fill_properties, text_properties)
def plot_bokeh(plot):
#Create renderer instance
myrenderer = hv.Store.renderers['bokeh'].instance(fig='html')
out_file_name = "".join(["./OUTPUT/","gyro", "_graph.html"])
with open (out_file_name, 'w') as f:
#Plot static html
f.write (myrenderer.static_html(plot))
f.close()
webbrowser.open_new_tab(pathlib.Path(os.path.abspath(out_file_name)).as_uri())
def holoview_sandbox():
curve_opts = dict(line_color='green')
xs = np.linspace(0, np.pi*4, 100)
data = (xs, np.sin(xs))
holo_plot = hv.Curve(data, label='MY LABEL' , style=curve_opts)
plot_bokeh(holo_plot)
if __name__ == '__main__':
holoview_sandbox()