Graph with different ticklabel & tick frequency

My graph has a range of -10 to +10. I would like to display labels with a frequency of 2 ( 0,2,4,6,8,10) while I want to display ticks with a frequency of 1.

My understanding is that tick & label frequency are both is controlled using a single attribute “dtick”. I don’t see any attribute to control label & tick frequency differently.

May I know if there is any way to achieve this?

CodePen link: https://codepen.io/sriram15690/pen/yRdZwj

There’s no easy way to do this at the moment unfortunately.

You can try using tickvalues and ticktext (with empty entries where you want ticks w/o labels) https://plot.ly/javascript/axes/#enumerated-ticks-with-tickvals-and-ticktext

@ etienne

Can we have different tick frequency & grid-line frequency in a Plotly graph?

Not at the moment unfortunately.