推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
ALLROBOT
V2EX  ›  Python

Pyqtgraph 绘制曲线的左下角的 A 按钮怎么去掉?

  •  
  •   ALLROBOT · Mar 30, 2022 · 2642 views
    This topic created in 1529 days ago, the information mentioned may be changed or developed.

            Form.resize(820, 454)
            Form.setObjectName("Form")
            historyLength=1800
            self.graphicsView = PlotWidget(Form)
            self.graphicsView.setGeometry(QtCore.QRect(10, 10, 261, 121))
            self.graphicsView.setObjectName("graphicsView")
    
            self.graphicsView.setLabel(axis="left",text='sEMG Voltage')
            self.graphicsView.setLabel(axis='bottom',text='Time')
            self.graphicsView.setMouseEnabled(x=False,y=False)
            self.graphicsView.setAntialiasing(True)
            self.graphicsView.enableMouse(False)
            self.data1 = np.random.normal(size=1800)
            self.curve2 = self.graphicsView.plot(self.data1)
            self.ptr1 = 0
    
            def update1():
                global data1, ptr1
                self.graphicsView.setRange(xRange=[self.ptr1,self.ptr1+historyLength],yRange=[0,500],padding=0)
                self.data1[:-1] = self.data1[1:]  # shift data in the array one sample left
    
                self.data1[-1] = random.uniform(0,500)
    
                self.ptr1 += 1
                self.curve2.setData(self.data1)
                self.curve2.setPos(self.ptr1, 0)
    
            self.timer = pg.QtCore.QTimer()
            self.timer.timeout.connect(update1)
            self.timer.start(10)
    

    设置了 buttonsHidden = True 还是去不掉

    3 replies    2022-03-30 19:10:03 +08:00
    neoshui
        1
    neoshui  
       Mar 30, 2022 via Android
    蹲一个
    ALLROBOT
        2
    ALLROBOT  
    OP
       Mar 30, 2022
    @AlexShui #1

    问题已解决,设置
    self.graphicsView.setMouseEnabled(x=False,y=False)
    self.graphicsView.setAntialiasing(True)
    self.graphicsView.setMenuEnabled(False)

    禁用右键菜单、拖动、左下角的 A 按钮
    ALLROBOT
        3
    ALLROBOT  
    OP
       Mar 30, 2022
    😅那个隐藏按钮是我搞错了用法,楼上给的解决方案: https://pyqtgraph.narkive.com/XzPRpre0/remove-the-a-auto-range-button

    顺便一提,pyqt disigner ,pyuic 等 pyqt 工具都是 conda 虚拟环境 Script 路径下的,Pycharm 找不到说明文档


    不知道怎么回事,刷新路径或手动添加 Script 路径也没用,有没靠谱的解决方案?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3006 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 07:11 · PVG 15:11 · LAX 00:11 · JFK 03:11
    ♥ Do have faith in what you're doing.