Show Sidebar Hide Sidebar

Configuration in Python

How to set configuration options of plotly graphs in python. Examples of both online and offline configurations.

New to Plotly?¶

Plotly's Python library is free and open source! Get started by downloading the client and reading the primer.
You can set up Plotly to work in online or offline mode, or in jupyter notebooks.
We also have a quick-reference cheatsheet (new!) to help you get started!

Online Configuration Options¶

Config options set via our API libraries are overridden on graphs hosted on plot.ly (i.e. when working online). To set configutation options online, you can edit the plot's embed url. Visit our embed tutorial: http://help.plot.ly/embed-graphs-in-websites/#step-8-customize-the-iframe for more information on customizing the embed url to remove the "Edit Chart" link, hide the modebar, or autosize the plot.

Offline Configuration Options¶

Now you can pass a config dictionary with all configurations options such as showLink, linkText, scrollZoom, and displayModeBar. For the complete list of config options check out: https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_config.js



Remove the "Edit Chart" link:

In [10]:
from plotly.offline import init_notebook_mode, iplot
import plotly.graph_objs as go

init_notebook_mode()

data = [
    go.Scatter(
        x=[1, 2, 3],
        y=[1, 3, 1]
    )
]

config={'showLink': False}
iplot(data, config=config)