![]() |
Plot a graph using matplotlib.pyplot - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Plot a graph using matplotlib.pyplot (/thread-8492.html) |
Plot a graph using matplotlib.pyplot - Tibas - Feb-22-2018 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? ![]() Thank you for any advice, 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() RE: Plot a graph using matplotlib.pyplot - Tibas - Feb-23-2018 Hi, thanks to Julián Urrea from facebook but in the second term time[50] of the code how I know the last number of my list, maybe i have 200 lines? plt.xlim([time[2],time[50]]) Hi I found the solution ;) plt.xlim([time[2],max(time)]) |