Plot

From SweepMe! Wiki
(Redirected from Plotting data)
Jump to navigation Jump to search

Last updated for: Version 1.6.1.7

The widget 'Plot' displays measured data during and after a run. You can create as many plots as you like and arrange them in the Dashboard.

Basics

Create a new plot

Go to 'Widgets' -> 'Plot' -> 'New…'. A Plot widget will pop up and you can place it in the Dashboard. New plots are named 'Plot1', 'Plot2', and so on.

Remove a plot

Go to 'Widgets' -> 'Plot' -> 'Plot<i>' -> 'Remove'. Here, <i> is the number of the plot. Further, you can click the close button of the widget. You will be asked whether you like to hide or to remove the widget.

'Widgets' -> 'Plot' -> 'Remove all Plots' removes all plots at once.

Rename a plot

Go to 'Widgets' -> 'Plot' -> 'Plot<i>' -> 'Rename', or right-click on the widget and select 'Rename'.

Modify a plot

Double-click on a plot to open the dialog 'Plot settings'. It allows you to select the plotted variables, change the design of the plot and more. The dialog can also be opened via 'Widgets' -> 'Plot' -> 'Plot<i>' -> 'Configure', via right-click on the widget -> 'Configure', or with the button 'Configure' of the toolbar.

Toolbar

When the mouse is over a plot, a toolbar appears in the upper right corner of the plot:

  • 'Home': return to autoscaling
  • 'Pan': move the plot with the mouse
  • 'Zoom': zoom into a rectangle drawn with the mouse
  • 'Save': export the plot as an image file
  • 'Configure': open the dialog 'Plot settings'

In the free version of SweepMe!, exported images of the plot style 'Lines' contain a subtle SweepMe! attribution.

Plot settings

At the top of the dialog, select the 'Plot style:':

  • 'Lines' (default): markers and lines
  • 'Polar': polar plot
  • 'Imshow': 2D color map of the data
  • 'Scatter': scatter plot
  • '3d': three-dimensional plot
  • 'CIE': CIE 1931 chromaticity diagram

'Refresh plot' redraws the plot with the current settings, 'OK' closes the dialog.

Let us know if you need further features at support@sweep-me.net.

Tab 'Values'

All modules of the sequencer that provide plottable variables are listed. Expand the modules and select the variables that you would like to plot:

  • 'x' refers to the bottom x axis
  • 'y' refers to the left y axis
  • 'z' refers to the right y axis

Several variables can be selected for the y and the z axis.

Timestamps, e.g. the variable 'stamp' of the module Time, can be plotted with the plot style 'Lines'. They are displayed in the format hours:minutes:seconds.

Slice/Filter

The column 'Slice/Filter' allows you to reduce the plotted data. Slicing and filtering only change what is displayed. The measured data and the saved data files are not affected.

Slicing is set in the row of a module and works on the variation of this module. For example, if a module Loop creates repetitions, you can slice through its iterations. It is not possible to slice 1-dimensional data like lists or arrays, as they belong to a single measurement point. Only measurement points that are created by the variations of the modules can be sliced.

The syntax is adapted from slicing in Python, i.e. 'start:end:step' with indices starting at 0. The drop-down list offers some examples:

  • ':' shows all values (default)
  • '-1' shows the last value of a variation
  • '-100:' shows the last 100 values of a variation
  • '0' shows the data of the first value of a variation, and '1' the data of the second value
  • '::2' shows every second value
  • '1::2' shows every second value, starting from the second value
  • '::-1' shows the values in reversed order

Filtering is set in the row of a variable and applies to its measured values. Here are some examples:

  • > 100 (shows all values larger than 100)
  • > 100; < 200 (shows all values larger than 100 and smaller than 200)
  • != 0 (shows all values that are not 0)

Several conditions separated by a semicolon must all be fulfilled. Conditions can contain parameters of the Parameter system in curly brackets, e.g. a limit that is entered in a Form.

It is also possible to filter for a variable that is not plotted. The filter also affects the other plotted variables by hiding the values that belong to the same measurement points. Filtering can also be used for 1-dimensional data like lists or arrays.

Split

If you make multi-dimensional parameter variations, you can tell SweepMe! where to split the lines by using the CheckBoxes in the column 'Split'. Check 'Split' for the module whose variation should create a new curve for each of its values.

Example: If you measure temperature dependent current-voltage characteristics, you would like to have a separate current-voltage curve for each temperature. Hence, you have to check 'Split' for the Temperature module.

Tab 'Style'

For each axis 'y' and 'z', you can set 'Line style:', 'Line width:', 'Marker style:', 'Marker size:', 'Opacity / alpha value:' and the 'Color cycle:'. The field 'Color map:' is used by the plot styles 'Imshow' and 'Scatter', the field 'Interpolation:' by the plot style 'Imshow'.

Color cycle

For each axis, a color cycle can be defined which is a png colormap file from which colors are extracted. In the folder "resources/colormaps" of the main program installation, a svg file template can be found to create your own colormaps. These png colormap files should be saved in the public folder "Resources/colormaps" to keep them even if the SweepMe! version is changed. Colors are extracted along a horizontal central line of the image. If the file name ends with an underscore and a number, a fixed number of colors is extracted. For example, 9 colors are extracted equidistantly from the preinstalled colormap "SimpleColor_9.png". If no underscore and number are given at the end of the file name, as many colors are extracted as curves are in the plot. The alpha channel of each pixel is read out as well so that transparency changes can be created too.

Use 'Revert' to flip the colormap and start the color cycle the other way around. The option 'Start from last curve' always uses the first color of the cycle for the last added curve, the second color for the second last added curve, and so on. This way, your last added curves always have the same color. It can be helpful to use a colormap where the last added curve is always highlighted.

Custom plot design

The default design of all plots is defined by a matplotlib style file. To use your own design, save a file "default.mplstyle" in the public folder "Resources/mplstyles". It replaces the default style of SweepMe!.

Tab 'Scales'

  • 'Scale:' select whether an axis is 'linear' or 'logarithmic'.
  • 'Fixed axes limits:' all plots are normally autoscaled. Check 'x from:', 'x to:', etc. to use fixed boundaries.
  • 'Normalize to / Divide by:' enter a value and the data will be divided by this value, or choose 'maximum', 'minimum', 'first', 'last', or 'mean' to normalize your data. The options ending with 'curvewise' normalize each curve individually.
  • 'Labels:' enter your own axis labels. Leave the fields empty to use the default variable names.
  • 'Scaling mode:' if you show data at the left y axis ('y') and the right y axis ('z'), you can define whether both axes are scaled individually ('Individual scaling'), use a common scale ('Global scaling'), or use the scale of one of the axes ('Scale by y', 'Scale by z').

Tab 'Design'

In this tab, you can show or hide the grid and the legend. For the legend, you can set the 'Position:', a 'Title:', and whether the module label, the variable and the variation label are added to the legend entries.