Feb-22-2018, 08:33 PM
Hello I'm just starting to programme in Python :)
So I want to plot a graph using matplotlib.
my qustion is how to write a code which starts from the second line of data of a specific line
for example my plot is starts from 1962 but I want it starts from 1963.
how i do to make it works?
![[Image: Y6rLeDW.jpg]](https://i.imgur.com/Y6rLeDW.jpg)
Thank you for any advice,
So I want to plot a graph using matplotlib.
my qustion is how to write a code which starts from the second line of data of a specific line
for example my plot is starts from 1962 but I want it starts from 1963.
how i do to make it works?
![[Image: Y6rLeDW.jpg]](https://i.imgur.com/Y6rLeDW.jpg)
Thank you for any advice,
1 2 3 4 5 6 7 8 9 10 |
import matplotlib.pyplot as plt plt.stackplot(time, DDI * 100 , SDI * 100 ,CDI * 100 ,WDI * 100 , colors = [ 'green' , 'red' , 'yellow' , 'blue' ]) plt.title( 'Drive mechanism' ) plt.xlabel( 'Year' ) plt.ylabel( 'Drive %' ) plt.xticks(np.arange( min (time) + 1 , max (time), 5 )) plt.show() |