pyqtgraph - labels in scatterplots
-
I want to add labels to points in a scatter plot. I'm having difficulty assigning the anchor to the labels.
If the x coordinates of the points are (0.367, 0.384) and the y coordinates are (1.548, 0.362) what would I do to determine what the anchors should be?
The range for both x and y I'm setting to -2 to 2. Does the range enter into the formula for the anchor? -
@SGaist Turns out that the anchors are relative to the label's x, y position. I had thought that the anchors were relative to the corner of the window. PyCharm's Ai Assistant showed me the error of my assumption. I use .5 and 1, the label appears centered above the point.
-
Hi,
I haven't used this package but this StackOverflow answer might help.
-
@SGaist Turns out that the anchors are relative to the label's x, y position. I had thought that the anchors were relative to the corner of the window. PyCharm's Ai Assistant showed me the error of my assumption. I use .5 and 1, the label appears centered above the point.
-