Skip to content
Advertisement

Plotly two Y axes: how to show one dataset as a linechart and the second one as a scatter plot

I have checked the documentation, but I have not found an answer to my question.

This code comes from Plotly (link here) and allows to create a plot with two Y axis from two different data sets:

JavaScript

Now. I want the data displayed in the second Y axis to be a scatter plot instead of a line. Is there a way to do it?

Thanks in advance.

Advertisement

Answer

You can set the mode to be "markers" instead of the default (which is "lines+markers"):

JavaScript

enter image description here

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement