Python Forum
How to make x-axis readable with matplotlib
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make x-axis readable with matplotlib
#5
I should have clarified... I don't need 256 dates on the x-axis. This normally happens when I have a dataframe with all cells filled in. One column is date and one column is some dependent variable. I would like a way to tell Python to only print the dates every x rows or beginning of every month, or maybe Y dates for the whole graph (divided accordingly), etc. Any of these could be fine.

My frustration is in not knowing a single approach to plt that will accommodate most of the frequent things I will need to do. This is how my data usually is: a frequency of dates and dependent variable(s) for each date. The data can go on for months to years and I may want to plot it all--but I certainly don't need all the dates printed.

One thing I do need, though, is for a date label to line up vertically with the y-value being plotted. My ideal solution here will not use an additional Class or anything not in the stock package because I can't believe this is anything too complicated that the stock package shouldn't be able to handle. I suspect that's what causing this problem.
Reply


Messages In This Thread
RE: How to make x-axis readable with matplotlib - by Mark17 - Mar-01-2022, 03:00 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  io.UnsupportedOperation: not readable RedSkeleton007 2 18,886 Nov-06-2023, 06:32 AM
Last Post: gpurdy
  matplotlib x-axis text move bottom upward jacklee26 3 1,056 May-31-2023, 04:28 AM
Last Post: jacklee26
  x-axis labels with Matplotlib Mark17 8 2,298 Mar-23-2022, 06:10 PM
Last Post: Mark17
  Function global not readable by 'main' fmr300 1 1,382 Jan-16-2022, 01:18 AM
Last Post: deanhystad
  matplotlib x axis range goes over the set range Pedroski55 5 3,287 Nov-21-2021, 08:40 AM
Last Post: paul18fr
  Sample labels from excel file in order to put them on x-axis and y-axis of a plot hobbyist 11 4,485 Sep-14-2021, 08:29 AM
Last Post: hobbyist
  Graphics Formatting - X-axis Notation and Annotations - Matplotlib silviover_junior 0 1,824 Mar-17-2021, 01:19 PM
Last Post: silviover_junior
  Matplotlib: How do I convert Dates from Excel to use in Matplotlib JaneTan 1 3,287 Mar-11-2021, 10:52 AM
Last Post: buran
  matplotlib x-axis wrong order SchroedingersLion 4 4,323 Feb-23-2021, 05:42 PM
Last Post: nilamo
  Help with Matplotlib and ordering the axis theliberalguy97 3 8,209 Dec-12-2020, 08:06 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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