Plot data generated in Java


The plot below shows a collection of sinusoids plotted with each sample explicitly shown with a vertical line. Like the Fourier series demo, this one uses Java code to compute the data on the fly.


If your browser recognized the applet tag, you would see an applet here.

The source code defines a class PlotDemo derived from Plot. This class contains a sequence of Java statements in its init() method that configures and constructs the plot. This particular example also demonstrates a number of features. In particular, the X and Y ranges are given explicitly in the Java code, but note that the Y (vertical) range is insufficient to contain all the points. The lines are clipped at the boundary of the range. Clicking on the "fill" button at the upper right brings all data within range. Note further that the Y axis is labeled with explicitly given tick marks, this time placed at non-integer positions, and again given string labels. Notice also that the "impulses" feature is turned on, causing a line to drawn from each plotted point down to the x axis. This provides an alternative way to explicitly show each sample being plotted (vs. marks as in the marks demo).


Up to the Example index - Back to a black and white plot using unique marks - Forward to a bar graph
Copyright © 1997, The Regents of the University of California. All rights reserved.
Last updated: 10/13/97, comments to: eal@eecs.berkeley.edu