force graphs legend/key to a specific size

房东的猫 提交于 2020-01-02 08:41:42

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!