Announcing Dash Bio 1.0.0 🎉 : a one-stop-shop for bioinformatics and drug development visualizations.

Hide y1-axis grid

I have a double y-axis plot where I am plotting a line and bars. I want the line to be in front of the bars. Due to this, I have found out that no matter what happens, the secondary y-axis trace will be placed on top of the primary y-axis. Personally, this feels like a flaw, because the primary y-axis is often the more important of the two. Regardless, I was able to get around this using this:

 fig.update_layout(yaxis1=dict(anchor='x', domain=[0,1], side='right'),                 
                      yaxis2=dict(anchor='x', side='left', overlaying='y1'))

Great they’re switched. Now though, I only want the grid for the y2-axis to show and want the y1-axis grid off. I tried doing this:

fig.update_layout(yaxis1_showgrid=False, yaxis2_showgrid=True)

But it doesn’t seem like yaxis1_showgrid is an available option. How can I turn off the primary axis grid?

I found the issue. The command is yaxis_showgrid=False not yaxis1_showgrid=False.