问题
i want to generate some plots from my data that i want to include in some documentation. I put the box outside the graph area. the problem is that for different plots the box has different sizes so also the graph area changes its size. this looks very messy in the document becasue the plots are vertical aligned.
I am searching for a way to fix the size of the box to some width that is appropriate for all plots but i could not found a way to do so.
the set key
command has a width parameter but it seems not to do that one would expect from such a parameter.
It would be grat if someone could help.
thanks vlad
回答1:
I hope I got the correct impression of what you want. Consider the following example
reset
set multiplot layout 2,1
set rmargin screen 0.7
set key reverse Left left top at screen 0.72, graph 1
plot sin(x), cos(x) t 'long title'
plot sin(x), cos(x) t 'very long title'
unset multiplot
Which gives you:

Both the samples and the text do not move. You must only set an appropriate rmargin
. left
and top
is the key box alignment regarding the position specified with at ...
, although these settings are default, I explicitely included them for clarity. Left
is the alignment of the entry text.
来源:https://stackoverflow.com/questions/18444742/force-graphs-legend-key-to-a-specific-size