gnuplot / legend (E)
not so FAQ |
About Legend … but gnuplot calls it “key”
How do I erase a legend ?There are two ways. The first one is, gnuplot> set nokey and the other one is to use the notitle key word gnuplot> plot f(x) notitle, "file.dat" title "data" How do I change the location of legend ? Usually a legend appears at the top/right corner int the graph. gnuplot> set key left bottom the legend goes to left/bottom. Available options are, left, right, It is possible to set the position of legend directly. gnuplot> set key 100,100 The coordinate (100,100) is the position of the mid-point between How do I get rid of error bars in a legend ? When one plots data with error bars, the error bar also appears in When we plot the next data (test.dat), # X Y Y-error 1.0 1.2 0.2 2.0 1.8 0.3 3.0 1.6 0.2 with the following commands, gnuplot> set xrange [0:4] gnuplot> set yrange [0:3] gnuplot> plot "test.dat" usi 1:2:3 title "data" w yerrorbars ![]() the error bar in the legend becomes like above. gnuplot> set xrange [0:4] gnuplot> set yrange [0:3] gnuplot> plot "test.dat" usi 1:2:3 notitle w yerrorbars 1, "test.dat" usi 1:2 title "data" w points 1 works well. ![]() Location of the text is sometimes strange when Postscript symbols are used in it. Sometimes gnuplot places a text (in title or legend) at wrong Adjust the line-skip You can change the line-skip in the legend with set key spacing Make a frame-box To make a frame-box around the legend, use set key box . gnuplot> set linestyle 1 lt 2 lw 3 gnuplot> set key box linestyle 1 For gnuplot ver.4.0, gnuplot> set style line 1 lt 2 lw 3 gnuplot> set key box linestyle 1 |