python图标库_plotly.py 一个交互式、基于浏览器的python图表库

plotly.py

Latest Release

68747470733a2f2f62616467652e667572792e696f2f70792f706c6f746c792e737667

User forum

68747470733a2f2f696d672e736869656c64732e696f2f62616467652f68656c705f666f72756d2d646973636f757273652d626c75652e737667

PyPI Downloads

68747470733a2f2f706570792e746563682f62616467652f706c6f746c792f6d6f6e7468

License

68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667

Quickstart

pip install plotly==4.8.1

Inside Jupyter notebook (installable with pip install "notebook>=5.3" "ipywidgets>=7.2"):

import plotly.graph_objects as go

fig = go.Figure()

fig.add_trace(go.Scatter(y=[2, 1, 4, 3]))

fig.add_trace(go.Bar(y=[1, 4, 3, 2]))

fig.update_layout(title = 'Hello Figure')

fig.show()

See the Python documentation for more examples.

Read about what's new in plotly.py v4

Overview

plotly.py is an interactive, open-source, and browser-based graphing library for Python

Built on top of plotly.js, plotly.py is a high-level, declarative charting library. plotly.js ships with over 30 chart types, including scientific charts, 3D graphs, statistical charts, SVG maps, financial charts, and more.

plotly.py is MIT Licensed. Plotly graphs can be viewed in Jupyter notebooks, standalone HTML files, or hosted online using Chart Studio Cloud.

Contact us for consulting, dashboard development, application integration, and feature additions.

plotly_2017.png

Installation

plotly.py may be installed using pip...

pip install plotly==4.8.1

or conda.

conda install -c plotly plotly=4.8.1

Jupyter Notebook Support

For use in the Jupyter Notebook, install the notebook and ipywidgets packages using pip...

pip install "notebook>=5.3" "ipywidgets==7.5"

or conda.

conda install "notebook>=5.3" "ipywidgets=7.5"

JupyterLab Support (Python 3.5+)

For use in JupyterLab, install the jupyterlab and ipywidgets packages using pip...

pip install jupyterlab "ipywidgets==7.5"

or conda.

conda install jupyterlab "ipywidgets=7.5"

Then run the following commands to install the required JupyterLab extensions (note that this will require node to be installed):

# Basic JupyterLab renderer support

jupyter labextension install jupyterlab-plotly@4.8.1

# OPTIONAL: Jupyter widgets extension for FigureWidget support

jupyter labextension install @jupyter-widgets/jupyterlab-manager plotlywidget@4.8.1

Please check out our Troubleshooting guide if you run into any problems with JupyterLab.

Static Image Export

plotly.py supports static image export using the to_image and write_image functions in the plotly.io package. This functionality requires the installation of the plotly orca command line utility and the psutil Python package.

These dependencies can both be installed using conda:

conda install -c plotly plotly-orca==1.3.1 psutil

Or, psutil can be installed using pip...

pip install psutil

and orca can be installed according to the instructions in the orca README.

Troubleshooting

Wrong Executable found

If you get an error message stating that the orca executable that was found is not valid, this may be because another executable with the same name was found on your system. Please specify the complete path to the Plotly-Orca binary that you downloaded (for instance in the Miniconda folder) with the following command:

plotly.io.orca.config.executable = '/home/your_name/miniconda3/bin/orca'

Extended Geo Support

Some plotly.py features rely on fairly large geographic shape files. The county choropleth figure factory is one such example. These shape files are distributed as a separate plotly-geo package. This package can be installed using pip...

pip install plotly-geo==1.0.0

or conda

conda install -c plotly plotly-geo=1.0.0

Chart Studio support

The chart-studio package can be used to upload plotly figures to Plotly's Chart Studio Cloud or On-Prem service. This package can be installed using pip...

pip install chart-studio==1.0.0

or conda

conda install -c plotly chart-studio=1.0.0

Migration

If you're migrating from plotly.py v3 to v4, please check out the Version 4 migration guide

If you're migrating from plotly.py v2 to v3, please check out the Version 3 migration guide

Copyright and Licenses

Code and documentation copyright 2019 Plotly, Inc.

Code released under the MIT license.

Docs released under the Creative Commons license.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值