JyplotVanilla
jyplot

Class JyplotVanilla

  • All Implemented Interfaces:
    Serializable
    Direct Known Subclasses:
    Jyplot, Plot


    public class JyplotVanillaextends Objectimplements Serializable
    The only dependenecies this class has is to JFreeChart itself. That means that is will load quicker and the memory footprint will be smaller. However, it lacks advanced options such as

    Saving EPS, SVG, or PDF images.

    Nice for-Jython methods

    Passing Colt numerical arrays to plot methods.

    See Also:
    Serialized Form
    • Constructor Detail

      • JyplotVanilla

        public JyplotVanilla(boolean enableJFrame)
      • JyplotVanilla

        public JyplotVanilla()
    • Method Detail

      • subplot

        public void subplot(int number)
      • subplot

        public void subplot(int rows,           int cols,           int plotnumber)
        Holds a list of arrays with the plots
        Parameters:
        rows -
        cols -
        plotnumber -
      • show

        public void show()
      • show

        public void show(int width,        int height)
      • plot

        public XYDataset plot(double[] x,             double[] y)
        Plot X and Y
        Parameters:
        x - x values
        y - y values
        Returns:
      • plot

        public XYDataset plot(double[] x,             double[] y,             Color color,             String dataname,             double[] yErrorBars,             boolean seperateYAxis,             boolean yaxisVisible,             String rangeLabel,             boolean shapesVisible)
      • title

        public void title(String p)
        sets the chart title
        Parameters:
        p -
      • title

        public void title(String p,         int fontsize)
      • xlabel

        public void xlabel(String p)
        sets the x-axis label
        Parameters:
        p -
      • ylabel

        public void ylabel(String p)
        sets the y-axis label
        Parameters:
        p -
      • legend

        public void legend(String[] p)
        set series labels (keys) for the legend
        Parameters:
        p - []
      • label

        public void label(String p)
        set series label (key) for the legend for the most recent dataset
        Parameters:
        p - []
      • linestyle

        public void linestyle(String[] p)
        %% sets the line style (solid, dashed, ...) for each Series
        Parameters:
        p - []
      • linewidth

        public void linewidth(float[] p)
        sets the line width for each Series
        Parameters:
        p - []
      • linecolor

        public void linecolor(Color[] p)
        %% sets the line color for each Series
        Parameters:
        p - []
      • axis

        public void axis(double[] p)
        sets the axis range manually
        Parameters:
        p - [] gets an array of the axis boundries: p0 = lower x, p1 = upper x p2 = lower y, p3 = upper y
      • xlim

        public void xlim(double min,        double max)
        Sets the x axis range manually
      • ylim

        public void ylim(double min,        double max)
        Sets the y axis range manually
      • loglog

        public void loglog(int p)
        transforms axes into a logarithmic scale
        Parameters:
        p - assign x- and y-axis as logarithmic
      • loglog

        public void loglog()
      • main

        public static void main(String[] args)
        Parameters:
        args - method for testing Jylab
      • bar

        public void bar(Object[] x,       double[] y,       Color color)
        A quick hack to draw bar plots with whatever axis
        Parameters:
        y -
        x -
      • bar

        public void bar(Object[] x,       double[] y)
      • bar

        public void bar(double left,       double height,       double width,       double bottom,       Color color)
      • bar

        public BarXYDataset bar(double[] left,               double[] height,               double[] width,               double[] bottom,               Color color)
        BAR(left, height, width=0.8, bottom=0, color='b', yerr=None, xerr=None, ecolor='k', capsize=3) Make a bar plot with rectangles at left, left+width, 0, height left and height are Numeric arrays. *Currently this second argument format is not implemented... Return value is a list of Rectangle patch instances BAR(left, height, width, bottom, color, yerr, xerr, capsize, yoff) xerr and yerr, if not None, will be used to generate errorbars on the bar chart color specifies the color of the bar ecolor specifies the color of any errorbar capsize determines the length in points of the error bar caps The optional arguments color, width and bottom can be either scalars or len(x) sequences This enables you to use bar as the basis for stacked bar charts, or candlestick plots Addition kwargs: hold = [True|False] overrides default hold state
      • xticks

        public void xticks(double[] locations,          String[] ticklabels)
        Not properly tested.
        Parameters:
        ticklabels -
      • yticks

        public void yticks(double[] locations,          String[] ticklabels)
      • getChartPanelMap

        public HashMap getChartPanelMap()
      • drawToGraphics2D

        public void drawToGraphics2D(Graphics2D g,                    int width,                    int height)
      • color

        public void color(Color c)
        Colors the most recent dataset or series
        Parameters:
        c -
      • color

        public void color(String s)
        Colors the most recent dataset or series
        Parameters:
        s -
      • getColor

        public Color getColor(String s)
        Converts a string into a Color object. Checks a few local maps and the styleSheet class.
        Parameters:
        s -
        Returns:
      • color

        public void color(int[] rgba)
        Colors the most recent dataset or series
      • color

        public void color(float value)
        Colors the most recent dataset or series
      • getChart

        public JFreeChart getChart()
        Get chart
        Returns:
      • getChart

        public JFreeChart getChart(int row,                  int col)
      • getChartToPanelMap

        public HashMap getChartToPanelMap()
      • setChartToPanelMap

        public void setChartToPanelMap(HashMap chartToPanelMap)
      • getFrame

        public JFrame getFrame()
      • setFrame

        public void setFrame(JFrame frame)
      • getJpanel

        public JPanel getJpanel()
      • setJpanel

        public void setJpanel(JPanel jpanel)
      • text

        public void text(String text,        double x,        double y)
        Add some text at data coordinates x,y
        Parameters:
        text -
        x -
        y -
      • difference

        public void difference(double[] x,              double[] y1,              double[] y2,              Color color,              boolean multipleAxes)
        Plots a difference plot, y1 - y2 is shaded
      • getCols

        public int getCols()
      • getRows

        public int getRows()
      • hist

        public void hist(double[] data,        int bins)
      • hist

        public void hist(double[] data,        int bins,        String dataname)
      • grid

        public void grid(boolean state)
      • gridx

        public void gridx(boolean state)
      • gridy

        public void gridy(boolean state)
      • clf

        public void clf()
        Clears the current figure. Preserves compatability with matplotlib.
      • errorbar

        public Dataset errorbar(double[] x,               double[] y,               double[] xerr,               double[] yerr,               Color color,               boolean barsabove)
        errorbar(x, y, yerr=None, xerr=None, fmt='b-', ecolor=None, capsize=3, barsabove=False
      • setRangeSpace

        public void setRangeSpace(double x)
      • setDomainSpace

        public void setDomainSpace(double x)
      • savefig

        public void savefig(String filename)
        This assumes
        Parameters:
        filename -
      • savefig

        public void savefig(String filename,           int width,           int height)
      • setQuitOnWindowClose

        public void setQuitOnWindowClose(boolean close)
      • setShapesVisible

        public void setShapesVisible(boolean visible)
      • setBackgColor

        public void setBackgColor(Color color)
        Sets the actual background color of the entire graph panel. Note that it is possible to set the color of the area within the axes system separately.
        Parameters:
        color - New background color.
      • setAntiAlias

        public void setAntiAlias(boolean isAntiAlias)
        Set anti-Alias
        Parameters:
        isAntiAlias -

SCaVis 2.2 © jWork.ORG