Python Forum
Plot Line chart based on the input
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Plot Line chart based on the input
#1
Having set of unknow data , need to plot Line chart based on three params
Example
Salesamount = [[28000.00,308000.00,582000.00,387000.00],[367000.00,3037000.00,4822000.00,2936000.00],[637000.00,3440000.00,4415000.00,3294000.00],[478000.00,1209000.00,478000.00,1209000.00]]
CalendarYear = [2010,2011,2012,2013]
Employee = [272,281,282,296]
Here X value=CalendarYear,Y value=Salesamount, Labels =CalendarYear
but while plotting line chart it is saying as we need to have same set of X value and Y value

line, = axes.plot(xdata, ydata, 'r-')
Error :
ValueError: x and y must have same first dimension, but have shapes (4,) and (4,4)

Thanks for your help.
Reply


Messages In This Thread
Plot Line chart based on the input - by parthi1705 - May-06-2019, 02:32 PM
RE: Plot Line chart based on the input - by scidam - May-07-2019, 11:43 AM
RE: Plot Line chart based on the input - by scidam - May-09-2019, 05:01 AM
RE: Plot Line chart based on the input - by get2sid - Feb-28-2023, 12:08 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to create a plot with line graphs and vertical bars devansing 6 2,443 Feb-28-2023, 05:38 PM
Last Post: devansing
  Pick a line in a plot with matplotlib Romain 3 5,714 Feb-28-2023, 11:56 AM
Last Post: get2sid
  Help to Plot timeline for intreruption of one line production danut_horincas 2 2,591 Feb-28-2023, 11:48 AM
Last Post: get2sid

Forum Jump:

User Panel Messages

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