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/08 21:46] – [End result] wedgehaas:spring2018:unix:projects:gtf0 [2018/04/09 19:39] (current) – [plotting a single line] wedge
Line 25: Line 25:
 For this project, we will be making use of the venerable **gnuplot** tool. Like many powerful tools we have encountered this semester, we seek only to scratch the surface, and start to familiarize ourselves with the powerful capabilities this resource offers us. For this project, we will be making use of the venerable **gnuplot** tool. Like many powerful tools we have encountered this semester, we seek only to scratch the surface, and start to familiarize ourselves with the powerful capabilities this resource offers us.
  
-Following will be some usage examples to help you get a +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====
 +
 +===the data===
 +<code>
 +1.0 430 110
 +1.5 120 125
 +2.0 431 130
 +2.5 600 150
 +2.6 610 160
 +2.9 620 192
 +3.0 432 100
 +4.0 500 340
 +5.0 510 450
 +5.5 900 700
 +</code>
 +
 +===the gnuplot file===
 +<code>
 +set title 'Lines'
 +set xlabel 'x'
 +set ylabel 'y'
 +set terminal png size 600,400
 +
 +set grid
 +set key below center horizontal noreverse enhanced autotitle box dashtype solid
 +set tics out nomirror
 +set border 3 front linetype black linewidth 1.0 dashtype solid
 +
 +set xrange [0.9:5.7]
 +set xtics 1, .5, 6
 +set mxtics 1
 +
 +set style line 1 linewidth 4
 +set style line 2 linewidth 1
 +set style line 3 linewidth 2
 +
 +plot 'lines.dat' using 1:2 with lines linestyle 1 title 'line1', \
 +     '' using 1:3 with lines linestyle 2 title 'line2', \
 +     '' using 1:($2+$3) with lines linestyle 3 title 'sum'
 +</code>
 +
 +===generating the graph===
 +
 +<cli>
 +lab46:~/src/gtf0$ gnuplot lines.gp > ~/public_html/gtf0/lines.png
 +lab46:~/src/gtf0$ chmod 0604 ~/public_html/gtf0/lines.png
 +lab46:~/src/gtf0$ # view lines.png in web browser
 +</cli>
 +
 +===the 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:
Line 33: Line 186:
     * from the [[/haas/spring2018/unix/projects/status|class status page]], scrapes:     * from the [[/haas/spring2018/unix/projects/status|class status page]], scrapes:
       * the list of projects, the lowscore, average, median, and hiscore values of each of the evaluated projects       * the list of projects, the lowscore, average, median, and hiscore values of each of the evaluated projects
-        * places these values in columns (a projects column, a lowscore column, an average column, etc.) in a **gtf0.dat** file+        * places these values in columns (a projects column, a lowscore column, an average column, etc.) in a **gtf0.data** file
     * from your **~/info/status/unix.projects** file in your home directory:     * from your **~/info/status/unix.projects** file in your home directory:
       * obtains the scores and totals of each of the evaluated unix projects       * obtains the scores and totals of each of the evaluated unix projects
       * calculates the score (out of 100) of each individual project       * calculates the score (out of 100) of each individual project
-        * places these calculated scores as a final column in your **gtf0.dat** file+        * places these calculated scores as a final column in your **gtf0.data** file
     * constructs a **gtf0.gp** gnuplot file that:     * constructs a **gtf0.gp** gnuplot file that:
       * creates a graph title of "USER SEMESTER/DESIG class status"       * creates a graph title of "USER SEMESTER/DESIG class status"
Line 70: Line 223:
  
 So this graph will be a nice visual indicator of how you did in various aspects related to the class as a whole. So this graph will be a nice visual indicator of how you did in various aspects related to the class as a whole.
 +
 +=====Spirit of project=====
 +The spirit of the project embodies many aspects we've been focusing on throughout the semester:
 +
 +  * recognizing patterns to employ effective solutions in problem solving
 +  * utilizing concepts and tools covered
 +  * demonstrating comprehension of concepts, tools, and problems
 +  * employing concepts in knowledgeable and thoughtful manner
 +  * following instructions
 +  * implementing to specifications
 +  * utilizing creativity
 +  * being able to control solution via consistent, clear, and organized presentation
 +
 +Basically: I want your solution to be the result of an honest, genuine brainstorming process where you have (on your own) figured out a path to solving the problem, you have dabbled and experimented and figured things out, and you can command the concepts and tools with a fluency enabling you to pull off such a feat. Your solution should demonstrate the real learning that took place and experience gained.
 +
 +Cutting corners, avoiding work, skimping on functionality, cheating through getting others to do work for you or finding pre-packaged "answers" on the internet violates the spirit of the project, for they betray your ability to pull off the task on your own.
  
 =====Submit===== =====Submit=====
Line 75: Line 244:
  
 <cli> <cli>
-lab46:~/src/unix/gtf0$ submit unix gtf0 gtf0.sh gtf0.data gtf0.gp gtf0.png+lab46:~/src/unix/gtf0$ submit unix gtf0 gtf0.sh gtf0.data gtf0.gp gtf0.png http://lab46.corning-cc.edu/~username/gtf0/gtf0.png
 Submitting unix project "gtf0": Submitting unix project "gtf0":
     -> gtf0.sh(OK)     -> gtf0.sh(OK)
Line 81: Line 250:
     -> gtf0.gp(OK)     -> gtf0.gp(OK)
     -> gtf0.png(OK)     -> gtf0.png(OK)
 +    -> http://lab46.corning-cc.edu/~username/gtf0/gtf0.png
  
 SUCCESSFULLY SUBMITTED SUCCESSFULLY SUBMITTED
Line 89: Line 259:
  
 <code> <code>
-78:pwn0:final tally of results (78/78) +78:gtf0:final tally of results (78/78) 
-*:gfo0:gfo0.sh only uses cached status tool output when run [4/4] +*:gtf0:gtf0.sh directly uses info dir status data when run [4/4] 
-*:gfo0:gfo0.sh effectively utilizes variables in operations [4/4] +*:gtf0:gtf0.sh effectively utilizes shell features [4/4] 
-*:gfo0:gfo0.sh effectively utilizes command expansions [4/4] +*:gtf0:gtf0.sh is a proper bash script with shabang and exit [4/4] 
-*:gfo0:gfo0.sh effectively utilizes regular expressions [4/4] +*:gtf0:gtf0.sh scrapes pertinent data from class status page [4/4] 
-*:gfo0:gfo0.sh effectively utilizes selection statements [4/4] +*:gtf0:gtf0.sh formats data and generates gtf0.data file [4/4] 
-*:gfo0:gfo0.sh effectively utilizes looping structures [4/4] +*:gtf0:gtf0.sh generates viable gtf0.gp to make intended plot [4/4] 
-*:gfo0:gfo0.sh effectively utilizes functions in script [4/4] +*:gtf0:gtf0.sh submits correct and requested items [4/4] 
-*:gfo0:gfo0.sh effectively utilizes arrays in script [4/4] +*:gtf0:gtf0.sh no line in any file exceeds 80 characters in length [4/4] 
-*:gfo0:gfo0.sh is a proper bash script with shabang and exit [4/4] +*:gtf0:gtf0.sh all custom variable name lengths at least 4 symbols [4/4] 
-*:gfo0:gfo0.sh accurately displays values in consistent alignment [4/4] +*:gtf0:gtf0.data contents arranged by column with headings [4/4] 
-*:gfo0:gfo0.sh accurately displays values in pertinent categories [4/4] +*:gtf0:gtf0.gp sets proper graph title and axis labels [4/4] 
-*:gfo0:gfo0.sh accurately displays values based on current data [4/4] +*:gtf0:gtf0.gp sets proper image format and resolution [4/4] 
-*:gfo0:gfo0.sh use status output cache file on given argument [4/4] +*:gtf0:gtf0.gp sets proper axis range, sets up grid [4/4] 
-*:gfo0:gfo0.sh verifies score and total against detail line items [4/4] +*:gtf0:gtf0.gp displays a valid key outside of graph area [4/4] 
-*:gfo0:gfo0.sh no line exceeds 80 characters in total length [4/4] +*:gtf0:gtf0.gp grabs data from gtf0.data and sets x tics from it [4/4] 
-*:gfo0:gfo0.sh all custom variable name lengths at least 4 symbols [4/4] +*:gtf0:gtf0.gp uses different line colors and thicknesses [4/4] 
-*:gfo0:gfo0.sh properly manages input violations [4/4] +*:gtf0:gtf0.gp identifies each line by category [4/4] 
-*:gfo0:gfo0.sh operates according to specifications [5/5] +*:gtf0:gtf0.sh operates according to specifications [5/5] 
-*:gfo0:gfo0.sh logic is organized and easy to read [5/5]+*:gtf0:gtf0.sh logic is organized and easy to read [5/5]
 </code> </code>
  
haas/spring2018/unix/projects/gtf0.1523223978.txt.gz · Last modified: 2018/04/08 21:46 by wedge