Necesito ayuda con la configuración de los límites del eje y en matplotlib. Aquí está el código que he intentado, sin éxito.
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))
Con los datos que tengo para este gráfico, obtengo los límites del eje y de 20 y 200. Sin embargo, quiero que los límites 20 y 250.
Esto debería funcionar. Su código funciona para mí, como para Tamás y Manoj Govindan. Parece que podrías intentar actualizar Matplotlib. Si no puedes actualizar Matplotlib (por ejemplo, si no tienes suficientes derechos administrativos), tal vez usar un backend diferente con matplotlib.use()
podría ayudar.