Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
dates on graph
#13
Hi Yoriz,
this part of the code seems to be the problem"
y = [mov_index(position1, position1+10), mov_index(position2, position2+10), mov_index(position3, position3+10)]
x = [CEU_times[position1] + datetime.timedelta(days=i) for i in range(len(y))]
ax = plt.subplot(111)
ax.bar(x, y, width=5)
ax.xaxis_date()
 
plt.setp(ax.get_xticklabels(), rotation=45, fontsize=10)
plt.show()
If I try to change the width of the bar, that seems to change the format of the date I see on the graph.I want to be able to see year-month-date instead of month-date-hour, and I want the x-axis to be separated by hours (for a better Idea if what I mean, kindly refer to the link http://ctr.maths.lu.se/na/courses/NUMA01.../birds.pdf). So far, the only way for me to be able to see the dates in the right format, is to keep the width of the bars to a minimum of 5, which is too much if I want them to be separated and have a better picture. If I lower that 5, the date format in the graph immediately changes to month-day-hour.
Let me please know if additional info are needed.
Reply


Messages In This Thread
plot list bar graph - by mcgrim - May-22-2019, 09:16 PM
RE: plot list bar graph - by mcgrim - May-23-2019, 08:53 AM
datetime object location - by mcgrim - May-25-2019, 08:10 PM
RE: dates on graph - by Yoriz - May-27-2019, 06:28 AM
RE: datetime object location - by mcgrim - May-25-2019, 10:31 PM
dates on graph - by mcgrim - May-25-2019, 11:03 PM
RE: dates on graph - by Yoriz - May-26-2019, 03:44 PM
RE: dates on graph - by mcgrim - May-26-2019, 03:57 PM
RE: dates on graph - by Yoriz - May-26-2019, 04:00 PM
RE: dates on graph - by mcgrim - May-26-2019, 04:05 PM
RE: dates on graph - by Yoriz - May-26-2019, 04:13 PM
RE: dates on graph - by mcgrim - May-26-2019, 05:08 PM
RE: dates on graph - by Yoriz - May-26-2019, 06:32 PM
RE: dates on graph - by mcgrim - May-26-2019, 07:53 PM
RE: dates on graph - by Yoriz - May-26-2019, 11:00 PM
RE: datetime object location - by micseydel - May-27-2019, 12:22 AM
RE: plot list bar graph - by nilamo - May-29-2019, 09:26 PM

Forum Jump:

User Panel Messages

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