I am creating a candlestick plot using plotly.py. I would like to have a horizontal split and place the candlestick data in the top split and some data curves in the bottom bottom split. I do not need panning and zooming and that lower section of the candlestick chart with the zoom/pan controls is getting in my way.
How do you remove gridlines in Plotly? Toggling Axis grid lines Axis grid lines can be disabled by setting the showgrid property to False for the x and/or y axis. Here is an example of setting showgrid to False in the graph object figure constructor.
To disable this floating toolbar, we can pass a single config parameter to the plot function. We use the predefined config object in Plotly. And we just need to set displayModeBar to false in the config object. This parameter passed in dictionary format will hide the floating toolbar once and for all.
Adding Traces New traces can be added to a plot_ly figure using the add_trace() method. This method accepts a plot_ly figure trace and adds it to the figure. This allows you to start with an empty figure, and add traces to it sequentially.
The plotly.graph_objs module is the most important module that contains all of the class definitions for the objects that make up the plots you see.
To disable zoom and panning you need to set:
layout.xaxis.fixedrange = true
and layout.yaxis.fixedrange = true
.
To hide the controls you need to set displayModeBar = false
.
In Python this would for example look like this:
dcc.Graph(
id='my-id',
config={'displayModeBar': False},
'layout': go.Layout(
xaxis={'title': 'x-axis','fixedrange':True},
yaxis={'title': 'y-axis','fixedrange':True})
)
I disabled it with layout.xaxis.rangeslider.visible = false
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With