-4

By using: plt.xlim(0, 150)

I'm basically setting the interval of the x-axis from 0 to 150. It's fine to me but I need to visualize also the value of "90", which is not done by Python since it gives my a point every 20 (0-20-40-60-80-100-120-140). How can I add it?

I've tried by adding a plt.xlim inside an another plt.xlim, but didn't work.

Luuk
  • 12,245
  • 5
  • 22
  • 33
Ricter
  • 93
  • 1

1 Answers1

0

Please read about the parameters that can be used on xticks(), especially the optional part:

Source (matplotlib.pyplot.xticks)

matplotlib.pyplot.xticks(ticks=None, labels=None, *, minor=False, **kwargs)[source] Get or set the current tick locations and labels of the x-axis.

Pass no arguments to return the current values without modifying them.

Parameters : ticks array-like, optional The list of xtick locations. Passing an empty list removes all xticks.

labels array-like, optional The labels to place at the given ticks locations. This argument can only be passed if ticks is passed as well.

minor bool, default: False If False, get/set the major ticks/labels; if True, the minor ticks/labels.

**kwargs Text properties can be used to control the appearance of the labels.

Luuk
  • 12,245
  • 5
  • 22
  • 33