ScatterPlotItem with x log scale

34 views
Skip to first unread message

Omar

unread,
Feb 14, 2017, 4:46:19 PM2/14/17
to pyqtgraph
HI, I am trying to plot a line and a map (with scatterplotitem) both with log scale in the x-axis;


......
plot_psdSRC = pg.PlotWidget()
plot_psdSRC.setLogMode(True,False)
spect=pg.ScatterPlotItem(size=10, pen=pg.mkPen(None), brush=pg.mkBrush(255, 255, 255, 120))



plot_psdSRC.plot(freqvalS[1:],specS[1:],pen='m')
 val=[]
 val.append({'pos': [0.1,100],'data':1, 'size':8.0,'brush':'w'})
 spect.addPoints(val)

....

this line plots fine:
plot_psdSRC.plot(freqvalS[1:],specS[1:],pen='m')

but 

 spect.addPoints(val)

puts the dot at x=1,y=100

Any ideas?



Omar

unread,
Feb 14, 2017, 5:26:32 PM2/14/17
to pyqtgraph
I found that position of the points are (after plot_psdSRC.setLogMode(True,False)) reference to log10

I did this and worked:
    for ii in range(len(l_pdf)):
        val.append({'pos': [np.log10(xx[ii]),yy[ii]],'data':1, 'size':4.0,'brush':colors[ii]})
Reply all
Reply to author
Forward
0 new messages