User Tools

Site Tools


haas:spring2018:unix:projects:gtf0

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
haas:spring2018:unix:projects:gtf0 [2018/04/09 15:45] – [Your Task] wedgehaas:spring2018:unix:projects:gtf0 [2018/04/09 19:39] (current) – [plotting a single line] wedge
Line 26: Line 26:
  
 Following will be some usage examples to help you get a feel for how to use the tool (barely scratching the surface of what it can do): Following will be some usage examples to help you get a feel for how to use the tool (barely scratching the surface of what it can do):
 +
 +====plotting a single line====
 +
 +===the data===
 +<code>
 +1.0 430
 +1.5 120
 +2.0 431
 +2.5 600
 +2.6 610
 +2.9 620
 +3.0 432
 +4.0 500
 +5.0 510
 +5.5 900
 +</code>
 +
 +===the gnuplot file===
 +<code>
 +set title 'Line'
 +set xlabel 'x'
 +set ylabel 'y (1/100)'
 +
 +set terminal png size 600,400
 +
 +unset key
 +set tics out nomirror
 +set border 3 front linetype black linewidth 1.0 dashtype solid
 +
 +set xrange [1:5]
 +set xtics 1, .5, 5
 +set mxtics 1
 +
 +set style line 1 linecolor rgb '#0060ad' linetype 1 linewidth 3
 +
 +plot 'line.data' using 1:($2/100) with lines linestyle 1 title 'data'
 +</code>
 +
 +===generating the graph===
 +
 +<cli>
 +lab46:~/src/gtf0$ gnuplot line.gp > ~/public_html/gtf0/line.png
 +lab46:~/src/gtf0$ chmod 0604 ~/public_html/gtf0/line.png
 +lab46:~/src/gtf0$ # view line.png in web browser
 +</cli>
 +
 +===the graph===
 +
 +{{  http://lab46.g7n.org/~wedge/line.png  |line graph}}
  
 ====plotting lines==== ====plotting lines====
Line 58: Line 107:
 set xtics 1, .5, 6 set xtics 1, .5, 6
 set mxtics 1 set mxtics 1
- 
-set for [i=1:8] linetype i dashtype i 
  
 set style line 1 linewidth 4 set style line 1 linewidth 4
Line 81: Line 128:
  
 {{  http://lab46.g7n.org/~wedge/lines.png  |lines graph}} {{  http://lab46.g7n.org/~wedge/lines.png  |lines graph}}
 +
 +====plotting a histogram====
 +
 +===the data===
 +<code>
 +march 5 55 20 30 40
 +april 6 35 40 30 55
 +may   7 45 50 60 70
 +</code>
 +
 +===the gnuplot file===
 +<code>
 +set title 'Histogram'
 +set xlabel 'x'
 +set ylabel 'y'
 +
 +set terminal png size 600,400
 +
 +set grid
 +set tics out nomirror
 +set border 3 front linetype black linewidth 1.0 dashtype solid
 +
 +set xrange [-1:3]
 +set xtics 1
 +
 +set yrange [0:80]
 +
 +set style line 1 linecolor rgb '#0060ad' linetype 1 linewidth 2
 +
 +set style histogram clustered gap 1 title offset character 0, 0, 0
 +set style data histograms
 +
 +set boxwidth 1.0 absolute
 +set style fill solid 5.0 border -1
 +
 +plot 'histogram.data' using 2:xtic(1) title 'cactus', \
 +        '' using 3 title 'maple', \
 +        '' using 4 title 'willow', \
 +        '' using 5 title 'birch'
 +</code>
 +
 +===generating the graph===
 +
 +<cli>
 +lab46:~/src/gtf0$ gnuplot histogram.gp > ~/public_html/gtf0/histogram.png
 +lab46:~/src/gtf0$ chmod 0604 ~/public_html/gtf0/histogram.png
 +lab46:~/src/gtf0$ # view histogram.png in web browser
 +</cli>
 +
 +===the graph===
 +
 +{{  http://lab46.g7n.org/~wedge/histogram.png  |histogram graph}}
 =====Your Task===== =====Your Task=====
 Your task for this project is as follows: Your task for this project is as follows:
haas/spring2018/unix/projects/gtf0.1523288744.txt.gz · Last modified: 2018/04/09 15:45 by wedge