Skip to content
Advertisement

Plotly displays unnecessary extra values on the x axis of a line chart

I’m plotting this dataframe:

JavaScript

Where:

JavaScript

But what actually comes out is this:

enter image description here

The x-axis has values of -1 and 24, when I don’t actually need them. There is no “-1 hour” or “24 hour”.

How do I format the plot not to show them?

EDIT: the answer for Plotly is layout_xaxis_range=[0,23], use it in the fig like this:

JavaScript

Advertisement

Answer

just plot it using this code:

JavaScript

And you can define xlim and ylim

JavaScript

enter image description here

Take a look at this document :https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.pyplot.xlim.html

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