Hopsan
Plotting

Plot curves are shown in plot windows. There are two methods to open a new plot window. The easiest way is to right click on a port in the workspace and choose "Plot <variable>" from the menu. This will create a new plot window with the selected plot variable. The more advanced way is to open the plot widget, by clicking on the plot icon in the simulation toolbar or by pressing Ctrl+Shift+P. A list with all components in the current model will then appear. This list can be expanded so that it shows all ports in each component. From here a plot window can be created by double clicking on a port name or by dragging it to the workspace.

Open Plot Widget

Because this list can be long and time consuming to search, it is possible to mark those variables that are especially interesting as favorite variables. This is done by right clicking on them and choosing this in the drop-down menu. Favorite parameters gets a yellow star in front of their names, and they always appear at the top in the widget to make them easily accessible.

Favorite Variable

Once a plot window has been opened, it is possible to add more plot curves to it by dragging items from the variable list to the window. The variable list is also accessible from inside the plot window, on the right side of the plot. On small monitors the list will be automatically hidden, but can be opened with the Toggle Plot Variables icon.

Toggle Plot Variables

New curves can be added either to the left y-axis, to the right y-axis or to the x-axis. The latter will replace the time vector and result in an XY-plot. The x-axis can be reset to the time vector by using the Reset Time Vector button.

Reset Time Vector

Adding curves with different physical units to the same y-axis is generally not recommended, because they will use the same scale. The plot window contains several useful tools. First of all it is possible to zoom or pan the graphs by using the two leftmost icons. To return to the original position, simply right click anywhere in the plot area.

Zoom

Pan

The third button is used to save plot windows, so that they can be opened at a later time. Plot windows are saved in the XML-based .hmpf (Hopsan Model Plot File) format. These can be opened from the plot widget by using the "Load Plot Window From XML" button.

Save To Plot Window Description File

Load Plot Window Description File

Plot data can be exported to .xml (Extensible Markup Language), .csv (Comma-Separated Values), .m (Matlab script file) or .dat (gnuplot data file) formats. It is also possible to export plots graphically to .pdf or .png format.

Export Plot Data

Export Plot To Graphics File

The next two buttons are used to modify the plot window cosmetically. It is possible to show or hide the grid and to change the background color.

Each curve has its own set of icons below the plot. On small monitors these are hidden by default, they can be shown by clicking the Toggle Plot Curve Control Panel button.

Toggle Plot Curve Control Panel

From here it is possible to control plot generations. If the same model are simulated several times, a new generation is added to the plot window as long as the "Auto Update" check box is checked. To move between different generations, press the left arrow or right arrow icons. It is also possible to modify the curve cosmetically, to perform frequency analysis, and to remove the curve from the plot.