adamm ~ School of Mathematics / Institute of Technology / U of M Home

math.umn.edu / ~adamm / Plot

Plots
Last Modified 24 Feb 09, 12:51

¡Hola! Bienvenidos a mi pagina de casa.

Scatterplots using PlotUtils

Take a stream of two columns and make a graph with just "| graph -T gif > test.gif". Actually, it takes a few more options to make the data occupy more of the space available in the graph.

graph -S 5 -l x -l y -T gif -m 0 --bitmap-size 400x400 > test.gif
The graph command can do x y plots on log scaled axis. It can also label axis and title the chart.

When I was using plotutils, I couldn't find how to show a third dimension of data, or how to plot multiple data sets on one plot. I also wanted to use vector graphics in a web browser. Since SVG weren't widely available, I looked into creating plots using perl, and a shockwave library called Ming.

Plots done in Shockwave using Ming


Dot-Dash plot of Random Points
This dot-dash variation shows a third variable indicated by the rotation of the L shape at each point.
[ The Visual Display of Quantitive Information pg 133, 1983]

Field at Regular Intervals

Contour of Z Shown by Color

Quartiles
A reduced ink/pixel version of a box plot based on Edward Tufte's first version. [ VDQI pg 124, 1983] This run has some points getting a bit out of order.

Geographic Maps with Gnu PlotUtils

The U.S. Census Bureau made the 2000 census gazetteer files available for download. The data is in plain text with fields at set columns (eg. Columns 144-153 for latitude in the places2k.txt file).

The gazetteer data can be plotted with plot. Data for MN is on the left and most of the gazetteer on the right. Problems with the map may indicate problems with the data processing command chain.

Geographic places can be the xy pairs. Geographic places can be the xy pairs.

$ cut -c 145- places.mn.txt | awk '{ printf( "%f %f\n", $2, $1)}' \
	| graph -S 5 -T gif -m 0 --bitmap-size 400x400 > ../Plot/places.mn.gif 
The awk command switches the latitude and longitude columns so the plot appears as if viewed from above.
$ cut -c 145- places2k.txt  | awk '{ printf( "%f %f\n", $2, $1)}' \
	| grep -v ^0.0 | grep -v ^173  \
	| graph -S 5 -T gif -m 0 --bitmap-size 400x400 > ../Plot/places2k.gif
The grep commands remove some data didn't seem within the "lower 48". A point at 173.186142 52.846331 for Attu Station CDP is removed by grep -v ^173. The 4918 points at 0.000000 longitude and between 19.1 and 71.3 latitude. The awk may have problems with coordinates not seperated by spaces.

MRTG Graph

MRTG gathers SNMP data from computers and maintains a 2536 record set based on that info over the previous year. The stock graphs from MRTG only plot data from one device's log file. Although plotutils' graph only shows one set of pairs, it can aggregate the two columns of data from multiple MRTG logs.

$ ls *.log | wc -l ; cat *.log | wc -l
some large number
2536
Here's a quick script to plot all the time and in-average pairs
egrep " [0-9]+ [0-9]+ " *.log | cut -d\  -f1,2 | graph -T gif --x-limits -S 5 -m 0 -l y > traf_i.gif
Same as above but for the time and out-average pairs
egrep " [0-9]+ [0-9]+ " *.log | cut -d\  -f1,3 | graph -T gif --x-limits -S 5 -m 0 -l y > traf_o.gif
 

Note, plotutils' graph command drops any 0 points on a log scale. The log scale doesn't adjust to the --y-limits command either.

Matplotlib, Pychart

Sage is python based environment for Mathematics that can use other math software like Matlab, Mathematica, Maple, Magma, Octave, Maxima, GAP and other packages. It's interfaces include the command line and a web browser based notebook.


www.math.umn.edu/~adamm/Plot/index.html
                                                                        
The views and opinions expressed in this page are strictly those of the page author.
The contents of this page have not been reviewed or approved by the University of Minnesota.

Random Link
     
         
   

  Enter keyword search