Python Forum
Plot a graph using matplotlib.pyplot
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Plot a graph using matplotlib.pyplot
#1
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]

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()
Reply


Messages In This Thread
Plot a graph using matplotlib.pyplot - by Tibas - Feb-22-2018, 08:33 PM
RE: Plot a graph using matplotlib.pyplot - by Tibas - Feb-23-2018, 10:47 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Embed Matplotlib Graph to Tkinter? dimidgen 0 268 Mar-04-2024, 07:40 PM
Last Post: dimidgen
  first time use plot - I get empty graph korenron 6 2,188 Feb-04-2023, 02:14 PM
Last Post: deanhystad
  Graphic line plot with matplotlib, text file in pytho khadija 2 1,424 Aug-15-2022, 12:00 PM
Last Post: khadija
  Is Matplotlib.pyplot Loaded DaveG 2 1,358 Apr-06-2022, 06:12 AM
Last Post: DaveG
  How to conditionally specify markers in matplotlib graph Mark17 3 3,290 Mar-03-2022, 07:42 PM
Last Post: Mark17
  Python 3.10 not happy with Pandas and PyPlot? Danno 1 1,598 Feb-26-2022, 05:35 AM
Last Post: Danno
  plot on the same figure using a for loo with matplotlib drSlump 2 1,740 Oct-13-2021, 07:11 AM
Last Post: drSlump
  matplotlib, no plot when using Figure ajvperth 2 1,715 Oct-12-2021, 02:29 PM
Last Post: ajvperth
  Unable to plot the graph as needed drunkenneo 1 6,422 May-26-2021, 11:04 AM
Last Post: cygnus_X1
  blank graph with matplotlib from a csv file / data type issue arsentievalex 0 1,975 Apr-06-2021, 10:08 AM
Last Post: arsentievalex

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020