Skip to content
Advertisement

How to change the x-axis and y-axis labels in plotly?

How can I change the x and y-axis labels in plotly because in matplotlib, I can simply use plt.xlabel but I am unable to do that in plotly.

By using this code in a dataframe:

JavaScript

I get this output:

I get this output:

In this X and Y axis are labeled as X and Y how can I change the name of X and Y axis to “Date” and “Cases”

Advertisement

Answer

  • simple case of setting axis title
JavaScript

full code as MWE

JavaScript

enter image description here

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