 |
Caro-COOPS Bulletin Board
|
| View previous topic :: View next topic |
| Author |
Message |
jcothran
Joined: 24 Feb 2003 Posts: 189 Location: Columbia, SC
|
Posted: Fri Apr 09, 2004 12:37 pm Post subject: creating graphs |
|
|
Note: In my graphing experience I started with php 'jpgraph', moved to the below described perl GD::Graph package, and have since moved to gnuplot which is (I hope) the final solution for what our graphing needs currently are. Gnuplot's main advantage is that it separates the axis definition from the data itself, both of the earlier graphing packages have a weakness in that the x-axis is dependent on the data plotted - which means that if you're using the x-axis as the time dimension, when the data might be sampled irregularly, the graph doesn't visually represent this correctly. The data-axis dependency also becomes an issue when you might want to represent several stations with different time sampling intervals within the same graph.
I've added documentation on using gnuplot( which is what I'd recommend over the below documentation at http://caro-coops.org/bb/viewtopic.php?t=330 ).
==============================================
The attached code(graphs.tar) uses the perl GD::Graph module http://search.cpan.org/~mverb/GDGraph-1.43/Graph.pm to create a basic graph for one to many(say 12) graphs against a given variable.
The code also requires the GD::Text module installed as well.
After unzipping, you should be able to run
perl graphMulti.pl
to produce the attached graph. graphMulti.pl is just a sample code file which populated the arguments for the call to my_graph($graph_data, $station_id, $title, $y_units, $y_range_min, $y_range_max, $dir_path) located in graphMulti.lib which does the graphing work.
Thanks to Gomoos (www.gomoos.org) for sharing their code showing how they use GD::Graph in practice on their website.
| Description: |
|
| Filesize: |
6.29 KB |
| Viewed: |
5704 Time(s) |

|
| Description: |
|
 Download |
| Filename: |
graphMulti.pl.txt |
| Filesize: |
1.13 KB |
| Downloaded: |
584 Time(s) |
| Description: |
|
 Download |
| Filename: |
graphMulti.lib.txt |
| Filesize: |
2.61 KB |
| Downloaded: |
626 Time(s) |
| Description: |
|
 Download |
| Filename: |
graphs.tar |
| Filesize: |
1.57 MB |
| Downloaded: |
1118 Time(s) |
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by php BB © 2001, 2002 php BB Group
|