Skip to content

Commit 5a431b2

Browse files
committed
demo: stacked contours (multiplot) hardcopy
1 parent aa00e70 commit 5a431b2

1 file changed

Lines changed: 44 additions & 42 deletions

File tree

demo.py

Lines changed: 44 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -291,48 +291,50 @@
291291
xx,yy = np.meshgrid(np.linspace(-5,5,100),
292292
np.linspace(-5,5,100))
293293
zz = np.sin(xx) + yy*yy/30.
294-
gp.plot3d( (zz,
295-
dict(tuplesize=3,
296-
_with = np.array(('lines nosurface',
297-
'labels boxed nosurface')),
298-
_set = ( 'origin 0,0',
299-
'size 1,1',
300-
'view 60,30,1,1',
301-
'xrange [0:100]',
302-
'yrange [0:100]',
303-
'zrange [0:150]',
304-
'contour base',
305-
'xyplane at 10' )) ),
306-
307-
(zz,
308-
dict(tuplesize=3,
309-
_with = np.array(('lines nosurface',
310-
'labels boxed nosurface')),
311-
_set = ( 'origin 0,0',
312-
'size 1,1',
313-
'view 60,30,1,1',
314-
'xrange [0:100]',
315-
'yrange [0:100]',
316-
'zrange [0:150]',
317-
'contour base',
318-
'xyplane at 50' )) ),
319-
320-
(zz,
321-
dict(tuplesize=3,
322-
_with = np.array(('lines nosurface',
323-
'labels boxed nosurface')),
324-
_set = ( 'origin 0,0',
325-
'size 1,1',
326-
'view 60,30,1,1',
327-
'xrange [0:100]',
328-
'yrange [0:100]',
329-
'zrange [0:150]',
330-
'contour base',
331-
'xyplane at 150' )) ),
332-
333-
wait=1,
334-
square=1,
335-
multiplot=True)
294+
for hardcopy in (None, "stacked-contours.png"):
295+
gp.plot3d( (zz,
296+
dict(tuplesize=3,
297+
_with = np.array(('lines nosurface',
298+
'labels boxed nosurface')),
299+
_set = ( 'origin 0,0',
300+
'size 1,1',
301+
'view 60,30,1,1',
302+
'xrange [0:100]',
303+
'yrange [0:100]',
304+
'zrange [0:150]',
305+
'contour base',
306+
'xyplane at 10' )) ),
307+
308+
(zz,
309+
dict(tuplesize=3,
310+
_with = np.array(('lines nosurface',
311+
'labels boxed nosurface')),
312+
_set = ( 'origin 0,0',
313+
'size 1,1',
314+
'view 60,30,1,1',
315+
'xrange [0:100]',
316+
'yrange [0:100]',
317+
'zrange [0:150]',
318+
'contour base',
319+
'xyplane at 50' )) ),
320+
321+
(zz,
322+
dict(tuplesize=3,
323+
_with = np.array(('lines nosurface',
324+
'labels boxed nosurface')),
325+
_set = ( 'origin 0,0',
326+
'size 1,1',
327+
'view 60,30,1,1',
328+
'xrange [0:100]',
329+
'yrange [0:100]',
330+
'zrange [0:150]',
331+
'contour base',
332+
'xyplane at 150' )) ),
333+
334+
wait=1,
335+
square=1,
336+
hardcopy=hardcopy,
337+
multiplot=True)
336338

337339

338340

0 commit comments

Comments
 (0)