Standard Deviation graph is slightly offset for one value

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Higeath
Posts: 9
Joined: Sun Oct 23, 2016 3:44 pm
antibot: No, of course not.

Standard Deviation graph is slightly offset for one value

Post by Higeath » Sun Oct 23, 2016 3:46 pm

With mean 3 and standard deviation 1 graph is slightly tilted and looks normal for all other values. It also happens with mean 6 sd 2, mean 9 sd 3 etc. here is an image of that happening http://imgur.com/a/fDP3M does anybody know why is that?

John Matthews
Posts: 513
Joined: Wed Sep 12, 2007 3:18 pm

Re: Standard Deviation graph is slightly offset for one valu

Post by John Matthews » Mon Oct 24, 2016 1:52 am

Cross-posted here.

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

Re: Standard Deviation graph is slightly offset for one valu

Post by david.gilbert » Mon Oct 24, 2016 7:10 am

There is a flag (autoRangeStickyZero) that you can set on the axis to control this:

Code: Select all

    /**
     * A flag that affects the size of the margins added to the axis range when
     * the range is determined automatically.  If the value 0 falls within the
     * margin and this flag is TRUE, then the margin is truncated at zero.
     */
    private boolean autoRangeStickyZero;
The default is true, so that when margins are added to the axis range but zero falls within the margin, then the axis is forced to start at zero. This very often is what people expect, but in your case not so set the flag the false.
David Gilbert
JFreeChart Project Leader

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

Locked