Black Lives Matter. Please consider donating to Black Girls Code today.

Tick0 and dtick not working

Hi,

I am setting the next properties on a scatter plot:

layout = go.Layout(title='Evolución de los puntos',
                   xaxis = {'title': 'Jornadas',
                            'range': [0, 40],
                            'dtick': 4},
                   yaxis = {'title': 'Puntos', 
                            'tickmode': 'linear',
                            'tick0': 0,
                            'dtick': 3},
                   hovermode = 'closest')

return {'data': traces, 'layout': layout}

However, I get the same plot:

Why Y-axis does not start at zero?

tick0 is just used for the relative position of the ticks. Set the range to [0, 45] if you want the yaxis to start at 0

Ok thanks!

I was used range before but the thing is I don’t know what the max_range is.
How can I set only one part of the range? Like [0, None]

Where None would ideally means max(y) of the visible traces

You could try rangemode: "tozero" - https://plot.ly/python/reference/#layout-yaxis-rangemode

1 Like

This was exactly what I was looking for. Thanks you so much!