0% found this document useful (1 vote)
18 views

PLOTXY - A Scientific Plotting and Post-Processing Program: A Step-By-Step Tutorial

This document provides a tutorial for PlotXY, a scientific plotting and post-processing program. It introduces the main program windows: the DataSelection window for loading data, the plot window for creating plots, and the Fourier chart window. It then guides the user through basic functions like loading files, creating different plot types, zooming, shifting data, and exporting plots. More advanced features covered include algebraic operations on variables, Fourier analysis, and using multiple windows. The tutorial aims to explain the essential functions of PlotXY in around 30 minutes to help new users get started with the program.

Uploaded by

Jos
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
18 views

PLOTXY - A Scientific Plotting and Post-Processing Program: A Step-By-Step Tutorial

This document provides a tutorial for PlotXY, a scientific plotting and post-processing program. It introduces the main program windows: the DataSelection window for loading data, the plot window for creating plots, and the Fourier chart window. It then guides the user through basic functions like loading files, creating different plot types, zooming, shifting data, and exporting plots. More advanced features covered include algebraic operations on variables, Fourier analysis, and using multiple windows. The tutorial aims to explain the essential functions of PlotXY in around 30 minutes to help new users get started with the program.

Uploaded by

Jos
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

PLOTXY - A scientific plotting and post-processing program

A step-by-step tutorial
Table of Contents
About this tutorial ................................................................................................................................................................................................................................... 2
What PlotXY is and what can do for you................................................................................................................................................................................................. 2
Getting to know the main windows and giving names to buttons ......................................................................................................................................................... 3
The DataSelection Window 3
The plot window 4
The Fourier chart window 5
Doing the first things: a “real-life” experience ....................................................................................................................................................................................... 6
Doing some activity using the provided files ........................................................................................................................................................................................ 11
Loading a file and doing first things 11
Making, evaluating and managing line plots 13
Looking at data values 15
Zooming and keeping zoomed 17
Special plots: with twin vertical axes or X-Y plots 20
Modifying the plot scales 22
Time shifting 25
Changing the plot type and appearance 26
Exporting selected variables into a new data file 31
Exporting plot into system clipboard or SVG/PNG 31
The “function of variables” feature 32
Creating a Fourier Plot 38
Using several program windows 40
Saving Program State 42
Mark curves to allow clearer B/W printing 42
Printing on paper or pdf 43
Automatic loading of files. 43
Additional information.......................................................................................................................................................................................................................... 43
Customizing the program behaviour 43
Automatic Units of measure and prefixes 44
More on loading files 45
What else? ............................................................................................................................................................................................................................................ 45

About this tutorial


This tutorial shows the basic operations to obtain the first plots from PlotXY. It shows also nearly everything you will need to make also more complex operations
with the program.
Please consider that the maximum efforts have been done to make the program as intuitive as possible, therefore the learning curve should be very steep. I
imagine that the duration of this tutorial for you will be around 30 minutes.
The figures shown have been made using the Microsoft Windows version of the program (rel. 7, 8 10). Under Apple Mac they are slightly different but the
elements (buttons, tables, etc.) are exactly the same. Therefore any Mac reader will be as comfortable as Windows users in following this tutorial.
This tutorial is intended for sequential reading. However, in case you strongly want to, you can jump to any of its sections by clicking on the links in the Table of
Contents.

What PlotXY is and what can do for you

I propose here just a few Q&A’s.


What is PlotXY? It is a program to make plots and post-processing of simulated and measured data, specifically designed for scientists and engineers.
What are the PlotXY strengths as a plotting program? It is built from the ground up having in mind serious scientific usage. For instance:
1) it is at ease with very large data: it loads easily files of large size (tens or hundreds of MB), and plots very fast variables having many samples (several
thousands or even hundreds of thousands).
2) It manages effectively the scientific prefixes (“k” for “kilo”, “M, for Mega”, etc). If input data contains the relevant information, it uses the correct unit of
measure (“A” for ampere, “V” for volt, etc.)
How PlotXY interacts with my other favourite programs? This program is able to read data from the well-knowns ATP simulation program, as well as from asci
files (both its own “ADF” format and common versions of CSV files). For instance it reads smoothly CSV files created from the Modelica simulator OpenModelica
(www.openmodelica.org). It can export plots into SVG, PNG, PDF formats.
What kind of post-processing is possible? You can make any kind of algebraic operations among the variables read from input files. You can also make the time-
integral of a variable. You can also compute and plot the coefficients of the Fourier polynomial of a variable.
It the program free? Yes, it is completely free. It is distributed under the open source LGPL license.
Getting to know the main windows and giving names to buttons

Before starting doing things, better is to become acquainted with the three program main windows, and to give names to their buttons.

The DataSelection Window


Once PlotXY is started, the first window to appear is the one shown below, that is the main program window.

Main toolbar

File list table

SelectedVar
This is the table
VarMenu
Table

Main buttonbox

Below you can find specific names of the toolbar tools


Save
Keep scales state Program
Load options Single/multiFile
when refreshing state

Abo

Var sorting
button

Keep sc
when plo

Plot Copy
options
Show
Save
Plot data
Add plot Print
title Change
scale markers
Show The plot window
differences
When, in the Data Selection window the plot button is clicked, the plot window is displayed.
It has the appearance shown in the picture aside (in which a simple plot from the supplied file “sample1.adf” is drawn), where names of the toolbar buttons are
also given.

The Fourier chart window


The program is also able to make Fourier analysis (more precisely the i.e. Discrete Fourier Transform - DFT) of periodic signals and to display the corresponding
amplitude and phase spectra. This is done using the Fourier Chart window, that is shown below along with the name of its main elements.

Amplitude
chart
used
time
window
data
cursors
Options, info,
copy and print
buttons

Phase numerical
chart data
Doing the first things: a “real-life” experience

The first thing to do is to load one or more files. Here I show how it works using my own files, just to give ha hint about a real-life experience with the program. In
Working together using the provided files, instead I will propose actions that you can repeat using the sample files provided.
There are two ways of doing this:
1. Using the Load… button
2. Using the drag&drop feature of the operating system: looking at the file name in their own directory, selecting one or more of them, and dragging them
onto the main program window.
Once some files have been loaded the main program window can for instance have the appearance shown below at the left side of the figure (three files) or at
the right side (seven different files).
selected
file

common time

plot1
var-list

selected file’s var-list


Note that the program automatically selects the first variable as the “x variable” (the one that should by default correspond to the horizontal axis). If all the
loaded files share the same name on the horizontal axis, this one will be chosen.
If all the first names begin with the same first character a name containing that character and ‘*’ will be used. For instance, if all the variables begin with ‘t’ we
will have a “common time” variable indicated ad “t*” (see figure left above). Note that based on the first character the horizontal variable will be attributed an
unit of measure, according with the following convention:
- Names beginning with ‘t’ will be treated as being time (unit of measure is second)
- Names beginning with ‘f’ will be treated as being frequency (unit of measure is hertz).
It the first names in the selected files var-lists do not have all the same first character, the program gives to this common variable the name “x” and gives up
trying to understand which unit of measure it might have,
There are times, however, in which the user wants just to deal with a single file. In this case he
can switch to the single-file mode, simply by clicking on the second rightmost button on the main
toolbar. This way he will save valuable screen space, and have some additional features that are
available only in single-file mode.
Switching into singleFile mode does not unload any of the already loaded files. When I clicked on
the second right-most button of the toolbar from the situation shown in the right window just
above here, I got the appearance shown aside (I have also reduced the window’s height by acting
as usual on resizable windows).

Now it is time to select and plot variables.


From the figure aside we now select (by clicking onto the respective names) variables #2, #3, #4.
The window will now appear as shown below at left.
Once the variables have been selected, they can be plot simply clicking on the “Plot” button. In
my example the window shown below at right appears.
As often, in this case the plot is too cluttered to see details. However, it is very simple in PlotXY to zoom: simply click and drag. To zoom out, right-click and
choose whether zoom just one step or totally. Below three progressive zoom levels of the same figure are shown in three windows that, for compactness were
been previously horizontally shrunk.
You might have noted a few characteristics of the plots that are produced:
1) Minimum and maximum numerical values on the axes are always “round” numbers. Indeed a rather sophisticated algorithm is present inside do avoid
nasty numbers on the axis such as 1.2345 or 100000 or 0.000001
2) The unit of measure of the quantities is automatically set to kV. This is based on the variable names. If the auto-naming feature is not disabled, all
variables whose name begins with “v” is taken to be a voltage. Also, time is acknowledged as such and its unit set to seconds.
The rules used for auto-setting of units of measure are as in the following table:
First character of name quantity First character of name quantity
“t” time “a” angle
“v” voltage “p” power
“i” or “c” current “e” energy

When these units of measures are used, also the standard prefixes are used as well (e.g. u for “micro”, m for “milli” k for “kilo”, M for “Mega”, G for “Giga”, etc.).
Now that you have a first idea of how the programs work and how the produced plots look like in a real-life case, let us make together some plots step-by-step
using the enclosed sample files (from sample1.adf to sample3.adf).
Doing some activity using the provided files

Loading a file and doing first things

If you have gained access to this tutorial, I can assume you have already installed the program
and understood how to launch the program.
However, to launch the program the best way is to use a link you’ve created linking to PlotXY.exe
(that you’ve put in a directory of your choice) and click on it.

When the file is loaded you have two options to load a file (either using the button (Load…) or
dragging a file onto the PlotXY window from the directory where it is.
Once you’ve loaded the program and loaded sample1.adf the program window looks like the one
shown aside.

Since the file is compact and just one, we can reduce the window size to reduce its space
occupation on the screen. To reduce the window size se use the usual way for resizing windows
in computers using the window‘s borders.
Moreover, we choose to display in the file table only one file we click on the Single/multifile
button in the main toolbar
The corresponding windows will now look like as shown aside: the window is
much smaller and saves much of your precious desktop area.

If you have many variables you might find it useful to sort them alphabetically
in ascending or descending order using the Var Sorting button (three pictures
below). When A<->Z is displayed the variables are listed in the same order in
which they appear in their input file.
Note that sorting does not change the number attributed to each variable: for
instance the selected variables remained variables N. 51, 52, 53.
Naturally, if we commonly use small numbers of files and variable and plots, we
want to use small program windows ad default, without having to resize it
anytime we load the program. To do this, we can set the option “remember
windows’ positions and sizes”. The program options are accessed clicking on
the third button from the right in the man toolbar showing a check-mark as
symbol.

Several program options can be set. Here I did show just the one interests us now. Note that the program settings are written as system settings in a region of
the computer storage space the operating system chooses. Under Microsoft Windows it is the Windows’ registry.

Although I don’t advise this ;-) you might want to remove the program from your hard disk and leave the computer completely clean, To do so, you have to open
the program options window and click on the “Reset” button.

Making, evaluating and managing line plots


Now we want to select a variable and show its plot. To select a variable you can click on its name in the VarMenu table, or drag &drop it in the SelectedVar table.
In the first case the variable will get the first available colour, in the latter you can choose the variable colour by choosing the appropriate row.
In the figure left below a few variables from the supplied file rad2.mat re elected by clicking on their names; in the one at the right side their names are dragged
and dropped, so that the wanted colours are used (the last dropped has a yellow background). The plots will have the same colours as the shown variable
names..
You can also select several adjacent variables at a time: a group of variables. You have to keep the shift key down while clicking on the first (the uppermost)
variable of the group, and then click normally on the last one.
Once one or more variable(s) is (are) selected, click on the “Plot” button to see the plot. Two examples from file sample1.padf are below: please reproduce them
as a very simple exercise.
We see that the plot contain also a legend (shown below) containing the variable names.
You can zoom the produced plots at will, as we’ve learned in the Doing the first things: feel a real-life experience.
Now we perform additional actions.

Looking at data values


Consider the plots in the right picture here above. We now want to see some numerical values.
PlotXY offers two ways to do this. The first one is putting the mouse cursor near the curves. The program will find the nearest point in file and show the
corresponding value on a tooltip box. Moreover a small red rectangle indicating what point the value exactly refers to. This is particularly useful when considering
plots with only a few points and therefore the actual point on file might be rather far from the mouse pointer. See the two examples below:
Another option consists of having simultaneous access to all the values corresponding to a given x-axis value. To do this, click on the Show data button. What
happens in the cases of a single curve or multiple curves is different. Try! You will get something like what you can see down here.

In the left window the values are directly shown in the bottom toolbar (time first), while in the right one, because more space is needed, an additional small
window (the data browse window) is created to show the numerical values.
In both cases normally the numbers shown are exactly those present in the inpt file; however, if the “interpolate” box is checked, linear interplation is made
between adjacent points, check sample1.adf file: you will see that corresponding to t=0.0105s the sin(Om*t) value is -0.1563.
The vertical bar can be moved by clicking and dragging using the mouse or using arrow keys on the keboard.
Before using the arrow keys a single click must be done in the plotting area to activate keyboard focus on it.
Left and arrow keys move the bar left and right by one pixel; CTRL+arrow move it by three pixels.

In case you want to see the difference of the values one or more cuves have at different points of time, you can click on the Show differences button. It is located
immediately at right of the show data button, and carries a sign “-“ on it . You will get a second vertical bar such as in the two images below. Whenever you
move the grey bar you get actual values; whenever you move the green one, you will get the differences (difference values are marked with an asterisk “*” at the
left side of the numbers). As before, in case a single plot is shown the numbers are shown in the Plot window, otherwise in a separatate, small additional window.

Zooming and keeping zoomed


Very often we need to have a closer look at some plot detail. To do this we want to zoom the plot
This is straightforward with PlotXY: simply we define the zooming rectangle with the mouse: we push down the left button in the top-left corner of the rectangle,
drag the mouse, and leave the button once the rectangle displays what we want. While dragging the selected area is in partly transparent pink that shows what
we are selecting. See the two pictures below: the left one shows zooming in action, the right one shows the zoomed plot. Try to repeat this using the supplied file
rad2.mat.
We can repeat this many times, to have a look at even tiny details of our plots. See below.
In a zoomed plot we still can look at the numerical values corresponding to the plot, either focusing on the actual data from the loaded file, or on an interpolation
between points (see the right picture above).
Whenever a plot is zoomed, the axes are kept clean: we have “round numbers as minimum and maximum values and on the tic-marks. Only when the zoom is
very deep, PloXY gives up choosing clean axes and use whatever it can.
To zoom out by one level, right-click on the plot area; to totally un-zoom, while holding the CTRL key right-click on the plot area.

It might also be useful, in some occasions, to add or remove plots from a plot window without updating the zoom range.
Let us do together an exercise. From rad2.mat we can plot variables 16, 17 and 18. The plot will appear as shown below at left. Then manually zoom between 20
and 40 ms. The resulting plot is shown below at centre.

We might now add or remove curves while leaving the axes range unchanced (between 20 and 40 ms horizontaly, and betweeen – 15 and 15 A).
This is done by clicking on the Keep scale ranges while plotting button (on the main buttonbox of the DataSelection Window) before clicking on the plot button.
If that button is down, the axis scales are left unchanged. Therefore if for instance we remove variable N. 17, and then we plot keeping scales, the plot is as
shown at the rightmost picture below.
Special plots: with twin vertical axes or X-Y plots
Rather often the best visualisation is when two different plots are built using the same horizontal scale but they have different vertical sizes. In these cases it may
be very convenient to realize plot with two different vertical axes (here called twin vertical axes).
PlotXY allows you to create plots with several curves, while allowing you to select which one corresponds to the left vertical axis and which correspond to the
right one.
This can be seen using the enclosed file sample2.mat.
The figures below show what happens if we select a voltage (variable vTas) and a current (iZtriaTap) as variables to be numerically evaluated against the left and
right vertical axes respectively.
The first variable has been selected by left-clicking on its name, the second one right-clinking on its one. In the plot window we can easily understand with
variables refer to the right vertical axis: their name is shown underlined.
Note: You can also right-click on the name of an already selected variable to toggle between left and right vertical axis usage for that variable.
Another useful feature is the possibility to plot a variable against another.
This can be done only from SelectedVars tables were the selected variables come all from the same file. To make X-Y plots:
1. select the variables of interest and
2. click on the “X” column in tie plot var-list of the dataSelection window.
When step 2 is performed, the row onto which one has clicked becomes the “x” variable for X-Y plots. When this step 2 is performed for the first time after the
latest reset of the Plot var-list table the previous x-var is removed from the table, assuming that it represents time, and therefore it is not whished. In case of
subsequent clicks, however, the old X variable is not automatically removed and becomes one of the y variables of the X-Y plot.
Modifying the plot scales
We have seen that PlotXY tries to automatically find the most reasonable and readable scales on the axes. Nevertheless, the user often wants to select min and
max values himself. This can be done clicking on the Change Scale button of the plot window. This will cause the left window below to be displayed:
If one clicks on the ok button, the scales shown in the left plot are used (note, no plot here is visible since I’ve chosen, for this example, a variable that is always
above 2900, this outside the requested Y-axis range).
If “Exact match” is not selected the given Min and Max are still subject to adaptation by the program to ease readability. For instance if one selects min=1 and
Max=2.05 the program will assume a larger span for the axis in such a way that the required span (1,2.05) is contained, but the range can be split in round
segments. In this case the program will assume Min=1, Max=2.2 and intermediate ticmarks will be set every 0.2. If this is done for the vertical axis, the plot will
have the aspect shown in the right picture above. If, however, the user really wants his Min and Max to be shown, he can select Exact match checkbox, and the
situation will be the one shown below:
In this case the ticmark on the vertical axis are in unpleasant positions, but the user request is respected.
From some examples above, the reader might have note that the program tries to show reasonable unit of measure on the axes. For instance variables starting
with “v” are interpreted as being voltage, and the chosen unit of measure is “(V)”. This automatic determination of units of measure has important features, that
are described in detail in section “Automatic Units of measure and prefixes”. Here I just want to say that the user can manually select his axis units of measure,
clicking on the “Units…” button of the “Plot Scale setup” window shown just above here.
When the user clicks on that button, the following Units dialog is displayed.
It allows to select the axis label for an of the three axes. Examples of valid labels are the following ones: (m), (Nm), (N/m 2), (),, m.
Note that exponents can be used, and that the unit of resistance ohm, can correctly be displayed as a Greek uppercase omega.

Time shifting
When comparing curves from different files, especially when they are from measures, it could be useful to time-switching, i.e. horizontally translating them.
Access to time switching is gained by clicking on the “Tmax” cell of the file list table. When this is done, the “Tmax” column changes into the “Tshift” column, and
the background of the cells below becomes lighter (indeed white) to indicate editing possibility, as follows:
To select Tshift values you must first select a cell by clicking on it, then directly write the wanted time-shift value through the keyboard. Or, as an alternative, you
can double click on a cell, and write the wanted time shift or edit the existing value.
You can go back in displaying Tmax instead of Tshift clicking on the cell containing the string “Tshift”.
PLEASE NOTE that currently functions of variables do not take into account the Tshift information.

Changing the plot type and appearance


In the previous section line plots with linear scale on the axes were shown.
Naturally there exist several options to change the appearance of the plot. To explore them, try to click on the Plot options or Change scale buttons.
Click for instance the Plot options button. A window like the ones shown below appears. The window has three tabs displaying different options each. The
meaning of the options is self-explanatory.
Two examples of the application of some plot options are shown below: General|Display Grid (left), Plot type|pen width|thick and Font size!axis!dixed 12 pts
(right).

When you use a log axis, the marks on the axes and gridlines will be at 2x, 4x, 8x the main power of ten.
There are cases in which line plots are not the best way to show a plot. If we want to see only the point read from file we can use General|only dots option. This
is done in the bottom-left plot for the first variable from sample1.adf file.
Finally there are files in which the X-Y correlation is weak; this can be shown using a cloud of points. In this case small squares to show points are too large, and it
is better to use single pixels. This is done in the bottom-right plot, using variable X2 from the MorkSwarm.pl4 file
There are also cases in which instead of line plots the user needs to use a bar chart. This is done in the bottom-left plot (from sample1.df) in full scale, and in the
bottom-right in a zoomed fashion. The bars whose second end falls outside the zooming window are shown greyed..
Finally scales can be linear, log, and dB. Two examples from sample2.mat are shown below
The customisation you do using the Plot Options button are valid for the current plot. The default graphical characteristics of the plots, e.g. those valid when plots
are first created, decided at program level, using the Program options button of the program main window.
The Change scale button allows to manually change axes scales: this allows more flexibility than zooming: you can pan or choose detailed scales. In the bottom-
left plot the variable vDcLoadDcmeno is shown between 0 and 400 V, overriding the default scales.
In the bottom-right zooming on the horizontal axis is made.

Normally the user selected scales in the Plot scale setup dialog are subject to some refining by the scale determination inner engine to allow easy numbers on the
numerical tic marks. If, however the user wants total freedom in choosing minimum and maximum values of an axis, he can attain this checking the Exact match
checkbox. See the example below.
Exporting selected variables into a new data file
Very often files containing output from simulations or measure contain a lot of variables, while only a few of them are of interest for a given purpose.
PlotXY is able to create new files with such a subset of variables. Currently, however, saving only can be made from variables coming from the same input file.
Thus, variables from different files or variables created using The “function of variables” feature, cannot be saved.
To export the selected variables into a new data file chick on the Save vars button of the in the Data Selection window. Currently (May 2016) only adf, Comtrade
and Matlab are available as output formats.

Exporting plot into system clipboard or SVG/PNG


Once you are satisfied with your plot you may want to export it somewhere.
Maybe you want to include it into a document file (e.g. Microsoft Word or OpenOffice writer): to do this you click on the Copy button on a Plot window, and then
paste it into your favourite program. This way you get a pixmap copy (once called bitmap copy) of the plot.
As an alternative you can save you plots onto disk. In this case, you can obtain this result clicking, still in the plot window, on the Save plot button. You will get
both a Portable Network Graphic (“PNG”) and a scalable Vector Graphic (“SVG”) plot copies on your hard disk. The PNG is a pixmap while SVG is a vector copy .
The SVG has the advantage that it can be manipulated using a SVG editing program (such as the freely available Inkscape from www.inkscape.org or the
commercial Microsoft’s Visio). In this way you will find that curves will remain curves (can be moved around as a single object, text items will remain text items,
etc. Moreover zooming can be done without loss of visual quality.
Note that another way to have a picture on file of you plots is to use the Mark curves to allow clearer B/W printing
When printing a plot on a black and white printer, coloured curves are hardly distinguished from each other.
You can make this distinction using the “Add markers” button (see figure in the “The plot window” section).
If you click on that button when “Show data” button is down, and therefore the data vertical bar is displayed, the markers will be added at the vertical bar’s
position (custom markers); otherwise it will be drawn in automatically-determined positions. You can even mix the two techniques, using both automatically
determined markers and custom markers. The following pictures illustrate the behaviour (left: auto-markers, right some manually chosen markers).

Printing on paper or pdf feature.

The “function of variables” feature


PlotXY not only allows power display of the contents of your variables, but also can manipulate your variables to obtain new ones, and plot them. You can for
instance sum, multiply, divide your variables. Parentheses are allowed.
You can also request the time integral of a variable or an expression. In this case, the string you enter to define the function of variable must begin with “int” and
end with “)”.
The newly created variables are called functions of variables.
To define functions of variables you access your variables by a compact name built according to the following conventions:
 In general the compact name indicates the file number and variable number with the scheme “f#v#”. For instance variable number 3 from file number 5
has as compact name “f3v5”
 To indicate Variables from the Selected file (that is indicated by a “x” in the first column of the File list table) the file indication can be dropped. For
instance the 5th variable from the Selected file can just be indicated ad “v5”.
Functions of variables are defined by clicking on a cell in the “f” column of the File list table in the Data selection window. A small window will appear prompting
you to introduce the string defining your function of variable. It will have the following aspect:

Note that the check-box named “cross-interpolate curves between files” in the current version will always remain unchecked. In the current version of the
program, that disabled checkbox has been introduced to remind the user that no cross-interpolation will be done. This means that the program assumes that in
case of function of variables involving variables from different files, the program assumers that all the samples refer to the same time instants. Necessary (but not
sufficient) for this is that the numbers of points are exactly the same for all the files involved in the same function of variables.
The allowed operators between variables are the following ones: +, -, *, /. As usual, * and / take precedence over + and -. Obviously division requires care, since
there might be division by zero. If division by zero is detected a dialog box will be issued and computation of the function of variable will be stopped.
Valid strings for instance are: “v9-v10”, “2*v1-v2/5”, “V1+1e3*v2”, “1e-3*v1”, “f1v1+f2v2+f1v3”, “v1-(v2+v3)”, “10*v9+20”, “int(v2+v3)”,. The latter example
requests the integral between t=0 and the generic time t of v2+v3.
The first and last strings are used in the examples are shown below. The integral is shown in the same plot along with the function to be integrated for the
maximum clarity.
NOTE. The name of the “function of variable” is just indicated as “f1”, “f2”, etc. However, to ease analysis, if the mouse is left above the variable name shown in
the plot window, a full representation of the formula is shown as a tooltip.
For instance, in in the picture right below the mouse is left on “f1” in the plot window the user will see in a tooltip: “vV1a-vV1b”
In case variables come from different files, the tooltip specifies the file for each variable, as follows:
An example infolving integrals is shown below:
NOTE: integrals are useful to calculate energy flows. For instance int(f*v) and int(u*i) will calculate the mechanical energy and electrical energy if f, v, u, I stand
for force, speed, voltage, current respectively.

Finally consider that also the x variable can be a function of variable. Compare the two plots below:
Creating a Fourier Plot
Electric and sound engineers use a lot Fourier decomposition of periodic waves.
This is well supported by PlotXY.
To make a Fourier plot only a unique variable must be selected. Then, simply click on the “Four” button. The program will try to choose the best parameters for
general usage. In particular it assumes that the simulation, after a possible initial transient has stabilised. Therefore, using the default frequency (that can be
selected by means of the Plot Button of the DataSelection Window) it uses the last period of the available data to make computations.
Take for instance the following pictures, obtained using the supplied rad2.mat file. Here the default frequency is 50 Hz and the simulation goes from zero to 0.06
s, it will use as default the last twenty-millisecond period, for the analysis

Once the chart is shown, you can move around the data cursors to see numerical values in the bottom-right part of the window.
You can zoom the chart. An example is shown below (on the left). The bars that fall into the plot are shown as usually in red (bounded by black rectangles), while
the bars that are higher than the available vertical space are shown greyed.
The fourier Chart can be customised in several ways clicking on the Fourier Options button. The window that appears has the aspect shown above (on the right).
In particular note that the numerical values can be shown in the Fourier Chart window in four different values:
 peak of sine components (DC component unchanged)
 rms of sine components (DC component unchanged)
 all harmonics as a ratio to the DC component value
 all harmonics as a ratio to the first harmonic value.
Moreover, if the user clicks on the info button, further data is displayed, e.g.:

The two THD’s are computed according to the usual formulas.


Let x(t) be a periodic function and let it be represented by the Fourier polynomial:
𝑁

𝑥(𝑡) ≅ 𝑋0 + ∑ 𝑋𝑘 sin⁡(𝑘𝜔 + 𝛼𝑘 )
𝑘=1
then:
𝑁 𝑁
1 1
𝑇𝐻𝐷1 = √ ∑ 𝑋𝑘2 ⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡𝑇𝐻𝐷0 = √ ∑ 𝑋𝑘2 ⁡
𝑋1 𝑋0
𝑘=ℎ 𝑘=ℎ

in which h=min(h1,2), and h1 is the minimum value specified in the left edit field below “harmonics to consider” label in the Four options window (in the
displayed example it is zero):

The reason for this choice of h1 should be evident: THD is intended to measure the distortion, i.e. the contribution of unwanted harmonics to the output signal.

Using several program windows


Starting from the same files and variables you can shoe plots in up to four windows. Each window has its own setups, line style, scale, data-browse window, etc.
Example are shown below.
Saving Program State
When we work on PlotXY we load files, select variables, define functions, make plots.
When we close it, all this setup is in general lost. To avoid this, one can “save Program State” , i.e. the list of files loaded, variables and functions per file and plots
shown, so that he can reload it again at a later time. The state is automatically stored in the Operating System’s program setting area (in Windows this is the
Windows registry) and can be recalled at will.
To save the program’s state click on the “Save state” button on the main toolbar of The DataSelection Window.
Note that when working with PlotXY it may happen that a plot shows contents that does not correspond to the corresponding selectedVarTable. For instance we
could select in the Plot1 selectedVarTable variables X and Y; plot them, and select a different set of variables without hitting the plot button again.
When the program state is restored (clicking on the Load state on the Data Selection window), however plots always correspond to the corresponding
selectedVarTable contents, as if the user has just hit the plot button.
NOTES:
 Fourier plots are not automatically generated when restoring the program state.
 The plot’s appearance (line vs bars vs dots, zoom state) is not stored.

Mark curves to allow clearer B/W printing


When printing a plot on a black and white printer, coloured curves are hardly distinguished from each other.
You can make this distinction using the “Add markers” button (see figure in the “The plot window” section).
If you click on that button when “Show data” button is down, and therefore the data vertical bar is displayed, the markers will be added at the vertical bar’s
position (custom markers); otherwise it will be drawn in automatically-determined positions. You can even mix the two techniques, using both automatically
determined markers and custom markers. The following pictures illustrate the behaviour (left: auto-markers, right some manually chosen markers).
Printing on paper or pdf
Plots can be printed on paper or pdf. The options at your disposal are those shown in the following diagram, that appears when you click on the “print” button of
the plot window.

Automatic loading of files.


It may happen that you always (or very often) load the same files or files having the same name
In this case, in addition to the “save state” feature you have another option: specifying the files at command line.
If, for instance, in Microsoft windows you can create a link to PlotXY.exe in your folder containing “sample1.adf” and “rad2.mat” and writing in the program
name after “PlotXY.exe” (without quotes) “rad2.mat sample1.adf” (without quotes). Your PlotXY will open and automatically load the two files.
You can list up to eight files as command-line parameters. They will all automatically load.

Additional information

Customizing the program behaviour


We have already met in section named “Loading a file and doing first things” the “Program Options window.
There we saw the appearance of the “General” tab sheet. We also have other options to choose from in tab sheet named “Plot”, shat is shown below here.
Their meaning is rather straightforward. Only the “autolabel known variables” might need some explanation and this is done in the following “Automatic Units of
measure and prefix” section.

Automatic Units of measure and prefixes


You may have noticed that in come plots units of measure (such as (V) or (kV)) have appeared.
This by default is automatically done by the program based on the following simple rules:
The “prefix”, substitutes the powers of ten, according to the standard notation, shown for completeness in the following table:
prefix meaning prefix meaning
-12 3
p x10 k x10
n x10-9 M x106
u x10-6 G x109
-3
m x10 T x1012

The units of measure are chosen as a function of the first character of the variable name, according to the following table:
name begins with assumed unit symbol name begins with assumed unit symbol
‘v’ volt V
‘c’ ampere A ‘i’ ampere A
‘p’ power W e energy J
‘t’ time s ‘f’ frequency Hz
Note that the last correspondence is used for horizontal-axis variables only
You can disable this feature unchecking the “autolabel known variables” check box in the Program Options|Plot tab sheet (cf. section Customizing the program
behaviour”)

More on loading files


In section Loading a file and doing first things it was said that loading files can be done either using the Load… button, or dragging files on the Data Selection
window. Here I supply some more details.
With both techniques you can load individual files or groups of files. The program will adapt to different situations and behave as expected. At the end of load
operation more than one file is loaded, the program is in multi-file mode (it goes into this mode if it was in single-file mode).
However, when individual files are loaded starting from single-file mode, the program behaviour depends on whether the action is initiated from single-file or
multi-file mode:
 when starting from multi-file mode the new loaded or dragged file is added to the already loaded ones
 when starting from single-file mode, the new loaded or dragged tile replace the currently displayed one.
I recommend to try these differences: once you get accustomed, you can take advantage of them.

What else?
In this tutorial you have learnt all the major things you can do with PlotXY. You can learn the rest just by trying.
However, there are specific details on the structure of adf file or the rules that the program use to convert variable names into the supplied formats: for instance
not all the names that are valid as ADF file or pl4 file names can be used as such in matlab files.
This more advanced documentation is provided document: “Input formats and naming conventions.pdf”

You might also like