2

I've been working on a python-2.7-script for some time now and I want to plot a graph with dates on the x-axis. This does work fine, but there's a bug with the labeling of the axis sometimes (see image). labeling bug

This does not occur on every graph, because they all show different time spans (between ca. 1 and 15 years). This also means, that I can't use the solution, which is posted here: http://stefaanlippens.net/pylab_date_tick_control

It's only cosmetics, but I'd really appreciate a solution for the problem.

Thanks a lot

Julian

J. R.
  • 23
  • 3
  • doesn't look like a bug to me, it just looks like the font size is set too big and there isn't enough room for all the text you're trying to put there. Try shrinking the font size down a bit... – soohoonigan Oct 05 '16 at 19:23
  • Thanks, I'll try it. But I'm not sure if this solves the problem, because in some prints, the date ticks are really close together. – J. R. Oct 05 '16 at 21:06
  • Welcome to Stackoverflow! I am looking at the [docs of matplotlib.dates]( http://matplotlib.org/api/dates_api.html). Have you tried the `matplotlib.dates.AutoDateLocator(tz=None, minticks=5, maxticks=None, interval_multiples=False)` ? In particular, the argument `maxticks` could be used to reduce the number of dates on the x axis. You can also try to rotate the labels as described in http://stackoverflow.com/questions/11264521/date-ticks-and-rotation-in-matplotlib – francis Oct 05 '16 at 21:39

0 Answers0