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 repeate ticks on x axis
Qt 6.11 is out! See what's new in the release blog

pyqtgraph repeate ticks on x axis

Scheduled Pinned Locked Moved Unsolved Qt for Python
3 Posts 2 Posters 1.1k 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.
  • Z Offline
    Z Offline
    zeile42
    wrote on last edited by zeile42
    #1

    Hello everyone,

    Does anyone have an idea how I could use pyqtgraph to repeat the x axis when creating a BarGraph?
    So the x- axis goes from 0-3 and then again from 0-3?

    Here is a minimal example:

    import sys
    from PyQt5.QtWidgets import QApplication, QMainWindow, QComboBox, QVBoxLayout, QWidget
    import pyqtgraph as pg
    
    class MyWindow(QMainWindow):
        def __init__(self):
            super().__init__()
    
            # Set window properties
            self.setGeometry(100, 100, 1200, 800)
            self.setWindowTitle("PyQt Example")
    
            x = [0, 1, 2, 3, 0, 1, 2, 3]
            y = [1, 4, 9, 6, 2, 6, 5, 8]
    
            self.graphWidget = pg.PlotWidget(self)
    
            # Setze die Labels für die Achsen
            self.graphWidget.setLabel('left', 'Y-Achse', color='blue')
            self.graphWidget.setLabel('bottom', 'X-Achse', color='green')
    
            curve1 = self.graphWidget.plot(x, y, pen='b', symbol='o',)
    
            layout = QVBoxLayout()
            layout.addWidget(self.graphWidget)
    
            central_widget = QWidget()
            central_widget.setLayout(layout)
    
            self.setCentralWidget(central_widget)
    
    if __name__ == "__main__":
        app = QApplication(sys.argv)
        window = MyWindow()
        window.show()
        sys.exit(app.exec_())
    
    

    Thanks

    Nice day

    1 Reply Last reply
    0
    • SGaistS SGaist moved this topic from General and Desktop on
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      You will likely have better support on the pyqtgraph forum. People over there will have more experience with that library.

      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
      • Z Offline
        Z Offline
        zeile42
        wrote on last edited by
        #3

        Hello,

        thanks for the link.
        I hope someone will responde because it seems that the group is not active.
        The last questions got no responde.

        Best regards

        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