Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. How to create multiple axes using Qt designer?

How to create multiple axes using Qt designer?

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
1 Posts 1 Posters 268 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.
  • A Offline
    A Offline
    Anitha Yala
    wrote on last edited by Anitha Yala
    #1

    Hi,

    I have code for a plot. But I dont know how to do this with Qt designer tool.
    I have already created .ui for image1 I want ui file for image 2.
    I don't find any options to get axes and set labels and auto range etc in Qt designer tool.

    def setupUi(self, Form_Plot):
    Form_Plot.setObjectName("Form_Plot")
    Form_Plot.resize(1040, 745)

        self.graphicsView1 = PlotWidget(Form_Plot)
        self.graphicsView1.setGeometry(QtCore.QRect(10, 9, 900, 341))
        self.graphicsView1.setObjectName("graphicsView1")
        self.graphicsView1.setRange(xRange=(0,self.MaxGraphPts))
        self.graphicsView1.setAutoVisible(y=True)
        self.graphicsView1.enableAutoRange()
        self.graphicsView1_axis1 = self.graphicsView1.getAxis('left')
        self.graphicsView1_axis1.setPen(pg.mkPen(color=(COL_1_COLOUR), width=2))
    
        self.graphicsView1_Graph2 = pg.ViewBox()
        self.graphicsView1.scene().addItem(self.graphicsView1_Graph2)
        self.graphicsView1_axis2 = self.graphicsView1.getAxis('right')
        self.graphicsView1_axis2.linkToView(self.graphicsView1_Graph2)
        self.graphicsView1_axis2.setPen(pg.mkPen(color=(COL_2_COLOUR), width=2))
        
        self.graphicsView1_Graph2.setXLink(self.graphicsView1.plotItem)
        self.graphicsView1_Graph2.setXLink(self.graphicsView1)
        self.graphicsView1_Graph2.setRange(xRange=(0,self.MaxGraphPts))
        self.graphicsView1_Graph2.setAutoVisible(y=True)
        self.graphicsView1.setLabel('right', color=COL_2_COLOUR)
       
        
        self.curveA_1 = self.graphicsView1.plot(pen=pg.mkPen(color=COL_1_COLOUR))
        self.curveA_2 = self.graphicsView1.plot(pen=pg.mkPen(color=COL_2_COLOUR))
        self.graphicsView1_Graph2.enableAutoRange()
        self.graphicsView1_Graph2.addItem(self.curveA_2)
    

    This is a small part of the code in setupUI function. How can we generate .ui file for this code?
    image 1.JPG image 2.JPG

    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