Package jisa.gui

Class Plot

    • Field Detail

      • UNIT_PATTERN

        public static final java.util.regex.Pattern UNIT_PATTERN
    • Constructor Detail

      • Plot

        public Plot​(java.lang.String title,
                    java.lang.String xLabel,
                    java.lang.String xUnits,
                    java.lang.String yLabel,
                    java.lang.String yUnits)
      • Plot

        public Plot​(java.lang.String title,
                    java.lang.String xLabel,
                    java.lang.String yLabel)
      • Plot

        public Plot​(java.lang.String title)
      • Plot

        public Plot()
      • Plot

        public Plot​(java.lang.String title,
                    ResultTable table)
      • Plot

        public Plot​(java.lang.String title,
                    ResultTable table,
                    Column<? extends java.lang.Number> xAxis)
      • Plot

        public Plot​(java.lang.String title,
                    ResultTable table,
                    Column<? extends java.lang.Number> xAxis,
                    Column<? extends java.lang.Number> yAxis)
      • Plot

        public Plot​(java.lang.String title,
                    java.lang.Iterable<? extends java.lang.Number> xData,
                    java.lang.Iterable<? extends java.lang.Number> yData)
    • Method Detail

      • updateLegend

        public void updateLegend()
      • forceRedraw

        public void forceRedraw()
      • isLegendVisible

        public boolean isLegendVisible()
        Returns whether the legend of this plot is currently visible.
        Returns:
        Is the legend visible?
      • setLegendVisible

        public void setLegendVisible​(boolean visible)
        Sets whether the legend of this plot should be visible or not.
        Parameters:
        visible - Should the legend be visible?
      • setXLabel

        public void setXLabel​(java.lang.String name,
                              java.lang.String units)
        Sets the label and units to display on the x-axis of this plot.
        Parameters:
        name - The label text
        units - The units of the axis
      • setXLabel

        public void setXLabel​(java.lang.String name)
        Sets the label to display on the x-axis of this plot. Units can be optionally specified in square brackets. For example: "Voltage [V]".
        Parameters:
        name - The label text, optionally including units in square brackets [...]
      • setXUnit

        public void setXUnit​(java.lang.String unit)
        Sets the units of the x-axis of this plot.
        Parameters:
        unit - Units for x-axis
      • setYUnit

        public void setYUnit​(java.lang.String unit)
        Sets the units of the y-axis of this plot.
        Parameters:
        unit - Units for y-axis
      • setTitle

        public void setTitle​(java.lang.String title)
        Sets the title of this plot.
        Specified by:
        setTitle in interface Element
        Overrides:
        setTitle in class JFXElement
        Parameters:
        title - Title of plot
      • getXUnit

        public java.lang.String getXUnit()
        Returns the units of the x-axis of this plot.
        Returns:
        X-axis units
      • getYUnit

        public java.lang.String getYUnit()
        Returns the units of the y-axis of this plot.
        Returns:
        Y-axis units
      • getXLabel

        public java.lang.String getXLabel()
      • getYLabel

        public java.lang.String getYLabel()
      • setYLabel

        public void setYLabel​(java.lang.String name,
                              java.lang.String units)
      • setYLabel

        public void setYLabel​(java.lang.String name)
      • setXLimits

        public void setXLimits​(double min,
                               double max)
      • setXMin

        public void setXMin​(double min)
      • setXMax

        public void setXMax​(double min)
      • getXMin

        public double getXMin()
      • getXMax

        public double getXMax()
      • autoRangeX

        public void autoRangeX()
      • isXAutoRanging

        public boolean isXAutoRanging()
      • setYLimits

        public void setYLimits​(double min,
                               double may)
      • setYMin

        public void setYMin​(double min)
      • setYMax

        public void setYMax​(double min)
      • getYMin

        public double getYMin()
      • getYMax

        public double getYMax()
      • autoRangeY

        public void autoRangeY()
      • isYAutoRanging

        public boolean isYAutoRanging()
      • getSeries

        public java.util.List<Series> getSeries()
      • createSeries

        public Series createSeries()
      • removeSeries

        public void removeSeries​(Series toRemove)
      • clear

        public void clear()
        Specified by:
        clear in interface Clearable
      • setXAxisType

        public void setXAxisType​(Plot.AxisType type)
      • setYAxisType

        public void setYAxisType​(Plot.AxisType type)
      • setXAxisLogarithmBase

        public void setXAxisLogarithmBase​(double base)
      • setYAxisLogarithmBase

        public void setYAxisLogarithmBase​(double base)
      • getXAxisLogarithmBase

        public double getXAxisLogarithmBase()
      • getYAxisLogarithmBase

        public double getYAxisLogarithmBase()
      • addSaveButton

        public Button addSaveButton​(java.lang.String text)
        Adds toolbar button that opens the plot save dialog when clicked.
        Parameters:
        text - Text to show
      • showSaveDialog

        public void showSaveDialog()
        Shows a dialogue allowing the user to save this plot as an image, with user-alterable parameters of format, width and height.
      • setMouseEnabled

        public void setMouseEnabled​(boolean enabled)
      • isMouseEnabled

        public boolean isMouseEnabled()
      • copy

        public Plot copy()
      • savePNG

        public void savePNG​(java.lang.String path,
                            double w,
                            double h)
      • getSVG

        public SVG getSVG​(double width,
                          double height)
      • saveSVG

        public void saveSVG​(java.lang.String fileName,
                            double width,
                            double height)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • outputSVG

        public void outputSVG​(java.io.PrintStream stream,
                              double width,
                              double height)
      • outputSVG

        public void outputSVG​(double width,
                              double height)
      • saveTex

        public void saveTex​(java.lang.String path)
                     throws java.io.IOException
        Throws:
        java.io.IOException