@@ -144,7 +144,7 @@ axes created by ``plt.subplots``.
144
144
plt.tight_layout()
145
145
146
146
@savefig plotting_example_existing_axes.png width =6in
147
- plt.show ()
147
+ plt.draw ()
148
148
149
149
On the right is a histogram created by :py:func: `xarray.plot.hist `.
150
150
@@ -343,7 +343,7 @@ matplotlib is available.
343
343
plt.tight_layout()
344
344
345
345
@savefig plotting_2d_call_matplotlib.png width =4in
346
- plt.show ()
346
+ plt.draw ()
347
347
348
348
.. note ::
349
349
@@ -359,7 +359,7 @@ matplotlib is available.
359
359
air2d.plot()
360
360
361
361
@savefig plotting_2d_call_matplotlib2.png width =4in
362
- plt.show ()
362
+ plt.draw ()
363
363
364
364
Colormaps
365
365
~~~~~~~~~
@@ -444,9 +444,11 @@ if using ``imshow`` or ``pcolormesh`` (but not with ``contour`` or ``contourf``,
444
444
since levels are chosen automatically).
445
445
446
446
.. ipython :: python
447
+ :okwarning:
447
448
448
449
@savefig plotting_seaborn_palette.png width =4in
449
450
air2d.plot(levels = 10 , cmap = ' husl' )
451
+ plt.draw()
450
452
451
453
.. _plotting.faceting :
452
454
@@ -519,6 +521,11 @@ Other features
519
521
520
522
Faceted plotting supports other arguments common to xarray 2d plots.
521
523
524
+ .. ipython :: python
525
+ :suppress:
526
+
527
+ plt.close(' all' )
528
+
522
529
.. ipython :: python
523
530
524
531
hasoutliers = t.isel(time = slice (0 , 5 )).copy()
@@ -528,7 +535,7 @@ Faceted plotting supports other arguments common to xarray 2d plots.
528
535
@savefig plot_facet_robust.png
529
536
g = hasoutliers.plot.pcolormesh(' lon' , ' lat' , col = ' time' , col_wrap = 3 ,
530
537
robust = True , cmap = ' viridis' ,
531
- cbar_kwargs = {' label' : ' this has outliers' })
538
+ cbar_kwargs = {' label' : ' this has outliers' })
532
539
533
540
FacetGrid Objects
534
541
~~~~~~~~~~~~~~~~~
@@ -568,7 +575,7 @@ they have been plotted.
568
575
bottomright.annotate(' bottom right' , (240 , 40 ))
569
576
570
577
@savefig plot_facet_iterator.png
571
- plt.show ()
578
+ plt.draw ()
572
579
573
580
TODO: add an example of using the ``map `` method to plot dataset variables
574
581
(e.g., with ``plt.quiver ``).
@@ -603,7 +610,7 @@ by faceting are accessible in the object returned by ``plot``:
603
610
ax.coastlines()
604
611
ax.gridlines()
605
612
@savefig plotting_maps_cartopy_facetting.png width =100%
606
- plt.show ();
613
+ plt.draw ();
607
614
608
615
609
616
Details
@@ -634,7 +641,7 @@ These are provided for user convenience; they all call the same code.
634
641
xplt.line(da, ax = axes[1 , 1 ])
635
642
plt.tight_layout()
636
643
@savefig plotting_ways_to_use.png width =6in
637
- plt.show ()
644
+ plt.draw ()
638
645
639
646
Here the output is the same. Since the data is 1 dimensional the line plot
640
647
was used.
0 commit comments