ygraph 1 ygraph plot and animate 1D data ygraph -cspgrvh -ddelay -kstep -xxmin,xmax -yymin,ymax -S file1 file2 -C file1 file2 file4 file Description ygraph is a simple program to produce an xy-plot of 1D data. It features animation, zooming, and the ability to load multiple datasets into a single plot. Command-line options are as follows: -c, --no-control-panel Start without the control panel. -s, --separate-windows Start with each requested plot in a separate window. -p, --no-points Turn off points drawn at each data point -g, --no-grid Don't draw a grid on the plot background. -r, --no-range Don't draw axis range values on the plot background. -d, --delay time Delay between successive animation frames. The specified value time should be an integer representing the number of milliseconds to delay between frames. -k, --skip n Read in only every nth frame of data. -l, --legend pos Set the position of the plot legend in the plot window. Valid pos values are: a - the legend is placed above the plot r - the legend is placed to the right of the plot o - the legend is placed over the plot data 0 - the legend is turned off (not displayed). By default, the legend is placed over the plot data, 'o'. -S, --subtract file1 file2 Subtract the second listed file from the first. If x-values of the two plots don't match, then values of the second are interpolated linearly to points of the first. -C, --convergence file1 file2 file3 Plot the convergence exponent of the next three listed files. Each file is assumed to be twice the resolution of the last, ie. the file order is 1xres 2xres 4xres. -?, --help List the command line options and exit. -v, --version Print a version message and exit. Usage Once the plot window is displayed, most of the available actions should be obvious from the menu bar and control panel buttons. Zoom To zoom in to a region of the plot, click the mouse left button at the upper left corner, drag to the lower right corner, and release the button. A menu option exists to unzoom back to the plot's original dimensions. Derivatives The derivative of any displayed plot can be calculated by using the /Plot/Derivative menu option from the plot window. Convergence testing It is possible to determine the quality of convergence of a set of three data sets by using the -C command line option, or the "Plot/Convergence test..." menu option. The data contained in the three input files are expected to be a sequence of resolutions h, h/2, and h/4, respectively. The displayed plot is the function z(h) - z(h/2) ---------------, z(h/2) - z(h/4) whose value should be 2^n, where n is the order of convergence. Thus for second order convergence a line with a constant value of four should be plotted. An example of invoking a convergence plot from the command line is given below. Export of images and animations It is possible to export a single frame of a plot using the "File/Export image..." menu option. The extension of the chosen file name will determine the type of data which is output (eg. jpeg, png, tiff, ps, etc.). Currently, support for animations exists only in the form of allowing the export of multiple frames of a plot, which must then be recombined afterwards using external software. Multiple frames of an animation can be saved to a directory using the "File/Export animation..." menu option. On selecting this option, the user is asked to give a directory name in which a sequence of images corresponding to the currently loaded frames of the plot will be saved. By default, the frames are saved in png format under the names frame_000001.png, frame_000002.png, etc. The resulting files can be combined to produce an animation using an external tool, such as the convert utility distributed with ImageMagick. For example, if the animation frames were saved to the directory anim_data, then the command convert -delay 20 anim_data/frame*.png test_anim.gif could be used to create an animated gif (test_anim.gif) whose frames consist of the images in anim_data with a delay of 20/100 seconds between successive frames. Hints If at any time you lose track of the control panel (eg. by covering it with other windows), you can raise it by pressing 'p' in a plot window. Input file format ygraph reads the standard 1D xgraph data format output by Cactus. The data can be in the form of an ASCII text file, or gzipped, in which case the file will be automatically decompressed as it is read. XY-data are listed in columns of the form <x-val1> <y-val1> <x-val2> <y-val2> <x-val3> <y-val3> etc. where x-val and y-val are floating point coordinates of (x,y) points to be plotted and are seperated by at least one whitespace character. Multiple plots are seperated by a blank line. Comment lines are delimited by beginning the line with a " (double-quote) character. An optional time value can be assigned to each dataset by adding a line of the form "Time = <time-val> to the head of a set of (x,y) values, where time-val is a floating point value which will label the particular data set during animation. The plot can also be assigned a name by a line of the form "Label = <name> The assigned name will be used in the legend of the plot. Input data example: "This is just a comment "Label = Random numbers "Time = 0.0 0.1 1.343 0.2 1.939 0.3 2.439 0.4 3.949 0.5 5.495 "Time = 0.2 0.1 1.442 0.2 2.303 0.3 3.349 0.4 4.192 0.5 6.029 Examples To plot the files data1.xl and data2.xl in the same window, use: ygraph data1.xl data2.xl To plot the same pair of files but starting with each in a separate window, use: ygraph -s data1.xl data2.xl To control the delay between successive frames of the animation of a data set, use the -d flag. For example, to set the delay to 100ms, use: ygraph -d 100 data1.xl To plot a file with the x-range set to (-1,3) and the y-range to (-2,4), use: ygraph -x -1,3 -y -2,4 data1.xl data2.xl To plot data1.xl minus data2.xl, use: ygraph -S data1.xl data2.xl To plot the convergence exponent of the three files data1.xl, data2.xl and data4.xl (where data2.xl is twice the resolution of data1.xl, and data4.xl is twice the resolution of data2.xl) use: ygraph -C data1.xl data2.xl data4.xl Author Written by Denis Pollney pollney@aei.mpg.de. Reporting bugs Report bugs to DP at the address above. See also xgraph 1 convert 1