Image:Waveforms.svg
From Wikipedia, the free encyclopedia
Waveforms.svg (36KB, MIME type: image/svg+xml
)
This is a file from the Wikimedia Commons. The description on its description page there is shown below. |
This is a test of gnuplot's SVG output, to compare to the results with postscript output and PNG conversion.
This shows several waveforms: sine wave, square wave, triangle wave, and rising sawtooth wave.
The PNG version looks much nicer.
Could be better. I used the wrong words for the font face, and I am probably doing the margins and graph size wrong.
Uses the same data files as Image:waveforms.png, and the following gnuplot code:
[edit] Source code
set samples 3001 #set terminal postscript enhanced landscape color solid lw 2 "Times-Roman" 20 set terminal svg size 1000 750 fname "Times New Roman" fsize 20 set output "waveforms.svg" # Define the four curves sine(x) = sin(x*pi) #(Originally was going to graph others as functions, but data files are easier) # Set up a four-pane multiplot set size 1,1 set origin 0,0 set grid # Set range of x axis set xrange [0:6] # Gridlines at every cycle set ytics 1 # Ticks distract from wave shapes set ticscale 0 # Show extents but don't waste space set yrange [-1.5:1.5] # No numbers needed; these are for shape comparison set format x "" set format y "" set nokey #I dont undertand how this works set bmargin 0 set tmargin 0 g=.04 set multiplot # Plot each graph # I don't understand how the labels work in multiplot, but this gives the right output set size 1,0.25-g set origin 0,0.75 + g/2 set label 1 "Sine" at 5.5, 0.5 c plot sine(x) 1 set size 1,0.25-g set origin 0,0.5 + g/2 set label 1 "Square" at 5.5, 0.5 c plot "square.dat" with lines 2 set size 1,0.25-g set origin 0,0.25 + g/2 set label 1 "Triangle" at 5.5, 0.5 c plot "triangle.dat" with lines 3 set size 1,0.25-g set origin 0,0 + g/2 set label 1 "Sawtooth" at 5.5, 0.5 c plot "sawtooth.dat" with lines 4 unset multiplot
Source: Created by User:Omegatron using gnuplot, possibly with post-processing in the GIMP (PNG) or Inkscape (SVG) (actually no GIMP for SVG images)
|