Skip to content

Commit 087ccf1

Browse files
committed
demo.py: multiplot tests
1 parent 8bce6b2 commit 087ccf1

1 file changed

Lines changed: 73 additions & 0 deletions

File tree

demo.py

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,79 @@
262262
square = 1,
263263
wait = 1)
264264

265+
################################
266+
# multiplot
267+
################################
268+
269+
# basics
270+
gp.plot( (x**2,),
271+
(-x, x**3),
272+
( theta,
273+
1./np.cos(theta) + a*np.cos(theta), # broadcasted. dim=(7,1000)
274+
275+
dict( _with = 'lines',
276+
set = 'polar',
277+
square = True,
278+
yrange = [-5,5],
279+
legend = a.ravel())),
280+
(x_3d, y_3d, z_3d,
281+
dict( _with = 'points',
282+
title = 'sphere',
283+
square = True,
284+
legend = 'sphere',
285+
_3d = True)),
286+
wait=1,
287+
multiplot='title "basic multiplot" layout 2,2', )
288+
289+
# fancy contours stacked on top of one another
290+
xx,yy = np.meshgrid(np.linspace(-5,5,100),
291+
np.linspace(-5,5,100))
292+
zz = np.sin(xx) + yy*yy/30.
293+
gp.plot3d( (zz,
294+
dict(tuplesize=3,
295+
_with = np.array(('lines nosurface',
296+
'labels boxed nosurface')),
297+
_set = ( 'origin 0,0',
298+
'size 1,1',
299+
'view 60,30,1,1',
300+
'xrange [0:100]',
301+
'yrange [0:100]',
302+
'zrange [0:150]',
303+
'contour base',
304+
'xyplane at 10' )) ),
305+
306+
(zz,
307+
dict(tuplesize=3,
308+
_with = np.array(('lines nosurface',
309+
'labels boxed nosurface')),
310+
_set = ( 'origin 0,0',
311+
'size 1,1',
312+
'view 60,30,1,1',
313+
'xrange [0:100]',
314+
'yrange [0:100]',
315+
'zrange [0:150]',
316+
'contour base',
317+
'xyplane at 50' )) ),
318+
319+
(zz,
320+
dict(tuplesize=3,
321+
_with = np.array(('lines nosurface',
322+
'labels boxed nosurface')),
323+
_set = ( 'origin 0,0',
324+
'size 1,1',
325+
'view 60,30,1,1',
326+
'xrange [0:100]',
327+
'yrange [0:100]',
328+
'zrange [0:150]',
329+
'contour base',
330+
'xyplane at 150' )) ),
331+
332+
wait=1,
333+
square=1,
334+
multiplot='layout 3,1')
335+
336+
337+
265338

266339
################################
267340
# testing some error detection

0 commit comments

Comments
 (0)