Hello. I have a program which gathers measurements of voltage, current and
time. I'd like to create a plot Voltage vs time and second X-axis at top
with Capacity on it. I've done simple window like this:
import pyqtgraph as pg
win=pg.GraphicsWindow("plot")
win.resize(1000,600)
plt=win.addPlot(row = 1, col = 0,title="Plot",labels={'left': 'Voltage [V]',
'bottom': 'time [s]','top': 'Capacity [mAh]'})
curve=plt.plot(pen='b')
label_cords = pg.LabelItem(justify = "right")
So it looks like on screen attached.
In my measurements I also get current so Capacity is calculated as:
current*10*time/36 (It's the same time I use to plot bottom x axis).
How can I set values of top axis to show capacity corresponded to the time
on bottom axis?
I've tried to work with one of
plt.getAxis('top').setTickSpacing()
plt.getAxis('top').setTicks()
plt.getAxis('top').tickValues()
but I don't really know how to set it properly. I want to keep autorange
function active (so when time axis going wider I want my Capacity axis to
expand aswell)
--
You received this message because you are subscribed to the Google Groups
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyqtgraph/7ff2693a-a375-4a8b-89bc-e01e878890ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.