Re: [pyqtgraph] Default for y axis when x axis values not on list

27 views
Skip to first unread message

Luke Campagnola

unread,
Aug 27, 2016, 3:21:02 AM8/27/16
to pyqt...@googlegroups.com
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 <diogov...@gmail.com> 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 pyqtgraph+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/80f2cc1f-0e4b-49a5-b6a6-9860da1338cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages