BTW I forgot to mention I don't want to plot new curve, I just want one curve and 2 x-axes whose values are corresponds to each other
W dniu czwartek, 7 lutego 2019 11:44:34 UTC+1 użytkownik [email protected] napisał: > > 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/fc3be089-c965-4d35-8267-40c79d956c74%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
