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. How to bring PyQt axis or ticks to the front?

How to bring PyQt axis or ticks to the front?

Scheduled Pinned Locked Moved Unsolved Qt for Python
2 Posts 2 Posters 308 Views
  • 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.
  • M Offline
    M Offline
    mjasian
    wrote on last edited by
    #1

    As you can see if you run the code or look at the image below, the ticks of the PyQt axis is missing. Does anyone know how to show the axis ticks?

    import numpy as np
    from pyqtgraph.Qt import QtCore, QtGui
    import pyqtgraph as pg

    app = QtGui.QApplication([])

    plot = pg.PlotItem()
    plot.setLabel(axis='left', text='Y-axis')
    plot.setLabel(axis='bottom', text='X-axis')

    imv = pg.ImageView(view=plot) # set the plot to ImageView's view
    view = plot.getViewBox()
    view.setLimits(xMin = 0, xMax = 500, yMin = 0, yMax = 500)
    plot.getAxis('left').()

    data = np.fromfunction(lambda i, j: np.sin(i/16)*j/128, (512, 512), dtype=float) + np.random.normal(scale=0.2, size=(512, 512))
    imv.setImage(data)

    vbox = imv.getView()
    vbox.addItem(pg.LabelItem("this is a nice label"))

    imv.show()
    app.exec_()

    Screen Shot 2021-10-14 at 2.54.49 PM.png

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

      Hi and welcome to devnet,

      This looks like a pyqtgraph issue. You should check with its authors.

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

      1 Reply Last reply
      0

      • Login

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