You can do it pretty efficiently with numpy: x = [1, 4, 6]
y = [8, 9, 7] xarr = np.arange(7) yarr = np.zeros(7) yarr[x] = y pg.plot(x, y, ...) On Sat, Aug 20, 2016 at 7:56 AM, Diogo Valada <[email protected]> wrote: > Hey > Is there a way I can set a default y for every absent integer x axis value? > > For Example: > > I send this lists to the plotter: > x=[1, 4, 6] > y=[8, 9, 7] > And I want y(2)=y(3)=y(5)=0 > > Is there a way to set this rule? > > -- > 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/80f2cc1f-0e4b-49a5-b6a6-9860da1338cb%40googlegroups.com > <https://groups.google.com/d/msgid/pyqtgraph/80f2cc1f-0e4b-49a5-b6a6-9860da1338cb%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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/CACZXET-5J9i5KPamHPW8%3D_ya3baQSnFaFkiPtOLNRpP-%2BsUBSA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
