GNUPlot Draw label on x2y2 axes

旧街凉风 提交于 2020-01-05 17:30:12

问题


I want to place a label on a plot which uses autoscale.

To keep the label at the same position i want to use alternative axis which don't use autoscale to get an absolute location.

How can I choose the uses axis of a "set label" statement?

set y2range [0:10]
set x2range [0:100]
set label "FooBar" at 10, 5

Line 3: something is missing here. "axes x2y2" wont work (used in plot label functions)

Thanks for helping me out here :-)


回答1:


There are different coordinate systems which you can use to place labels (see help coordinates in the interactive terminal):

  • first, uses the first axis (x, y) as reference
  • second, uses the second axis (x2, y2) as reference
  • screen, relative to the canvas size
  • graph, relative to the plot size
  • character, in character units.

So the best way to get an absolute location inside the plot is with graph:

set label "FooBar" at graph 0.2, 0.2

You can also mix the coordinate systems:

set label "FooBar" at graph 0.2, screen 0.5


来源:https://stackoverflow.com/questions/22227638/gnuplot-draw-label-on-x2y2-axes

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