Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. pyqtgraph - labels in scatterplots
Forum Updated to NodeBB v4.3 + New Features

pyqtgraph - labels in scatterplots

Scheduled Pinned Locked Moved Solved Qt for Python
3 Posts 2 Posters 755 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Ed Schneider
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • SGaistS SGaist

      Hi,

      I haven't used this package but this StackOverflow answer might help.

      E Offline
      E Offline
      Ed Schneider
      wrote on last edited by
      #3

      @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.

      1 Reply Last reply
      1
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #2

        Hi,

        I haven't used this package but this StackOverflow answer might help.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        E 1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          I haven't used this package but this StackOverflow answer might help.

          E Offline
          E Offline
          Ed Schneider
          wrote on last edited by
          #3

          @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.

          1 Reply Last reply
          1
          • E Ed Schneider has marked this topic as solved on

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved