本文研究的主要是python/287878.html">python/280953.html">python/197957.html">python可視化包Bokeh的相關(guān)內(nèi)容,具體如下。
問題:需要把pandas的數(shù)據(jù)繪圖并通過網(wǎng)頁顯示,matplotlib需要先保存圖像,不合適。
解決:在網(wǎng)上搜了一下,找到一篇介紹文章 python可視化工具概述,其中介紹了幾個(gè)python包,總結(jié)如下:
p = figure(title = code, plot_width=1024, plot_height=600, x_axis_type='datetime') p.line(x=trd_df['date'], y=trd_df['close']) script, div = components(p)
return render_template('show_stock.html', bk_js = bokeh.resources.INLINE.render_js(),bk_css = bokeh.resources.INLINE.render_css(), p_script = script, div = p_div)<!doctype html> <html lang="en"> <head> <meta charset='utf-8' /> <meta http-equiv='content-type' content='text/html; charset=utf-8' /> <title>Embed Demo</title> {{ js_resources|indent(4)|safe }} {{ css_resources|indent(4)|safe }} {{ p_script|indent(4)|safe }} </head> <body> {{ p_div|indent(4)|safe }} </body> </html> 以上就是本文關(guān)于淺談python可視化包Bokeh的全部內(nèi)容,希望對大家有所幫助。感興趣的朋友可以繼續(xù)參閱本站其他相關(guān)專題,如有不足之處,歡迎留言指出。感謝朋友們對本站的支持!
新聞熱點(diǎn)
疑難解答
圖片精選