diff --git a/examples/GLLinePlotItem.py b/examples/GLLinePlotItem.py index 9be9c07c..82e1f6fb 100644 --- a/examples/GLLinePlotItem.py +++ b/examples/GLLinePlotItem.py @@ -29,19 +29,16 @@ gz = gl.GLGridItem() gz.translate(0, 0, -10) w.addItem(gz) -def fn(x, y): - return np.cos(np.hypot(x, y)) - n = 51 y = np.linspace(-10,10,n) x = np.linspace(-10,10,100) for i in range(n): - yi = np.array([y[i]]*100) + yi = y[i] d = np.hypot(x, yi) z = 10 * np.cos(d) / (d+1) - pts = np.vstack([x,yi,z]).transpose() + pts = np.column_stack([x, np.full_like(x, yi), z]) plt = gl.GLLinePlotItem(pos=pts, color=pg.glColor((i,n*1.3)), width=(i+1)/10., antialias=True) w.addItem(plt) - + if __name__ == '__main__': pg.mkQApp().exec_()