My progs / Plot

[ <- main ]

Plot

[ latest versions | plan | license | compiling | usage | datafile format | screenshots ]

Plot is a program for plotting time-based data without hassle, with rapid navigation controls and with an average learning curve. The performance does not drop dramatically with increased filesize - data files with millions of data points are handled with ease. Mostly it's the amount of available RAM that limits the amount of data that can be displayed fast enough to be called "interactive".

The main distribution (represented by this page) uses C & GTK and is compilable under Linux, and since 0.29 also Mingw and Cygwin (see README.cygwin.txt inside the archive). I'll happily receive patches to sources, makefiles, or whatever you did to get it running, get it working better/faster etc. See main page for contact info.

Technologies used: Valgrind, Glade 3, Libglade, Gamin, Gettext.

Latest version

Version 0.30 | 25.03.2011 | download source (238k)

  • End user changes
    • "New view" crash bugfix
    • New "Close view" button below vertical scroll bars
  • Developer changes

Older versions | browse files

Plan

Version 1.0 | ??.??.2???

NOTE: If you think something more should be on this list, please send me mail! See main page for contact info.

  • End user changes
    • Hoovering the plot should pop up x,y values after a delay
    • Avoid most common console error messages and use popup dialogs instead
    • Bookmarks (attach a note to an x coordinate)
    • Legend on-off toggle by direct keyboard shortcut (or maybe rotate through the three states)
    • Attempt to support non-ascii filename display
    • In-program timezone switching (currently only possible through TZ environment variable)
    • Support "tailing" without gamin / fam libraries installed
    • Support specifying start & end dates on commandline
  • Distribution changes
    • Provide binary builds for Fedora & Cygwin
  • Developer changes
    • Possibly generalize update_minmax() for common use

License

The program is distributed under the GPL v2 license.

Compiling

To compile, you need at least:

  • GTK+ 2.4 or newer
  • libglade 2.4 or newer
  • GCC with C99 support
  • Perl

The program also makes use of (but does not require):

  • some GTK+ 2.6 and GTK+ 2.8 features
  • FAM for "tailing" files a'la tail -f (install the package gamin if you don't have it already)
  • gettext
  • intltool

Once the required dependencies above are met, you can compile the program by:

make

If the optional dependencies change, recompile by:

make distclean
make

There are usually some warnings when compiling, don't worry too much about them.. we do that for you :)

Using the plotter

Example usage (sample.txt is included in the package):

./plot2 sample.txt

Control basics - the scrollbars have tooltips and the rest of the controls are available through the menu. Here goes:

Left mouse
Drag the data around. NOTE: Initially the view is zoomed out, so it can't be moved.
Shift + Left mouse
Same as Left mouse, with 4 times dragging speed.
Ctrl + Left mouse
Zoom area. Click and drag a rectangle to select the area to zoom. If you get lost, hit the "Show all" button in the lower left corner.
Right mouse
Zoom interactively. While keeping the mouse pressed, drag the mouse down & right to zoom in and up & left to zoom out.
Shift + Right mouse
Same as right mouse, at 4 times zooming speed.
Arrow buttons in lower left corner
These work like back & forward in your browser - they switch between recent views.
Arrow keys / Numpad keys
Move data around. NOTE: Initially the view is zoomed out, so it can't be moved.
Shift + Arrow keys / Numpad keys
Zoom data. Use down & right to zoom in and up & left to zoom out.
Space
Zoom out fully.
Ctrl + T
Toggle tailing aka autorefresh mode.
Ctrl + Enter
Toggle full-screen mode. (plot-0.21)
Ctrl + Plus
Toggle double-size aka visitor mode. (plot-0.27)

Datafile format

The program supports datafiles listing the timestamp in the first column and data values in successive columns. Each line thus contains a set of samples of various data sources at the timestamp specified in the beginning of the line.

Supported timestamp units include "days since epoch", "seconds since epoch", "milliseconds since epoch" and "seconds since start of file". The timestamp can also be specified in decimal format, so 1139701996.123 in one file and 1139701996123 in another will be treated the same way.

The first row can contain a list of column headings, preferrably separated by TABs but spaces will do as well. The data values can also be separated by tabs or spaces. The headings must (at least currently) be in UTF-8 or ASCII format.

Example datafile (snippet from beginning of sample.txt):

#timestamp	roof °C	floor °C	table °C	outdoor °C	heater °C
1139701996	21.00		17.94		21.00		-11.75		43.06
1139702000	21.06		17.94		21.00		-11.75		43.06
1139702004	21.06		17.94		21.00		-11.75		43.06
1139702008	21.06		17.94		21.00		-11.69		43.00
1139702012	21.06		17.94		21.00		-11.69		43.00
1139702017	21.00		17.88		21.00		-11.69		43.00
1139702021	21.00		17.88		21.00		-11.69		43.00
1139702025	21.00		17.88		21.00		-11.69		43.06
1139702029	21.00		17.94		21.00		-11.69		43.06
1139702033	21.00		17.94		21.00		-11.69		43.00
...

In version 0.27, support for directives in data files was added. Directives control the way the data in the data file is interpreted. Currently only file-global directives are supported, later directives might support also tying them to some specific line, affecting that line or lines from that line onwards (depending on the directive).

Available directives:

maxdiff(milliseconds)
(plot-0.27) [This is currently a file-global setting but that might change later, so put it in the beginning of the file for now] Specify the maximum number of milliseconds between two consecutive samples for the samples to be considered continuous. Thus, if specifying maxdiff(2000), if there are two consecutive samples 3 seconds apart, they will be considered discontinuous and no connecting line will be drawn between them.

Directives are added at the end of a line (or on a separate line). Directives are identified by a #! prefix. No extra whitespace is supported. Some examples:

1139702000	21.06		17.94		21.00		-11.75		43.06 #!maxdiff(2000)

#!maxdiff(60000)

Screenshots from version 0.20

Main window at startup (when specifying sample.txt on the command line):

After zooming in the upper right part of the plot:

File open dialog has a preview window:

You can export the graph in various graphic formats, most importantly PNG (later maybe PS and PDF):

There's also a semi-fullscreen mode, leaving only the menu bar:

The colors can be inverted if you prefer white background:

You can split the plot into multiple views to compare data with different y ranges with more precision:

You can open multiple files at the same time: