place label aligned to right, at certain y coordinate?

不羁的心 提交于 2019-12-28 04:33:30

问题


I need to place a label at the right, above of a fitted average horizontal rule. I have an y-coordinate of the rule, but i don't know the coordinate of the right border of the graph.

I saw, I could use at graph 0.5,0.8 syntax, only if the horizontal rule would be fixed, which it isn't.


回答1:


You can use different coordinate systems for x and y values. The available coordinate systems are:

  • first: value on the left and bottom axes.
  • second: value on the right and top axes.
  • graph: relative to the area within the axes, 0,0 is bottom left and 1,1 is top right.
  • screen: relative to the entire canvas.
  • character: depends on the chosen font size.

So, if your x-value should be relative to the graph, use graph 0.5, for the y-value you can use first yval:

set label at graph 0.5, first yval+ofs

Here, yval is the y-value of the horizontal line, and ofs is an offset in order to displace the label a bit.



来源:https://stackoverflow.com/questions/23180127/place-label-aligned-to-right-at-certain-y-coordinate

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