在Rmd报告中显示Plotly express绘图(在python块中)

2024-10-02 22:24:26 发布

您现在位置:Python中文网/ 问答频道 /正文

基本上,当我运行python块时(在Rmd上使用网状结构)。show()将提供一个带有交互式绘图的新浏览器窗口作为输出

我可以将其集成到针织rmd中吗?

py_plot = px.choropleth(data_frame = py_plot_df,
                locations= "iso_alpha",
                color= "Confirmed",  # the value in the variable 'Confirmed' determines the color
                hover_name= "Country",
                color_continuous_scale="bluyl",  #  through all the color palettes , the dear old Viridis is also available in python!
                animation_frame= "Date")
py_plot.show()

Tags: theinpy绘图plotshow浏览器frame