jPlot
A Java Plotting Tool

 

Navigation

 

Other Useful Software

 

 

 

 

 

 

What is jPlot?

jPlot is a java version of the famous xplot by Tim Shepard. 

The main goal behind the development of jPlot was to make the plotting tool used with tcptrace more portable. jPlot was developed at the Internetworking Research Lab (IRG), at Ohio University, as part of Dr. Shawn Ostermann's tcptrace project.

Tim Shepard's original xplot is an amazing piece of software. It was designed to be extraordinarily fast and efficient and as such, it has only a very thin user interface. Those design goals, however, make xplot extremely difficult to port to new architectures and also make it difficult to use for the casual user. jPlot was designed to address these limitations while keeping as much of the original efficiency as possible. We thank Tim Shepard for his hard work on xplot and hope that jPlot can live up to his high standards.

Back to the top

jPlot's Features:

jPlot preserves all of the features of the original xplot. It does the following:

  • plots: plots can be generated with the following primitives:

    • x - a cross

    • dot - a dot (density of the dot can be modified)

    • plus - a plus sign

    • box - a small box

    • diamond - a small diamond

    • utick - up tick (a small tick mark from the specified point, 3 pixels up)

    • dtick - down tick (a small tick mark from the specified point, 3 pixels down)

    • ltick - left tick (a small tick mark from the specified point, 3 pixels to the left)

    • rtick - right tick (a small tick mark from the specified point, 3 pixels to the right)

    • htick - horizontal tick (a small horizontal tick mark, 3 pixels to the left and right of the specified point)

    • vtick - vertical tick (a small vertical tick mark, 3 pixels to the top and bottom of the specified point)

    • uarrow - up arrow (a small arrow head, pointing upwards)

    • darrow - down arrow (a small arrow head, pointing downwards)

    • larrow - left arrow (a small arrow head, pointing to the left)

    • rarrow - right arrow (a small arrow head, pointing to the right)

    • line - a simple line

    • dline - dot and line (a line with its end-points marked)

    • ctext - center text (center aligned text)

    • atext - above text (places the text above the specified point)

    • btext - below text (places the text below the specified point)

    • ltext - left text (left aligned text)

    • rtext - right text (right aligned text)

    • title - title for the plot (placed at the top of the plot, center aligned)

    • xlabel - label for the x-axis

    • ylabel - label for the y-axis

    • invisible - does not display anything (could be useful)

  • zooming: Dragging with the left mouse button would generate a rubber-band box for zooming. The selected area would then be magnified on release of the mouse button. This can be done multiple times. Clicking the mouse button on the plot would cause it to go back to the previous zoom level. To go to the original view of the plot, simply click on the "original" button at the bottom of the window. Selecting an area with the mouse pointer placed in the region behind either axis would cause the plot to be zoomed only in the direction of that axis.

  • panning: The plots can be scrolled in the horizontal and vertical direction by keeping the "shift" key down and dragging the mouse with the left button. Dragging with the mouse pointer placed in the region behind either axis would cause the plot to be panned only in the direction of that axis.

  • extra margin: Incase sections of the plot close to the axis cannot be seen (if they are getting clipped at the edges), try displaying the plot with the "-e" option and it would leave an extra 10% margin around the original plot.

  • plot multiple files: You can specify multiple files on the command line, and they all will be plotted in separate windows.

  • plot one file at a time: You can specify multiple files on the command line and have the program plot one file at a time with the "-1" option. Right mouse clicks on the plot would cause the program to cycle through the plots. The current view of each plot is preserved as you cycle through the plots.

  • cascade plots: You can use the "-c" option to plot multiple files with the plots cascaded one after the other, when they come up on the screen.

  • tile plots: You can use the "-t" option to plot multiple files with the plots tiled one below the other, when they come up on the screen.

  • save postscript image: In the "file" menu you will find the option to save the current view of the plot as a postscript file. The plot can be saved to the size of one A4 page, a size which would allow 3 plots to fit on a latex page, or a size which takes up less vertical space.

  • save png image: In the "file" menu you can find the option to save the plot in the form of a png image. (This features is only possible due to J. David Eisenberg's amazing PNG Encoder).

Back to the top

NOTE:

Needs Java 1.3:
This program uses some features of Java that were introduced in version 1.3. Hence this program will not compile under older versions of Java.

Does not work perfectly with Java 1.4:
I tested this program under the newly released Java Version 1.4. It compiles fine and works partially. Features like

saving PNG
quick exit
some mouse/key bindings (SHIFT + mouse-drag, CTRL + mouse-drag)

failed under this version. Probably Java Runtime Environment (JRE) 1.4 is not yet stable.

Back to the top

Compiling the program:

Simply compile the file "jPlot.java" as follows:

        `javac jPlot.java`

Linux/UNIX/OSX users may use the Makefile included in the distribution. Just correct the path to the Java compiler in the variable JAVADIR, and then run:

        `make all`


Back to the top

Running the program:

Having generated all the required class files (see "compiling the program" above), the program could be loaded as follows:

        `java jPlot [options] file [files]`

Help with all the features of jPlot can be found using the -h/-help option as follows:

        `java jPlot -h`

Back to the top

Options:

-1

show each file one at a time, rather than all at once

-e

leave an extra margin around the plot (useful if some of the labels are getting clipped off the edges)

-t, -tile

tile the plots so that they can all be seen when displayed, rather than being displayed one on top of the other

-c, -cascade

cascade the plots

-v, -version

print version information

-help

show a help screen

Back to the top

Mouse Bindings:

left 

draw rectangle to zoom in, click to zoom out

SHIFT + left

drag to scroll window

CTRL + left

drag out a triangle showing dimensions

right

right cycle between files  (if the '-1' option is used)

right

exit                                 (if the '-1' option is NOT used)

Back to the top

Color Options:

White on Black

the plotter would use a WHITE stroke on a BLACK background

Black on White

the plotter would use a BLACK stroke on a WHITE background

Black on Gray

the plotter would use a BLACK stroke on a GRAY background

NOTE:

colors other than BLACK and WHITE would remain the same

Back to the top

Save As... Options:

Plots can be saved to files in the following formats:

.png

Portable Network Graphics (PNG) Format

.a4.ps

A4 size postscript image

.tex3.ps

3 plots per latex page size postscript image

.lvs.ps 

less vertical space postscript image (image occupies less vertical space)

Back to the top

Buttons:

Refresh

refresh the screen

Original

zoom back to the original view of the plot

Resync

re-read the data from the file and display a fresh plot

Close

close the current window

Exit

close all the windows and exit

Back to the top

Accelerator Keys:

CTRL + S

Save As...

CTRL + C

close current window

CTRL + X

close all windows and exit

CTRL + R

refresh the screen

CTRL + L

resync i.e. re-read the data from the file and display a fresh plot

CTRL + H

display a help dialog

Back to the top

Examples:

This plot shows the plotting primitives mentioned above, that could be used to generate custom plots

This plot shows a zoomed in version of the above plot

This plot shows a time sequence graph generated by tcptrace

This plot showed a zoomed in section of the above plot

This plot is another demonstration of jPlot's capabilities

Back to the top

Download jPlot:

jPlot-1.0.2.tar.gz (gzipped tar file)

jPlot-1.0.2.zip (zip file)

Previous Releases

CHANGELOG

Back to the top

Author:

Avinash Lakhiani (alakhian@tcptrace.org)

Back to the top

 

Page written and maintained by:

Avinash Lakhiani - Research Assistant - Internetworking Research Lab (IRG) - Ohio University

Last Modified: Nov 20, 2002

Back to the top