Esta página mostra as diferenças entre as duas revisões da página.
| Ambos os lados da revisão anterior Revisão anterior Próxima revisão | Revisão anterior | ||
|
tufte [2010/03/31 21:29] marcus |
tufte [2010/04/01 19:41] (Actual) marcus |
||
|---|---|---|---|
| Linha 1: | Linha 1: | ||
| ==== On Tuftefying gnuplot ==== | ==== On Tuftefying gnuplot ==== | ||
| - | Here are three examples of using [[http://www.gnuplot.info|gnuplot]] to visualize graphs in the style of Edward R. Tufte (see [[http://www.edwardtufte.com/tufte/books_vdqi|The Visual Display of Quantitative Information]]). | + | Here are four examples of using [[http://www.gnuplot.info|gnuplot]] to visualize graphs in the style of Edward R. Tufte (see [[http://www.edwardtufte.com/tufte/books_vdqi|The Visual Display of Quantitative Information]]). |
| === Quartile plot === | === Quartile plot === | ||
| Linha 52: | Linha 52: | ||
| - | === Boxplot === | + | === Bar chart === |
| - | Here is the redesigned box plot at the bottom of page 127. The data are simple y-values, one per line: | + | Here is the redesigned bar chart at the bottom of page 127. The data are simple y-values, one per line: |
| <code> | <code> | ||
| value | value | ||
| Linha 61: | Linha 61: | ||
| #!/usr/bin/gnuplot | #!/usr/bin/gnuplot | ||
| set term svg enh | set term svg enh | ||
| - | set output "boxplot.svg" | + | set output "barchart.svg" |
| - | unset border | + | |
| unset xtics | unset xtics | ||
| set style line 1 linecolor rgbcolor "white" lw 2 | set style line 1 linecolor rgbcolor "white" lw 2 | ||
| - | set style line 2 linecolor rgbcolor "black" | + | set style line 2 linecolor rgbcolor "#808080" lw 2 |
| - | set ytics 5,5,15 border nomirror format "%.0f%%" | + | set border 1 ls 2 |
| + | set ytics 5,5,15 border nomirror format "%.0f%%" font "Times_New_Roman,18" textcolor rgbcolor "black" offset -2 out scale 2.0 | ||
| set grid front ls 1 | set grid front ls 1 | ||
| - | plot [-1:12] [0:20] "barchart.dat" using 0:1:(0.5) with boxes fill solid 0.4 noborder ls 2 notitle | + | plot [-1:11.25] [0:20] "barchart.dat" using 0:1:(0.5) with boxes fill solid 1.4 noborder ls 2 notitle |
| </code> | </code> | ||
| produces | produces | ||
| - | {{:boxplot.png?480}} | + | {{:barchart.png?480}} |
| + | |||
| + | === Dot-dash-plot === | ||
| + | |||
| + | And finally, a dot-dash-plot in the style of p. 133. (The data are xy value pairs). | ||
| + | |||
| + | <code> | ||
| + | #!/usr/bin/gnuplot -persist | ||
| + | set term svg enh | ||
| + | set output "dotdash.svg" | ||
| + | unset border | ||
| + | set xtics textcolor rgb "white" out nomirror | ||
| + | set ytics textcolor rgb "white" out nomirror | ||
| + | set offsets 0.005, 0, 0, 1 | ||
| + | plot "dotdash.dat" using 1:2:xtic(1):ytic(sprintf("%f",$2)) pt 7 ps 1 notitle | ||
| + | </code> | ||
| + | |||
| + | produces | ||
| + | |||
| + | {{:dotdash.png}} | ||
| <html> | <html> | ||