Re: [pyqtgraph] PyQtgraph: Plotting 3rd Octave data

12 views
Skip to first unread message

Francisco S-Climent

unread,
Aug 16, 2016, 5:51:18 AM8/16/16
to pyqt...@googlegroups.com
Hello Gurus,

I am making an application to plot noise data and I need to plot 3rd Octave Data in Log scale in the X Axis. I have no problems to set the major tick values, but I would like to set the minor Tick values as coresponding to the 3rd Octave values and I am not able to do that. The code below gives an error when pass the AxisItem to the plot.


Any suggestion? Thanks a lot in advance!!


    def FormatAxis(self):
        global frVec3rdOct
        global frXAxis
        minorFrVec = dict(enumerate([4,5,6.3,12.5,16,20,25,31.5,40,50,63,80,125,160,200,250,315,400,500,630,800,1250,1600,2000,2500,3150,4000,5000,6300,8000,12500,16000]))
        majorFrVec = dict(enumerate([10,100,1000,10000,100000]))
        frXAxis=pg.AxisItem(orientation='bottom')
        frXAxis.logTickValues([[majorFrVec.items()],[minorFrVec.items()]])
                
        frXAxis.setLabel(text='Freq 1/3 Oct',units='Hz')
Reply all
Reply to author
Forward
0 new messages