Documentation of 'org.jfree.chart.axis.LogarithmicAxis' Java class
LogarithmicAxis
org.jfree.chart.axis

Class LogarithmicAxis

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, org.jfree.util.PublicCloneable


    public class LogarithmicAxis
    extends NumberAxis
    A numerical axis that uses a logarithmic scale.
    See Also:
    Serialized Form
    • Field Detail

      • LOG10_VALUE

        public static final double LOG10_VALUE
        Useful constant for log(10).
      • SMALL_LOG_VALUE

        public static final double SMALL_LOG_VALUE
        Smallest arbitrarily-close-to-zero value allowed.
        See Also:
        Constant Field Values
    • Constructor Detail

      • LogarithmicAxis

        public LogarithmicAxis(java.lang.String label)
        Creates a new axis.
        Parameters:
        label - the axis label.
    • Method Detail

      • setAllowNegativesFlag

        public void setAllowNegativesFlag(boolean flgVal)
        Sets the 'allowNegativesFlag' flag; true to allow negative values in data, false to be able to plot positive values arbitrarily close to zero.
        Parameters:
        flgVal - the new value of the flag.
      • getAllowNegativesFlag

        public boolean getAllowNegativesFlag()
        Returns the 'allowNegativesFlag' flag; true to allow negative values in data, false to be able to plot positive values arbitrarily close to zero.
        Returns:
        The flag.
      • setStrictValuesFlag

        public void setStrictValuesFlag(boolean flgVal)
        Sets the 'strictValuesFlag' flag; if true and 'allowNegativesFlag' is false then this axis will throw a runtime exception if any of its values are less than or equal to zero; if false then the axis will adjust for values less than or equal to zero as needed.
        Parameters:
        flgVal - true for strict enforcement.
      • getStrictValuesFlag

        public boolean getStrictValuesFlag()
        Returns the 'strictValuesFlag' flag; if true and 'allowNegativesFlag' is false then this axis will throw a runtime exception if any of its values are less than or equal to zero; if false then the axis will adjust for values less than or equal to zero as needed.
        Returns:
        true if strict enforcement is enabled.
      • setExpTickLabelsFlag

        public void setExpTickLabelsFlag(boolean flgVal)
        Sets the 'expTickLabelsFlag' flag. If the 'log10TickLabelsFlag' is false then this will set whether or not "1e#"-style tick labels are used. The default is to use regular numeric tick labels.
        Parameters:
        flgVal - true for "1e#"-style tick labels, false for log10 or regular numeric tick labels.
      • getExpTickLabelsFlag

        public boolean getExpTickLabelsFlag()
        Returns the 'expTickLabelsFlag' flag.
        Returns:
        true for "1e#"-style tick labels, false for log10 or regular numeric tick labels.
      • setLog10TickLabelsFlag

        public void setLog10TickLabelsFlag(boolean flag)
        Sets the 'log10TickLabelsFlag' flag. The default value is false.
        Parameters:
        flag - true for "10^n"-style tick labels, false for "1e#"-style or regular numeric tick labels.
      • getLog10TickLabelsFlag

        public boolean getLog10TickLabelsFlag()
        Returns the 'log10TickLabelsFlag' flag.
        Returns:
        true for "10^n"-style tick labels, false for "1e#"-style or regular numeric tick labels.
      • setAutoRangeNextLogFlag

        public void setAutoRangeNextLogFlag(boolean flag)
        Sets the 'autoRangeNextLogFlag' flag. This determines whether or not the 'autoAdjustRange()' method will select the next "10^n" values when determining the upper and lower bounds. The default value is false.
        Parameters:
        flag - true to make the 'autoAdjustRange()' method select the next "10^n" values, false to not.
      • getAutoRangeNextLogFlag

        public boolean getAutoRangeNextLogFlag()
        Returns the 'autoRangeNextLogFlag' flag.
        Returns:
        true if the 'autoAdjustRange()' method will select the next "10^n" values, false if not.
      • setRange

        public void setRange(Range range)
        Overridden version that calls original and then sets up flag for log axis processing.
        Overrides:
        setRange in class ValueAxis
        Parameters:
        range - the new range.
        See Also:
        ValueAxis.getRange()
      • switchedPow10

        public double switchedPow10(double val)
        Returns a power of 10, depending on if values between 0 and 1 are being plotted. If negative values are not allowed and the lower bound is between 0 and 10 then a normal power is returned; otherwise the returned value is adjusted if the given value is less than 1.
        Parameters:
        val - the value.
        Returns:
        10val.
        Since:
        1.0.5
        See Also:
        switchedLog10(double)
      • adjustedLog10

        public double adjustedLog10(double val)
        Returns an adjusted log10 value for graphing purposes. The first adjustment is that negative values are changed to positive during the calculations, and then the answer is negated at the end. The second is that, for values less than 10, an increasingly large (0 to 1) scaling factor is added such that at 0 the value is adjusted to 1, resulting in a returned result of 0.
        Parameters:
        val - value for which log10 should be calculated.
        Returns:
        An adjusted log10(val).
        See Also:
        adjustedPow10(double)
      • adjustedPow10

        public double adjustedPow10(double val)
        Returns an adjusted power of 10 value for graphing purposes. The first adjustment is that negative values are changed to positive during the calculations, and then the answer is negated at the end. The second is that, for values less than 1, a progressive logarithmic offset is subtracted such that at 0 the returned result is also 0.
        Parameters:
        val - value for which power of 10 should be calculated.
        Returns:
        An adjusted 10val.
        Since:
        1.0.5
        See Also:
        adjustedLog10(double)
      • autoAdjustRange

        public void autoAdjustRange()
        Rescales the axis to ensure that all data is visible.
      • valueToJava2D

        public double valueToJava2D(double value,
                                    java.awt.geom.Rectangle2D plotArea,
                                    org.jfree.ui.RectangleEdge edge)
        Converts a data value to a coordinate in Java2D space, assuming that the axis runs along one edge of the specified plotArea. Note that it is possible for the coordinate to fall outside the plotArea.
        Overrides:
        valueToJava2D in class NumberAxis
        Parameters:
        value - the data value.
        plotArea - the area for plotting the data.
        edge - the axis location.
        Returns:
        The Java2D coordinate.
        See Also:
        NumberAxis.java2DToValue(double, Rectangle2D, RectangleEdge)
      • java2DToValue

        public double java2DToValue(double java2DValue,
                                    java.awt.geom.Rectangle2D plotArea,
                                    org.jfree.ui.RectangleEdge edge)
        Converts a coordinate in Java2D space to the corresponding data value, assuming that the axis runs along one edge of the specified plotArea.
        Overrides:
        java2DToValue in class NumberAxis
        Parameters:
        java2DValue - the coordinate in Java2D space.
        plotArea - the area in which the data is plotted.
        edge - the axis location.
        Returns:
        The data value.
        See Also:
        NumberAxis.valueToJava2D(double, Rectangle2D, RectangleEdge)
      • zoomRange

        public void zoomRange(double lowerPercent,
                              double upperPercent)
        Zooms in on the current range.
        Overrides:
        zoomRange in class ValueAxis
        Parameters:
        lowerPercent - the new lower bound.
        upperPercent - the new upper bound.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.