问题描述
我用散景.我非常喜欢Bokeh,因为Bokeh有很多图表,输出文件非常简单
I use the Bokeh. I like Bokeh very much, Because Bokeh have the many chart and output file is very simple
我在半导体公司工作,有时会分析半导体.数据.
I work for Semiconductor Corporation, I sometimes analysis the semicon. data.
我有很多数据,我制作了很多图表.可能是1000〜4000个图表操作!!!!!
I have the many data and I make the many chart. may be 1000~4000 chart ops!!!!!
我使用散景制作图表,但散景非常慢,我不为什么........
I use the Bokeh for making chart, but bokeh is very slow, I don't why ........
例如,数据有6000行,250列(csv格式),我想绘制约250列
for example, data have 6000 rows, 250 columns (csv format), I want to plot about 250 columns
我使用了matplotlib和numpy,消息来源是关于Bokeh的
I use the matplotlib and numpy, source is like this about Bokeh
rect(hist_array [cnt,param_num,0],\
rect(hist_array[cnt, param_num, 0], \
hist_array[cnt, param_num, 1]/2.0, \
0.01 * (hist_array[cnt, param_num, 0][2] - hist_array[cnt, param_num, 0][1]), \
hist_array[cnt, param_num, 1], \
y_range=Range1d(start=0,end=param_array[param_num, 1][:file_count].max()*1.1), \
x_range=Range1d(start=param_array[param_num, 2][:file_count].min(), end=param_array[param_num, 3][:file_count].max()), \
plot_width=1200, plot_height=400,
fill_color=colormap[cnt], \
line_color=colormap[cnt], \
#fill_alpha=0.1, \
#line_alpha=0.1, \
legend=file_name[4] + ' ' + tmpIndex[param_cnt])
我不知道为什么散景很慢,可能是100秒
I don't know why Bokeh is slow, may be 100 sec
推荐答案
由于Bokeh在浏览器中运行,因此最终仍然存在来自浏览器和Javascript运行时的性能限制.听起来您正在绘制150万个点?在直接嵌入模式下,这种方法不能很好地工作.
Because Bokeh runs in the browser, there are ultimately still performance limits that come from the browser and the Javascript runtime. It sounds like you are plotting 1.5 million points? That will not work very well with the direct embedded mode.
但是,有一个解决方案:Bokeh服务器可以针对某些绘图类型自动对数据进行降采样,并在浏览器中提供简化版本.然后,当用户缩放和平移时,将从服务器检索更多数据.这意味着输出的HTML文件将很快启动,并且性能也应该非常合理.
However, there is a solution for this: the Bokeh server can automatically downsample your data, for some plot types, and serve up a simplified version into the browser. As the user then zooms and pans, more data will be retrieved from the server. This means that the output HTML files will be fast to start up, and also the performance should be very reasonable.
当前,下采样服务器不在存储库的master/main分支中,而是在demo分支中.在下一个主要版本中,我们将把这种下采样行为烘焙到主服务器本身中.如果您有兴趣使用现有的下采样功能,请通过[email protected]向bokeh用户列表发送电子邮件,我们可以在此处进行对话.
Currently, the downsampling server is not in the master/main branch of the repository, but is in a demo branch. In the next major version we will have this downsampling behavior baked into the main server itself. If you are interested in playing with the existing downsampling, please email the bokeh user list at [email protected], and we can pick up the conversation there.
这篇关于如果Bokeh有很多图表,则输出文件很重且系统很慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!