gnuplot / misc (4)
not so FAQ |
Miscellaneous Stuff (No.4)How do I make a figure with many kinds of lines ? The number of line-kinds gnuplot can handle depends on the Line Type (solid, dotted, dot-dashed) Thickness (heavy, light) Colors Lines with Symbols Some terminal cannot draw a dotted line, and some cannot change Define the linetype by set linestyle gnuplot> set term postscript eps enhanced gnuplot> set linestyle 1 lt 1 lw 1 gnuplot> set linestyle 2 lt 2 lw 1 gnuplot> set linestyle 3 lt 3 lw 1 gnuplot> set linestyle 4 lt 6 lw 1 gnuplot> set linestyle 5 lt 1 lw 3 gnuplot> set linestyle 6 lt 2 lw 3 gnuplot> set linestyle 7 lt 3 lw 3 gnuplot> set linestyle 8 lt 6 lw 3 gnuplot> set xrange [-pi:pi] gnuplot> plot sin( x) w l ls 1, sin(2*x) w l ls 2, sin(3*x) w l ls 3, sin(4*x) w l ls 4, cos( x) w l ls 5, cos(2*x) w l ls 6, cos(3*x) w l ls 7, cos(4*x) w l ls 8 ![]() Maybe you can use more line-kinds by changing the line-type (short The maximal number of line kinds may depend on your figure ![]() “Lines with Symbols” means to draw a line first, and symbols are gnuplot> set linestyle 1 lt 1 lw 3 pt 5 gnuplot> set linestyle 2 lt 1 lw 3 pt 6 The linestyles are defined above, and they are used at plotting Write least-squares parameter values in the figure Make a figure label which tells you a value of parameter obtained at the gnuplot> f(x)=a*x*x+b*x+c gnuplot> fit f(x) 'test.dat' using 1:2:3 via a,b,c gnuplot> set label 1 "Y=AX^2+BX+C" at 11,1225 gnuplot> set label 2 "A = %g", a at 12,1200 gnuplot> set label 3 "B = %g", b at 12,1180 gnuplot> set label 4 "C = %g", c at 12,1160 gnuplot> plot f(x),'test.dat' using 1:2:3 with yerr ![]() from Joerg in Switzerland. Thanks !
|