Serious LogAxis bug!!! Why hasn't anyone else noticed?!!

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
dlucas
Posts: 19
Joined: Sat Dec 29, 2007 5:07 am
Location: Boston (USA)

Serious LogAxis bug!!! Why hasn't anyone else noticed?!!

Post by dlucas » Wed Feb 13, 2008 12:16 am

Ok guys -

I've been using LogAxis for a month on an almost daily basis and I've noticed that there are a lot of posts about it so apparently other people are also using it.

Am I the only one so far that has noticed that LogAxis using base 10 (I haven't tried other bases, just the most common one) displays the WRONG NUMBER OF GRID LINES PER DECADE?!!! It draws 10 intervals per decade with 11 lines instead of 9 intervals per decade using 10 lines (Yes, I checked with several references, MathCAD, and other published graphs to be sure that I was right).

How could I work with this for a month and not notice? :lol:
What's worse, why has no one else noticed? :wink:
I kept thinking that I was tired and not counting correctly. I also noticed that when I plotted nice decimal numbers like 10, 100, etc that they showed up where I expected, but when I plotted numbers like 2, 3, 4 etc they would show up at 2.5, 3.5, 4.5 etc. Since I am working with some very complex FFT code, I just assumed that my spectral windowing functions were distorting the data!

If anyone has already developed a fix for this, please let me know, otherwise I'll take a look at it and try to fix it myself.

For the record, I am using 1.08a and you will find the problem in the demo program as "Log Axis Demo 1". Yes, you guessed it, in the experimental section.

Seriously, I really appreciate all of the great work on JFreeChart and am thoroughly enjoying working with the package.
Best regards,

Don

dlucas
Posts: 19
Joined: Sat Dec 29, 2007 5:07 am
Location: Boston (USA)

Post by dlucas » Thu Feb 14, 2008 6:49 am

I tested my code with the LogarithmicAxis and this axis displays the correct number of tick marks per decade, so the problem is definately a problem with LogAxis only.

I turned in a bug report on the Sourceforge site so maybe when David gets back we will get a fix?
Best regards,

Don

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Thu Feb 14, 2008 10:47 am

The fix is simple - just change the default number of minor tick marks to 9. It was set to 10 - I don't know what I was thinking there! I've committed the fix to Subversion for inclusion in the 1.0.10 release. In the meantime, as a workaround, you can just call axis.setMinorTickCount(9).
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

dlucas
Posts: 19
Joined: Sat Dec 29, 2007 5:07 am
Location: Boston (USA)

Post by dlucas » Tue Feb 19, 2008 6:52 am

Thanks, Dave -
Best regards,

Don

Locked