In gnuplot, I can put the key outside the plots using this command:
set key outside;
set key right top;
But as this page indicates, the placement of the key will automatically resize the plot area such that the size of the resulting image remains the same. Is there an easy way of keeping the plot area the same no matter where I place the key outside the plot area?
What you need to do is first make room for the key by shrinking the plot horizontally, say by "set size . 75, 1". Then position the key manually. Rather than saying "set key outside", try "set key at x,y", where x and y are in your axes units.
By default the key is placed in the upper right inside corner of the graph. The keywords left, right, top, bottom, center, inside, outside, lmargin, rmargin, tmargin, bmargin (, above, over, below and under) may be used to automatically place the key in other positions of the graph.
The command set multiplot places gnuplot in the multiplot mode, in which several plots are placed on the same page, window, or screen.
gnuplot is a not-quite-as-easy-to use, though extremely powerful, command-line plotting program. Running gnuplot is easy: from a command prompt on any system, type gnuplot. It is even possible to do this over a telnet or ssh connection, and preview the graphs in text mode!
The size of the plot in units of the canvas size is set with the "set size" command. But the key is considered part of the plot, so the actual graph will always shrink when you use "set key outside", so that the graph + key obey the size that you set with "set size".
What you need to do is first make room for the key by shrinking the plot horizontally, say by "set size .75, 1". Then position the key manually. Rather than saying "set key outside", try "set key at x,y", where x and y are in your axes units. The value of x will be some margin + key length + x-axis length, and the value of y will be somewhat less than the top of your y-axis. You will want to experiment a little to get the placement that you like, but you will find that the graph size does not change as you move the key around using this command.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With