RtPlot - Version 0.53
Copyright © Dov Bai (1999-2003)
contents:
- Version 0.53 - (05-11-2003)
- Added support for saving contents of a window
to a graphic file whenever it is updated.
Useful for displaying on Web pages.
- Fixed bugs.
- Version 0.52 - (03-20-2003)
- Added printing support. Print Preview does not work well yet.
- Returned to Window's timer instead of thread, to prevent some
potential problems. Use of multimedia timers is considered for a
future version.
- Version 0.51 - (02-22-2003)
- Histoy feature now integrated with multi-curve: the user can
add to the same window both curves and history.
- Improved user interface:
- Added Apply button to most dialogs so that the user can test new selections without existing from dialog.
- Added lists of curves to appropriate dialogs: The user can change settings of several curves from the same dialog.
- Most dialogs now offers some selections (combo-boxes), editable where appropriate, rather then having the user type them in.
-
Added support for simple "box" style plots.
- Bug fixes
- Version 0.50 (02-12-2003) -
- RtPlot is now a multithreaded application and does not use
the less reliable Windows timer. On multi-processor systems,
a second processor can be used for parsing large data files.
- The History feature is back, although not yet fully integrated with
the multi-curve feature.
- Parsing fixed point doubles is now much faster.
- Bug fixes.
- Version 0.49 (01-31-2003) -
- Added ability to plot more than a single curve per
window. XML configuration files written by RtPlot include
attributes of all curves.
- The "history" feature has been disabled in this version. It will be integrated with the multi-curve feature in the next version. If you need it soon, please let me know.
- Bug fixes.
- Version 0.48 (01-14-2003) -
- Added grids to plots.
- Added command line capabilities.
- XML configuration files now capture many more plot attributes.
- Minimum timer interval reduced to 1/10 seconds.
- Bug fixes.
- version 0.47 (09-07-2002) -
- Fixed bugs.
- Added support for saving plots in PNG (Portable Network Graphic) format.
The PNG support uses the publicly available libraries zlib, libpng, and
pngdib (by Jason Summers).
- version 0.46 (08-28-2002) - Added support for saving plots as BMP (bitmap) files.
- Version 0.45 (03-2-2002) - Added
- Ability to configure with XML configuration files.
- Data points in addition to the lines.
- Different line styles.
- Comments are allowed at lines beginning with #
- Version 0.41 (12-8-2001) - Added "ticks" with numbers on x,y axes.
- Version 0.4 (12-1-2001) - Initial release
RtPlot is a small program for displaying 2D plots in real time. It consumes
little resources. It was written because of the need to monitor the progress
of computationally intensive scientific programs which run for a long time
and occasionally produce output suitable for plotting. The user can open
as many windows as needed for plotting. Each window can monitor several data
files and plot their contents. When a data file is updated by another
concurrently running program, its plot is automatically updated as well.
It is also possible to view in a window several recent updates to a data file.
The user can configure the frequency in which RtPlot checks for file updates,
stop or renew the updating of plots, the range of x & y columns, number of
ticks along axes and other parameters. Configurations can be made with the
mouse, command line or XML configuration files. Each plot can be printed or
saved in BMP/PNG formats either manually or when the display is updated.
The package includes the following files:
- rtplot.exe - RtPlot executable.
- readme.html - this file
The following files are included for demonstration purposes (see below):
- plottest.exe - Executable for creating cosine & sine plots.
- testplot12.xml - XML configuration file for
the data files generated by plottest.exe.
- testplot1.txt, testplot2.txt and testplot12.txt are sample data files
generated by plottest.exe
The following file is Simtel xml file. It is not required for using RtPlot.
- rtplt053.xml
To open a new plot window click File->New Plot in the initial menu.
A dialog box opens with default values of ranges of x & y ([x-min,x-max], [y-min, y-max]),
and possibly with default file name. You may edit the values in this dialog. "x-col"
is the column in the data file used as x-axis, "y-col" is the y-axis. If there are only two data
columns in the file, normally "x-col" is the first (0) column and "y-col" is the second (1).
With more than two columns, it is possible to change to different columns.
Alternatively, you may load a previously saved configuration from XML file by checking
the "Select XML configuration file" box. See Section "XML configuration
files".
Once the all parameters are set in the initial dialog, click "OK". Two other dialogs
for selecting color (R,G,B value, see below) and line style open. You may select the
defaults by pressing "Enter". A window opens with the data plotted. By default the
program checks for data file updates about every 1 second. This can be changed
by clicking Timer->Set and typing a different number of 1/10 second in the
dialog box. For example, typing 1 in the dialog box will set the timer interval to
1/10 second. Setting the update interval to 0 stops checking for file updates. It is
also possible to stop checking for updates by right-clicking anywhere on the plot
window area and choosing "Freeze" from the floating pop-up menu. Selecting "Unfreeze"
in this menu will re-enable data updates. Selecting "Update" forces an immediate
data update no matter what the value of timer interval is.
Depending on the plotting program and the OS, there is a slight chance that RtPlot will
try to read its data while the other program writes the data file. If that happens,
increase the timer interval. If you are in control of the source code of the program
that writes the data, you can add a file lock (e.g. by using the FileLock API) to the
program. RtPlot would then wait for the OS to complete the writing of data.
For very large data files on slower computers, parsing the input may take too much
CPU time. If that happens, increase the time interval.
The x, y ranges can be adjusted either by clicking Plot->Range->x-range (or y-range)
in the main menu or "Modify" in the floating pop-up menu. Adjusting the number of
x & y "ticks" is similar. Selecting "Line" in the pop-up menu opens sub menu from
which it is possible to change color (default black), width (default 1) and style
(default solid) of the line. The color is expressed in R-G-B (Re, Green, Blue) units.
Each of R, G, B can be any number between 0,255. RGB=(0,0,0) is a black line,
RGB=(255,0,0) is a red line, RGB = (0,255,0) is a green line and RGB=(0,0,255) is
a blue line. If there are more than a single curve in the window a list of all curves
is displayed and the user can select the appropriate curve.
By default, no data points are display. To add data points change
their size by selecting in the floating pop-up menu line->points and choosing the point
size for a value larger than 0. Selecting 0 eliminates the data points.
By default, RtPlot adds grid lines to its windows. To disable, click Plot in the menu
and uncheck "Grid".
To add a curve to a window, click plot->Add File from the menu bar.
The Add file dialog will open. To delete a curve use
plot->Remove File. A dialog box will open with a list of curves
in the window. Select the curve to delete. For each curve, its file name and the x-y
columns it displays are listed.
Listed in the title bar of the plot window are (1) Time of most recent data update,
(2) data file names, and (3) the data columns. The time of starting RtPlot appears
in the application title bar.
It is possible to open any number of plot windows by clicking File->New in the
main menu.
History- It is possible to display in a window several
recent updates to a data file. Use Plot->History and select the history size
for the appropriate curve. Recent updates will be displayed in fading shades.
Dragging- A useful feature is the ability to drag the plotted data in the plot window
and to examine various portions of the plot. This is done by clicking the left mouse
button and dragging the mouse while the button is pressed.
RtPlot is able to save the contents of any plot window in 4-bit (16 colors) bitmap
(BMP) or PNG (Portable Network Graphics) formats. The choice of 4-bits is to save disk
space, but this may be configurable in future versions.
There are two ways to save a file in a graphic format:
- From the file menu select
"Save as.." to open the Windows Save dialog box and select BMP or PNG formats
and the file name.
- Save the contents of a window to a graphic file whenever the window is updated.
This is useful for displaying plots on a web page using the REFRESH HTML meta-tag.
To activate this feature select Saving->Start from the main menu. To stop saving select
Saving->Stop. There is a minimum of 1 minute between savings. To set the file name
and the minimum interval between saving, select Saving->Setting... . By default
the format is PNG and the file name is rtplot0.png for the first window, rtplot1.png
for the second and so on. You can switch formats by selecting the appropriate
radio button. Pressing OK in this menu activates the saving feature.
If you need your plot in GIF format, you may use other tools such as the free command-
line utility bmp2gif (downloadable from Simtel) to generate a GIF file from BMP.
To print the contents of a window, select File->Print.... A dialog box will open.
You may enter a title line and up to two comment lines. These will be printed as the
header. To include date/time information, check the box at the bottom of the dialog
(Enabled by default). This will add date/time information as a footer. The usual
Window's print dialog will follow.
The configuration of a plot may be saved in a XML file. To save a configuration, click
File->Save Configuration. A "Save As" dialog will open.
To load a plot using an existing configuration file click File and in the "New Plot Information"
dialog check the "use XML configuration file" box. A File dialog will open.
Alternatively, a plot defined by a XML configuration file can be loaded on startup using
the command line option -x.
The configuration files may be edited using a text editor. RtPlot is somewhat sensitive
to the correctness of the XML file. This will probably be improved in a future version.
The best way to produce a configuration file is by using the File->Save configuration
from the menu, and then edit it if necessary.
Most tags in a configuration file have either self-explanatory names or the same name as
in RtPlot menus. The tag line_color has three comma separated values corresponding
to RGB values of the color of curves. The line_style tag accepts the values
SOLID, DASH, DOT, DASHDOT and DASHDOTDOT. Numbers appended to tag names correspond to the
various curves in the window.
RtPlot expects the data in the file is ordered in two (or more) columns. E.g.
#This is a comment
0.0 1.0
1.0 2.0
2.0 3.0
Lines beginning with # are considered as comments. The numbers can be integers
or floating point number in either fixed or scientific format.
RtPlot understands the following command line options:
- -n
- Opens the New Plot dialog upon startup
- -x f1.xml f2.xml ... fn.xml
- Opens the XML configuration files f1.xml, f2.xml,...,fn.xml
upon startup
- -p filename xcol ycol xmin xmax ymin ymax
- Opens directly a plot window rather then typing them in the New Plot dialog.
Parameters following -p have the same meaning as in the New Plot dialog.
Examples:
- rtplot -n -x testplot1.xml testplot2.xml
- Starts RtPlot with two plot windows corresponding to the configuarion files
testplot1.xml and testplot2.xml. In addition, the New Plot dialog opens so that a
third plot window can be added.
- rtplot -p testplot1.txt 0 1 0.0 6.28 -1.0 1.0 -x testplot2.xml
- Starts RtPlot with two plot windows. The first window displays the first two
columns (xcol=0, ycol=1) of the data file testplot1.txt. The interval of the x-axis
is [0.0,6.28] and of the y-axis [-1,1]. The second window displays the plot defined in the
configuration file testplot2.xml
The package contains a small executable, plottest.exe. Running the executable will
produce three data files: testplot1.txt, testplot2.txt and tesplot12.txt. Initially,
the first two files include data for sin & cosine functions with zero phase and the third file
includes both the sine & cosine data in 3 columns. As time progresses the phase
is changing and the data in the files is updated every 1 second.
Loading files to RtPlot create "moving" sin & cosine plots.
To view the moving sine & cosine type the following two lines in a console window:
start /LOW /B plottest.exe
rtplot -x testplot12.xml
Note: Windows 95/98/ME does not accept the /LOW /B parameters to start.
On these systems just omit these parameters in the first line.
You should see a single plot window with two curves (red & green) being updated every second.
The first line starts the plottest program in the background. plottest generates
the three data files and updates them about every 1 second. The second line loads the
corresponding configuration files.
If the plots are not moving, it is probably because
you did not execute correctly the plottest.exe executable.
To stop the updates right-click anywhere in the plot window area and select
freeze from the popup menu. Selecting later unfreeze will restart
the motion of the plots.
This version uses MFC7.0. It may require the file OLEACC.DLL which does not
exist on all Win95 systems. You may install it by downloading a kit from
Microsoft or search
Google for other solutions.
RtPlot version 0.53, Copyright(c) 1999-2003 Dov Bai
Permission to use, copy, and distribute this software and its
documentation for any purpose (except as detailed hereunder) is granted
without fee, provided that the above copyright notice and this permission
notice appear in all copies of the software and related documentation. You
may not disassemble, decompose, reverse engineer, or alter any of the files
in the package.
This software cannot be sold or bundled with any commercial package without
express written permission from Dov Bai, its author.
THIS IS FREEWARE. THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
ANY KIND. THERE IS NO LIABILITY FOR ANY DAMAGES OF ANY KIND ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Please direct questions, suggestions or bug reports to the author:
Dov Bai
e.-mail: dbai@juno.com.
For more information on RtPlot, or for downloading previous versions try
here.