将标签在某些y坐标处对齐到右边? [英] place label aligned to right, at certain y coordinate?
问题描述
我需要在拟合的平均水平线上方的右侧放置一个标签.我有规则的y坐标,但我不知道图形右边界的坐标.
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.
我看到了,只有在固定水平线规则的情况下,我才可以使用at graph 0.5,0.8
语法.
I saw, I could use at graph 0.5,0.8
syntax, only if the horizontal rule would be fixed, which it isn't.
推荐答案
您可以对x和y值使用不同的坐标系.可用的坐标系为:
You can use different coordinate systems for x and y values. The available coordinate systems are:
-
first
:左右轴上的值. -
second
:左右轴上的值. -
graph
:相对于轴内区域,0,0
在左下方,1,1
在右上方. -
screen
:相对于整个画布. -
character
:取决于所选的字体大小.
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 and1,1
is top right.screen
: relative to the entire canvas.character
: depends on the chosen font size.
因此,如果您的x值应该相对于图形,请使用graph 0.5
,对于y值,您可以使用first yval
:
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
在这里,yval
是水平线的y值,ofs
是为了使标签稍微移位的偏移量.
Here, yval
is the y-value of the horizontal line, and ofs
is an offset in order to displace the label a bit.
这篇关于将标签在某些y坐标处对齐到右边?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!