Wie stelle ich die Achsengrenzen in Matplotlib ein?

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Wie stelle ich die Achsengrenzen in Matplotlib ein?

by Guest » 08 Feb 2025, 18:00

Ich brauche Hilfe bei der Festlegung der Grenzen der y-Achse auf Matplotlib. Hier ist der Code, den ich erfolglos ausprobiert habe.

Code: Select all

import matplotlib.pyplot as plt

plt.figure(1, figsize = (8.5,11))
plt.suptitle('plot title')
ax = []
aPlot = plt.subplot(321, axisbg = 'w', title = "Year 1")
ax.append(aPlot)
plt.plot(paramValues,plotDataPrice[0], color = '#340B8C',
marker = 'o', ms = 5, mfc = '#EB1717')
plt.xticks(paramValues)
plt.ylabel('Average Price')
plt.xlabel('Mark-up')
plt.grid(True)
plt.ylim((25,250))
Mit den Daten, die ich für dieses Diagramm habe, erhalte ich Y-Achse-Grenzen von 20 und 200. Ich möchte jedoch, dass die Grenzen 20 und 250 sind.

Top