HPlotter
jhplot

Class HPlotter

    • Constructor Detail

      • HPlotter

        public HPlotter(String title,        int xsize,        int ysize,        int n1,        int n2)
        Create HPlot canvas with several plots.
        Parameters:
        title - Title
        xsize - size in x direction
        ysize - size in y direction
        n1 - number of plots/graphs in x
        n2 - number of plots/graphs in y
      • HPlotter

        public HPlotter(String title,        int xs,        int ys)
        Construct a HPlot canvas with a single plot.
        Parameters:
        title - Title for the canvas
        xs - size in x
        ys - size in y
      • HPlotter

        public HPlotter(String title,        int xs,        int ys,        boolean set)
        Construct a HPlot canvas with a single plot.
        Parameters:
        title - Title for the canvas
        xs - size in x
        ys - size in y
        set - set or not the graph (boolean)
      • HPlotter

        public HPlotter(String title)
        Construct a HPlot canvas with a plot with the size 600x400.
        Parameters:
        title - Title
      • HPlotter

        public HPlotter()
        Construct a HPlot canvas with a single plot with the size 600x400.
    • Method Detail

      • createRegion

        public void createRegion(double x,                double y,                double w,                double h)
        Create a new plotting region
        Parameters:
        x - X position
        y - Y position
        w - width
        h - height
      • cd

        public boolean cd(int cols,         int rows)
        Navigate to a selected plot. This is necessary if there are a several plots on the same canvas.
        Parameters:
        cols - Set the location of the current plot in x (horizontal)
        rows - Set the location of the current plot in y (vertical)
        return - false if error.
      • getCdX

        public int getCdX()
        Get location of the graph in the main canvas in X
        Returns:
        location of the graph in X
      • getCdY

        public int getCdY()
        Get location of the graph on the main canvas in Y
        Returns:
        location in Y
      • getNtotX

        public int getNtotX()
        Get the total number of graphs in X
        Returns:
        Total number of graphs in X
      • getNtotY

        public int getNtotY()
        Get the total number of the graphs in Y
        Returns:
        Total number of graphs in Y
      • visible

        public void visible(boolean vs)
        Set the canvas frame visible or not
        Parameters:
        vs - (boolean) true: visible, false: not visible
      • visible

        public void visible()
        Set the canvas frame visible
      • getPlotter

        public IPlotter getPlotter()
        Return JAS plotter
        Returns:
      • updateAll

        public void updateAll()
        Refresh all the plots on the same canvas HPLOT
      • update

        public void update()
        Update the current canvas.
      • export

        public void export(String file)
        Fast export of the canvas to an image file (depends on the extension, i.e. PNG, PDF, EPS, PS). No questions will be asked, an existing file will be rewritten
        Parameters:
        file - Output file with the proper extension. If no extension, PNG file is assumed.
      • doc

        public void doc()
        Show online documentation.
      • getTitle

        public String getTitle()
        Return title of this plotter.
        Overrides:
        getTitle in class Frame
        Returns:
      • close

        public void close()
        Close the canvas (and dispose all components).
      • draw

        public void draw(H1D h1,        IPlotterStyle style)
        Plot 1D histogram. Use external graphical options from Jaida.
        Parameters:
        h1 - Input H1D histogram
        style - Plotter style.
      • draw

        public void draw(H2D h2,        IPlotterStyle style)
        Plot 2D histogram. Use external graphical options from Jaida.
        Parameters:
        h2 - Input H2D histogram
        style - Plotter style.
      • draw

        public void draw(H2D h2,        String style_str)
        Plot 2D histogram. Use external graphical options from Jaida as strings: ColorMap, style2D, Box.
        Parameters:
        h2 - Input H2D histogram
        style - Plotter style as a string: ColorMap, style2D, Box
      • draw

        public void draw(H1D h1)
        Plot 1D histogram. Use graphical options of H1D histogram to use some style.
        Parameters:
        h1 - Input H1D histogram
      • draw

        public void draw(Histogram1D h1,        IPlotterStyle style)
        Draw Aida histogram with some plotter style
        Parameters:
        h1 - input Aida histogram
        style - style
      • draw

        public void draw(Histogram2D h2,        IPlotterStyle style)
        Draw 2D Aida histogram with some plotter style
        Parameters:
        h1 - input Aida histogram
        style - style
      • draw

        public void draw(Histogram1D h1)
        Draw Aida histogram with default style
        Parameters:
        h1 - Aida histogram
        datastyle - data style
      • draw

        public void draw(Histogram1D h1,        IDataStyle datastyle)
        Draw Aida histogram with some data style
        Parameters:
        h1 - Aida histogram
        datastyle - data style
      • draw

        public void draw(Histogram2D h2,        IDataStyle datastyle)
        Draw 2D Aida histogram with some dat style
        Parameters:
        h2 - Aida histogram
        datastyle - data style
      • draw

        public void draw(H2D h2)
        Draw 2D histogram as a density plot.
        Parameters:
        h2 - Input H2D histogram
      • draw

        public void draw(Histogram2D h2)
        Draw 2D histogram as a density plot.
        Parameters:
        h2 - Input 2D histogram
      • draw

        public void draw(IDataPointSet p1d)
        Plot AIDA data points.
        Parameters:
        p1d - input data points.
      • getPlotterStyle

        public IPlotterStyle getPlotterStyle()
        Get current plotter style.
        Returns:
      • getDataStyle

        public IDataStyle getDataStyle()
        Get current data style.
        Returns:
      • draw

        public void draw(IDataPointSet p1d,        IPlotterStyle style)
        Draw Aida data set with some style
        Parameters:
        p1d - Aida data set
        style - style
      • draw

        public void draw(IDataPointSet p1d,        IDataStyle datastyle)
        Draw Aida data set with some data style
        Parameters:
        p1d -
        datastyle -
      • draw

        public void draw(P1D p1d)
        Plot data points
        Parameters:
        p1d - input data points.
      • draw

        public void draw(F1D f1d)
        Draw a function. F1D should be created from AIDA.
        Parameters:
        f1d - input function;
      • draw

        public void draw(IFunction f1d)
        Draw a function using AIDA.
        Parameters:
        f1d - input function;
      • draw

        public void draw(IFunction f1d,        IPlotterStyle style)
        Draw Aida data set with some style
        Parameters:
        f1d - function.
        style - style
      • draw

        public void draw(IFunction f1d,        IDataStyle datastyle)
        Draw Aida function with some data style
        Parameters:
        f1d - function.
        datastyle -
      • draw

        public void draw(Cloud1D c1d)
        Draw a cloud using AIDA.
        Parameters:
        c1d - input cloud;
      • draw

        public void draw(Cloud1D c1d,        IPlotterStyle style)
        Draw Aida cloud with some style.
        Parameters:
        c1d - cloud.
        style - style
      • draw

        public void draw(Cloud1D c1d,        IDataStyle datastyle)
        Draw Aida cloud with some data style
        Parameters:
        c1d - cloud.
        datastyle -
      • draw

        public void draw(Cloud2D c2d)
        Draw Aida 2D cloud
        Parameters:
        c2d - 2D cloud
      • draw

        public void draw(Cloud2D c2d,        IPlotterStyle style)
        Draw Aida 2D cloud with some style
        Parameters:
        c2d - cloud.
        style - style
      • draw

        public void draw(Cloud2D c2d,        IDataStyle datastyle)
        Draw Aida cloud with some data style
        Parameters:
        c2d - cloud.
        datastyle -
      • setBackgColor

        public void setBackgColor(Color c)
        Sets the actual background color for current plot region.
        Parameters:
        c - background color.
      • setStatBox

        public void setStatBox(boolean set)
        Set statistical box to the current draw area (navigated with the cd() method.
        Parameters:
        set - true if set.
      • getStatBoxStyle

        public IStatisticsBoxStyle getStatBoxStyle()
        Get statistical box of the current draw area (navigated with the cd() method).
      • getLegendStyle

        public ILegendBoxStyle getLegendStyle()
        Get legend box of the current draw area (navigated with the cd() method).
      • getRegionStyle

        public IPlotterStyle getRegionStyle()
        Get style of the current plotting region.
      • getAxisStyle

        public IAxisStyle getAxisStyle(int axis)
        Return style of axis of the current region
        Parameters:
        axis - 0 for X, 1 for Y, 2 for Z
        Returns:
      • setStatColor

        public void setStatColor(Color foreg,                Color backg)
        Set colors of statistical box.
        Parameters:
        foreg - foreground color;
        backg - background color;
      • setStatFont

        public void setStatFont(Font f)
        Set position for the current statistical box
        Parameters:
        x - X position
        y - Y position
      • setStatBoxPos

        public void setStatBoxPos(double x,                 double y)
        Set position for the current statistical box
        Parameters:
        x - X position
        y - Y position
      • setLegendPos

        public void setLegendPos(double x,                double y)
        Set position for the current statistical box
        Parameters:
        x - X position
        y - Y position
      • setLegend

        public void setLegend(boolean set)
        Sets whether or not to draw the legend for the current plot.
        Parameters:
        set - true if you want to show the legend.
      • setLegendFont

        public void setLegendFont(Font f)
        Set legend fonts
        Parameters:
        x - X position
        y - Y position
      • getStyle

        public IPlotterStyle getStyle()
        Get style of the current graph.
        Returns:
      • setAutoRange

        public void setAutoRange()
        Set autorange in X and Y at the same time for the current plot
      • setAutoRange

        public void setAutoRange(boolean b)
        Set autorange in X and Y at the same time
        Parameters:
        b - if true, sets autorange
      • setRange

        public void setRange(int axis,            double min,            double max)
        Sets the range (min-max) displayed on the axis for the current plot.
        Parameters:
        axis - defines to which axis this function applies, generally something like X_AXIS or Y_AXIS.
        min - minimum value on the axis
        max - maximum value on the axis
      • setRangeX

        public void setRangeX(double min,             double max)
        Sets the range (min-max) displayed on X
        Parameters:
        min - minimum value on the axis
        max - maximum value on the axis
      • setRangeY

        public void setRangeY(double min,             double max)
        Sets the range (min-max) displayed on Y
        Parameters:
        min - minimum value on the axis
        max - maximum value on the axis
      • setRangeAll

        public void setRangeAll(int axis,               double min,               double max)
        Sets the range (min-max) displayed on all axises.
        Parameters:
        axis - defines to which axis this function applies, generally something like X_AXIS or Y_AXIS.
        min - minimum value on the axis
        max - maximum value on the axis
      • setRange

        public void setRange(double minX,            double maxX,            double minY,            double maxY)
        Sets the range for the current plot
        Parameters:
        minX - Min value in X
        maxX - Max value in X
        minY - Min value in Y
        maxY - Max value in Y
      • setRangeAll

        public void setRangeAll(double minX,               double maxX,               double minY,               double maxY)
        Sets the range for all plots
        Parameters:
        minX - Min value in X
        maxX - Max value in X
        minY - Min value in Y
        maxY - Max value in Y
      • setParAxis

        public boolean setParAxis(int axis,                 String par,                 String opt)
        Set parameters for the axis using strings
        Parameters:
        axis - axis 0=X, 1=Y
        par - parameter name
        opt - option name
        Returns:
        true if no error
      • setParRegion

        public boolean setParRegion(int axis,                   String par,                   String opt)
        Set parameters for the current region.
        Parameters:
        axis - axis 0=X, 1=Y
        par - parameter name
        opt - option name
        Returns:
        true if no error
      • getParAxis

        public List<String> getParAxis()
        Get available parameters for axis.
        Returns:
        list of parameters to set style
      • getOptRegion

        public List<String> getOptRegion(String parameter)
        Get options for available parameters of the plotting region.
        Parameters:
        parameter - input parameter
        Returns:
      • getOptAxis

        public List<String> getOptAxis(String parameter)
        Get options for available parameters
        Parameters:
        parameter - input parameter
        Returns:
      • setGTitle

        public void setGTitle(String sname,             Font f,             Color c)
        Set global title and its attributes
        Parameters:
        sname - name
        f - font
        c - color
      • setGTitle

        public void setGTitle(String sname,             Color c)
        Set the global title with default attributes. The default color is black. The default font is ("Arial", Font.BOLD, 20)
        Parameters:
        sname - Title
      • getSizeX

        public int getSizeX()
        Get the width of the main panel which keeps all margins and the central panel (in pixels)
        Returns:
        size in X direction (width)
      • getSizeY

        public int getSizeY()
        Get the height of the main panel which keeps all margins and the central panel (in pixels)
        Returns:
        size in Y direction (height)
      • setGTitle

        public void setGTitle(String sname)
        Set the global title with default attributes. The default color is black. The default font is ("Arial", Font.BOLD, 18)
        Parameters:
        sname - Title
      • distroy

        public void distroy()
        Close the frame (as close).
      • clear

        public void clear(int i1,         int i2)
        Clear the graph characterised by an index in X and Y. This method cleans the data and all graph settings.
        Parameters:
        i1 - location of the graph in X
        i2 - location of the graph in Y
      • setNameX

        public void setNameX(String s)
        Sets the name for X axis. The color is black, the font is ("Arial", Font.BOLD, 14)
        Parameters:
        s - Title for X axis.
      • setBackgColorGraph

        public void setBackgColorGraph(Color c)
        Sets the background color of the current graph. This is the area between the axes (hence not the entire panel area).
        Parameters:
        c - color.
      • setLogScale

        public void setLogScale(int axis,               boolean b)
        Sets true or false to plot on a log scale.
        Parameters:
        axis - defines to which axis this function applies, generally something like X_AXIS or Y_AXIS.
        b - toggle, true if the scaling is logarithmic
      • setNameX

        public void setNameX(String s,            Font f)
        Sets the name for X axis. The color is black, the font is ("Arial", Font.BOLD, 14)
        Parameters:
        s - Title for X axis.
        f - Font
      • setNameX

        public void setNameX(String s,            Font f,            Color c)
        Set the label for the axis in X for the current region.
        Parameters:
        s - label title
        f - Font
        c - Color
      • getMinValue

        public double getMinValue(int axis)
        Returns the minimum data value for the specified axis.
        Parameters:
        axis - Defines to which axis this function applies, generally something like X_AXIS or Y_AXIS.
        Returns:
        Minimum-value of the data range.
      • getMaxValue

        public double getMaxValue(int axis)
        Returns the maximum data value for the specified axis.
        Parameters:
        axis - Defines to which axis this function applies, generally something like X_AXIS or Y_AXIS.
        Returns:
        Maximum-value of the data range.
      • getParPlotter

        public List<String> getParPlotter()
        Get available parameters for this canvas.
        Returns:
        list of fonts
      • getParRegion

        public List<String> getParRegion()
        Get available parameters for this canvas.
        Returns:
        list of fonts
      • getTextFonts

        public List<String> getTextFonts()
        Get available fonts to draw text
        Returns:
        list of fonts
      • getParText

        public List<String> getParText()
        Get available parameters to draw text
        Returns:
        list of parameters
      • setNameY

        public void setNameY(String s)
        Sets the name for Y axis. The color is black, the font is ("Arial", Font.BOLD, 14)
        Parameters:
        s - Title for Y axis.
      • setNameY

        public void setNameY(String s,            Font f)
        Sets the name for Y axis. The color is black, the font is ("Arial", Font.BOLD, 14)
        Parameters:
        s - Title for Y axis.
        f - Font
      • setNameY

        public void setNameY(String s,            Font f,            Color c)
        Sets the Title for Y-axis
        Parameters:
        s - Label name
        f - Font
        c - Color
      • setName

        public void setName(String name)
        Sets a title for the current plot. The default color is black, the font is ("Arial", Font.BOLD, 18),
        Overrides:
        setName in class Component
        Parameters:
        name - Title
      • setName

        public void setName(String s,           Font f,           Color c)
        Sets a title for the current plot with all attributes
        Parameters:
        s - Title
        f - Font
        c - Color
      • setName

        public void setName(String s,           Font f)
        Sets a title for the current plot with all attributes
        Parameters:
        s - Title
        f - Font
      • setTicStyle

        public void setTicStyle(int axis,               Font f,               Color c)
        Sets the color used by the labels drawn at each tick.
        Parameters:
        axis - defines to which axis this function applies, generally something like X_AXIS or Y_AXIS. Use 0 for X and 1 for Y.
        c - the new color
      • setTicColor

        public void setTicColor(Color c)
        Sets the color used by the labels drawn at each tick (for all axes).
        Parameters:
        c - the new color for each axis.
      • setTicFont

        public void setTicFont(Font f)
        Sets the color used by the labels drawn at each tick (for all axises).
        Parameters:
        c - the new color for each axis.
      • getAxesColor

        public Color getAxesColor()
        Returns the actual color of the axes of the graph.
        Returns:
        actual color used to draw the axes.
      • setAxesColor

        public void setAxesColor(Color c)
        Sets the actual color of the axes of the graph.
        Parameters:
        c - new color to draw the axes.

SCaVis 2.0 © jWork.ORG