Help:Chart

From RBOSE
Jump to: navigation, search

Gnuplot allows you create charts online, without a need to upload images - these are created on the fly and can be further developed simply by using wiki interface. To make your work more efficient you may want to use an external applications with gnuplot output, and simply upload generated code into wiki placing it between <gnuplot> and </gnuplot> tags.


Some examples

Please click edit (view) button in the menu to see the source code of the charts.


A

<gnuplot>

  1. set terminal png transparent font verdana 8

set title "GnuplotBasic Sample 4" set auto x set grid set yrange [0:350000] set style data histogram set style histogram cluster gap 2 set style fill solid border -2 set boxwidth 0.9 set xtic rotate by -75 plot '-' using 2:xtic(1) ti col, \

      using 3 ti col, \
      using 4 ti col, \
      using 5 ti col

<plotdata>

  1. Immigration statistics

Region Denmark Netherlands Norway Sweden 1891-1900 30770 205290 8731 21179 1901-1910 73379 190505 249534 7 1911-1920 61897 66395 95074 4813 1921-1930 49610 68531 97249 227734 1931-1940 12623 4740 3960 17026 1941-1950 38809 10100 10665 7571 1951-1960 51121 22935 21697 9985 1961-1970 45237 15484 17116 23539 </plotdata> </gnuplot>

B

<gnuplot>

  1. set terminal png transparent nocrop enhanced font arial 8 size 420,320
  2. set output 'surface2.9.png'

set dummy u,v set key bmargin center horizontal Right noreverse enhanced autotitles nobox set parametric set view 50, 30, 1, 1 set isosamples 50, 20 set hidden3d offset 1 trianglepattern 3 undefined 1 altdiagonal bentover set ticslevel 0 set title "Interlocking Tori" set urange [ -3.14159 : 3.14159 ] noreverse nowriteback set vrange [ -3.14159 : 3.14159 ] noreverse nowriteback set zrange [ * : * ] noreverse nowriteback # (currently [-3.00000:1.50000] ) splot cos(u)+.5*cos(u)*cos(v),sin(u)+.5*sin(u)*cos(v),.5*sin(v) with lines, 1+cos(u)+.5*cos(u)*cos(v),.5*sin(v),sin(u)+.5*sin(u)*cos(v) with lines </gnuplot>

C

<gnuplot> set isosamples 42 set hidden3d splot [-3:3] [-3:3] [-1:4.5] sin(x**2+3*y**2)/(x**2+y**2)+(x**2+5*y**2)*exp(1-x**2-y**2)/ 3 </gnuplot>

D

<gnuplot> set terminal png transparent font verdana 8 set title "GnuplotBasic Sample 3" set xlabel "Month of 2008" set ylabel "Amount (Euro)" set auto x plot '-' using 1:2 title 'planned',\

    '-' using 1:3 title 'interpolated',\
    '-' using 1:4 title 'spent' 

<plotdata>

  1. month planned interp spent

1 300000 42775 50000 2 300000 85550 83200 3 300000 128325 137650 4 300000 171100 187655 5 300000 213875 246585 6 300000 256650 265475 7 300000 299425 309870 8 300000 342200 363976 9 300000 384975 403692 10 300000 427750 459872 11 300000 470525 491234 12 300000 513300 536829 </plotdata> </gnuplot>

E

<gnuplot> set terminal png small transparent set title "GnuplotBasic Sample 2" plot '-' using 1:2 t 'line 1' with linesp lt 1 lw 1, \

    '-' using 1:3 t 'line 2' with linesp lt 2 lw 1

<plotdata>

  1. num line1 line2
 1    2     3
 2    4     9
 3    8     27

</plotdata> </gnuplot>

F

<gnuplot> set terminal png small transparent set title "GnuplotBasic Sample 1" plot sin(x) </gnuplot>

G

<gnuplot>

  1. set terminal png transparent nocrop enhanced font arial 8 size 420,320
  2. set output 'contours.18.png'

set view 60, 30, 0.85, 1.1 set samples 25, 25 set isosamples 26, 26 set contour base set cntrparam bspline set title "3D gnuplot demo - contour of Sinc function" set xlabel "X axis" set ylabel "Y axis" set zlabel "Z axis" set zlabel offset character 1, 0, 0 font "" textcolor lt -1 norotate set zrange [ * : * ] noreverse nowriteback # (currently [-1.00000:1.00000] ) splot [-12:12.01] [-12:12.01] sin(sqrt(x**2+y**2)) / sqrt(x**2+y**2) </gnuplot>

H

<gnuplot>

  1. set terminal png transparent nocrop enhanced font arial 8 size 420,320
  2. set output 'pm3d.8.png'

set border 4095 front linetype -1 linewidth 1.000 set view map set samples 50, 50 set isosamples 50, 50 unset surface set style data pm3d set style function pm3d set ticslevel 0 set title "colour map, using default rgbformulae 7,5,15 ... traditional pm3d (black-blue-red-yellow)" set xlabel "x" set xrange [ -15.0000 : 15.0000 ] noreverse nowriteback set ylabel "y" set yrange [ -15.0000 : 15.0000 ] noreverse nowriteback set zrange [ -0.250000 : 1.00000 ] noreverse nowriteback set pm3d implicit at b splot sin(sqrt(x**2+y**2))/sqrt(x**2+y**2) </gnuplot>

I

<gnuplot>

  1. set terminal png transparent nocrop enhanced font arial 8 size 420,320
  2. set output 'polar.4.png'

set clip points unset border set dummy t,y set key inside right top vertical Right noreverse enhanced autotitles box linetype -1 linewidth 1.000 set polar set samples 160, 160 set xzeroaxis linetype 0 linewidth 1.000 set yzeroaxis linetype 0 linewidth 1.000 set zzeroaxis linetype 0 linewidth 1.000 set xtics axis in scale 1,0.5 nomirror norotate offset character 0, 0, 0 autofreq set ytics axis in scale 1,0.5 nomirror norotate offset character 0, 0, 0 autofreq set trange [ 0.00000 : 6.28319 ] noreverse nowriteback plot sin(4*t),cos(4*t) </gnuplot>

J

<gnuplot>

  1. set terminal png transparent nocrop enhanced font arial 8 size 420,320
  2. set output 'poldat.1.png'

set clip points set dummy t,y unset key set parametric set size ratio 1 1,1 set xtics axis in scale 1,0.5 nomirror norotate offset character 0, 0, 0 autofreq set ytics axis in scale 1,0.5 nomirror norotate offset character 0, 0, 0 autofreq set title "Primitive Smith Chart" set timestamp "%a %b %d %H:%M:%S %Y" set rrange [ 0.00000 : 10.0000 ] noreverse nowriteback set trange [ -3.14159 : 3.14159 ] noreverse nowriteback set xlabel "Impedance or Admittance Coordinates" set xrange [ -1.00000 : 1.00000 ] noreverse nowriteback set yrange [ -1.00000 : 1.00000 ] noreverse nowriteback tv(t,r) = sin(t)/(1+r) tu(t,r) = (cos(t) +r)/(1+r) cu(t,x) = 1 + cos(t)/x cv(t,x) = (1+ sin(t))/x plot cu(t,.1),cv(t,.1),cu(t,.1),-cv(t,.1),cu(t,1),cv(t,1),cu(t,1),-cv(t,1),cu(t,10),cv(t,10),cu(t,10),-cv(t,10),tu(t,.1),tv(t,.1),tu(t,.5),tv(t,.5),tu(t,1),tv(t,1),tu(t,5),tv(t,5),tu(t,10),tv(t,10),cu(t,.5),cv(t,.5),cu(t,.5),-cv(t,.5),tu(t,0),tv(t,0) </gnuplot>

K

<gnuplot>

  1. $Id: pm3dcolors.dem,v 1.3 2006/03/23 17:53:04 mikulik Exp $
  2. Test of new color modes for pm3d palettes.
  3. Gradient Palettes

set pm3d; set palette set palette color set pm3d map set cbrange [-10:10] set xrange [-10:10] set yrange [*:*] unset ztics unset ytics set samples 101 set isosamples 2 set xtics 2

set palette model RGB

set palette defined set title "set palette defined" splot x </gnuplot>

L

<gnuplot>

  1. set terminal png transparent nocrop enhanced font arial 8 size 420,320
  2. set output 'random.2.png'

set dummy u,v set format x "%3.2f" set format y "%3.2f" set format z "%3.2f" unset key set parametric set samples 50, 50 set style function dots set title "Lattice test for random numbers" set xlabel "rand(n) ->" set xrange [ 0.00000 : 1.00000 ] noreverse nowriteback set ylabel "rand(n + 1) ->" set yrange [ 0.00000 : 1.00000 ] noreverse nowriteback set zlabel "rand(n + 2) ->" set zrange [ 0.00000 : 1.00000 ] noreverse nowriteback splot rand(0), rand(0), rand(0) </gnuplot>

M

<gnuplot>

  1. set terminal pngcairo enhanced font "arial,10" size 420, 300

set clip two

  1. set style fill transparent solid 0.5 noborder

set style fill pattern 4 bo set title "Pattern-filled curves" set key inside left top vertical Left reverse enhanced autotitles nobox set key noinvert samplen 1 spacing 1 width 0 height 0 set style function filledcurves y1=0 set rrange [ * : * ] noreverse nowriteback # (currently [8.98847e+307:-8.98847e+307] ) set trange [ * : * ] noreverse nowriteback # (currently [-5.00000:5.00000] ) set xrange [ -5.00000 : 5.00000 ] noreverse nowriteback set x2range [ * : * ] noreverse nowriteback # (currently [-5.00000:5.00000] ) set yrange [ 0.00000 : 1.00000 ] noreverse nowriteback set y2range [ * : * ] noreverse nowriteback # (currently [0.00000:1.00000] ) set cbrange [ * : * ] noreverse nowriteback # (currently [8.98847e+307:-8.98847e+307] ) unset colorbox Gauss(x,mu,sigma) = 1./(sigma*sqrt(2*pi)) * exp( -(x-mu)**2 / (2*sigma**2) ) d1(x) = Gauss(x, 0.5, 0.5) d2(x) = Gauss(x, 2., 1.) d3(x) = Gauss(x, -1., 2.) GPFUN_Gauss = "Gauss(x,mu,sigma) = 1./(sigma*sqrt(2*pi)) * exp( -(x-mu)**2 / (2*sigma**2) )" GPFUN_d1 = "d1(x) = Gauss(x, 0.5, 0.5)" GPFUN_d2 = "d2(x) = Gauss(x, 2., 1.)" GPFUN_d3 = "d3(x) = Gauss(x, -1., 2.)" plot d1(x) fs solid 1.0 lc rgb "forest-green" title "μ = 0.5 σ = 0.5", d2(x) lc rgb "gold" title "μ = 2.0 σ = 1.0", d3(x) lc rgb "red" title "μ = -1.0 σ = 2.0" </gnuplot>


N

<gnuplot>

  1. set terminal png transparent nocrop enhanced font arial 8 size 420,320
  2. set output 'pm3d.17.png'

set border 4095 front linetype -1 linewidth 1.000 set style line 100 linetype 5 linewidth 0.500 pointtype 100 pointsize default set view 50, 220, 1, 1 set samples 30, 30 set isosamples 30, 30 unset surface set title "Yet another example" set xrange [ -2.00000 : 2.00000 ] noreverse nowriteback set yrange [ -2.00000 : 2.00000 ] noreverse nowriteback set pm3d implicit at s set pm3d interpolate 1,1 flush begin noftriangles hidden3d 100 corners2color mean splot log(x*x*y*y) </gnuplot>


See also

  • Simple charts - another extension to produce charts, a simpler one, and offering some types of charts not available with GNUplot currently.


External links