Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 63e803e

Browse files
committed
rebuild the docs for 2.2.2-doc updates
1 parent 04656c3 commit 63e803e

File tree

4,297 files changed

+83369
-37558
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,297 files changed

+83369
-37558
lines changed

2.2.2/_downloads/bar_unit_demo.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"cell_type": "markdown",
1616
"metadata": {},
1717
"source": [
18-
"\n# Group barchart with units\n\n\nThis is the same example as :doc:`the barchart demo<../api/barchart>`\nin centimeters.\n\n.. only:: builder_html\n\n This example requires :download:`basic_units.py <basic_units.py>`\n\n"
18+
"\n# Group barchart with units\n\n\nThis is the same example as\n:doc:`the barchart demo<../lines_bars_and_markers/barchart>` in centimeters.\n\n.. only:: builder_html\n\n This example requires :download:`basic_units.py <basic_units.py>`\n\n"
1919
]
2020
},
2121
{

2.2.2/_downloads/bar_unit_demo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
Group barchart with units
44
=========================
55
6-
This is the same example as :doc:`the barchart demo<../api/barchart>`
7-
in centimeters.
6+
This is the same example as
7+
:doc:`the barchart demo<../lines_bars_and_markers/barchart>` in centimeters.
88
99
.. only:: builder_html
1010

2.2.2/_downloads/constrainedlayout_guide.ipynb

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
},
2727
"outputs": [],
2828
"source": [
29-
"# sphinx_gallery_thumbnail_number = 18\n\n#import matplotlib\n#matplotlib.use('Qt5Agg')\n\nimport warnings\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport matplotlib.gridspec as gridspec\n\nimport matplotlib._layoutbox as layoutbox\n\nplt.rcParams['savefig.facecolor'] = \"0.8\"\nplt.rcParams['figure.figsize'] = 4.5, 4.\n\n\ndef example_plot(ax, fontsize=12, nodec=False):\n ax.plot([1, 2])\n\n ax.locator_params(nbins=3)\n if not nodec:\n ax.set_xlabel('x-label', fontsize=fontsize)\n ax.set_ylabel('y-label', fontsize=fontsize)\n ax.set_title('Title', fontsize=fontsize)\n else:\n ax.set_xticklabels('')\n ax.set_yticklabels('')\n\n\nfig, ax = plt.subplots()\nexample_plot(ax, fontsize=24)"
29+
"# sphinx_gallery_thumbnail_number = 18\n\n#import matplotlib\n#matplotlib.use('Qt5Agg')\n\nimport warnings\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport matplotlib.colors as mcolors\nimport matplotlib.gridspec as gridspec\n\nimport matplotlib._layoutbox as layoutbox\n\nplt.rcParams['savefig.facecolor'] = \"0.8\"\nplt.rcParams['figure.figsize'] = 4.5, 4.\n\n\ndef example_plot(ax, fontsize=12, nodec=False):\n ax.plot([1, 2])\n\n ax.locator_params(nbins=3)\n if not nodec:\n ax.set_xlabel('x-label', fontsize=fontsize)\n ax.set_ylabel('y-label', fontsize=fontsize)\n ax.set_title('Title', fontsize=fontsize)\n else:\n ax.set_xticklabels('')\n ax.set_yticklabels('')\n\n\nfig, ax = plt.subplots()\nexample_plot(ax, fontsize=24)"
3030
]
3131
},
3232
{
@@ -87,7 +87,7 @@
8787
"cell_type": "markdown",
8888
"metadata": {},
8989
"source": [
90-
"Colorbars\n=========\n\nIf you create a colorbar with the :func:`~matplotlib.pyplot.colorbar`\ncommand you need to make room for it. ``constrained_layout`` does this\nautomatically. Note that if you specify ``use_gridspec=True`` it will be\nignored because this option is made for improving the layout via\n``tight_layout``.\n\n"
90+
"Colorbars\n=========\n\nIf you create a colorbar with the :func:`~matplotlib.pyplot.colorbar`\ncommand you need to make room for it. ``constrained_layout`` does this\nautomatically. Note that if you specify ``use_gridspec=True`` it will be\nignored because this option is made for improving the layout via\n``tight_layout``.\n\n<div class=\"alert alert-info\"><h4>Note</h4><p>For the `pcolormesh` kwargs (``pc_kwargs``) we use a dictionary.\n Below we will assign one colorbar to a number of axes each containing\n a `ScalarMappable`; specifying the norm and colormap ensures\n the colorbar is accurate for all the axes.</p></div>\n\n"
9191
]
9292
},
9393
{
@@ -98,7 +98,7 @@
9898
},
9999
"outputs": [],
100100
"source": [
101-
"arr = np.arange(100).reshape((10, 10))\nfig, ax = plt.subplots(figsize=(4, 4), constrained_layout=True)\nim = ax.pcolormesh(arr, rasterized=True)\nfig.colorbar(im, ax=ax, shrink=0.6)"
101+
"arr = np.arange(100).reshape((10, 10))\nnorm = mcolors.Normalize(vmin=0., vmax=100.)\n# see note above: this makes all pcolormesh calls consistent:\npc_kwargs = {'rasterized':True, 'cmap':'viridis', 'norm':norm}\nfig, ax = plt.subplots(figsize=(4, 4), constrained_layout=True)\nim = ax.pcolormesh(arr, **pc_kwargs)\nfig.colorbar(im, ax=ax, shrink=0.6)"
102102
]
103103
},
104104
{
@@ -116,7 +116,7 @@
116116
},
117117
"outputs": [],
118118
"source": [
119-
"fig, axs = plt.subplots(2, 2, figsize=(4, 4), constrained_layout=True)\nfor ax in axs.flatten():\n im = ax.pcolormesh(arr, rasterized=True)\nfig.colorbar(im, ax=axs, shrink=0.6)"
119+
"fig, axs = plt.subplots(2, 2, figsize=(4, 4), constrained_layout=True)\nfor ax in axs.flatten():\n im = ax.pcolormesh(arr, **pc_kwargs)\nfig.colorbar(im, ax=axs, shrink=0.6)"
120120
]
121121
},
122122
{
@@ -134,7 +134,7 @@
134134
},
135135
"outputs": [],
136136
"source": [
137-
"fig, axs = plt.subplots(3, 1, figsize=(4, 4), constrained_layout=True)\nfor ax in axs[:2]:\n im = ax.pcolormesh(arr, rasterized=True)\nfig.colorbar(im, ax=axs[:2], shrink=0.6)\nim = axs[2].pcolormesh(arr, rasterized=True)\nfig.colorbar(im, ax=axs[2], shrink=0.6)"
137+
"fig, axs = plt.subplots(3, 1, figsize=(4, 4), constrained_layout=True)\nfor ax in axs[:2]:\n im = ax.pcolormesh(arr, **pc_kwargs)\nfig.colorbar(im, ax=axs[:2], shrink=0.6)\nim = axs[2].pcolormesh(arr, **pc_kwargs)\nfig.colorbar(im, ax=axs[2], shrink=0.6)"
138138
]
139139
},
140140
{
@@ -152,7 +152,7 @@
152152
},
153153
"outputs": [],
154154
"source": [
155-
"fig, axs = plt.subplots(3, 1, figsize=(4, 4), constrained_layout=True)\nfor ax in axs[:2]:\n im = ax.pcolormesh(arr, rasterized=True)\nfig.colorbar(im, ax=axs[:2], shrink=0.6)\nim = axs[2].pcolormesh(arr, rasterized=True)\nfig.colorbar(im, ax=[axs[2]], shrink=0.6)"
155+
"fig, axs = plt.subplots(3, 1, figsize=(4, 4), constrained_layout=True)\nfor ax in axs[:2]:\n im = ax.pcolormesh(arr, **pc_kwargs)\nfig.colorbar(im, ax=axs[:2], shrink=0.6)\nim = axs[2].pcolormesh(arr, **pc_kwargs)\nfig.colorbar(im, ax=[axs[2]], shrink=0.6)"
156156
]
157157
},
158158
{
@@ -170,7 +170,7 @@
170170
},
171171
"outputs": [],
172172
"source": [
173-
"fig, axs = plt.subplots(2, 2, figsize=(4, 4), constrained_layout=True)\nfor ax in axs.flatten():\n im = ax.pcolormesh(arr, rasterized=True)\nfig.colorbar(im, ax=axs, shrink=0.6)\nfig.suptitle('Big Suptitle')"
173+
"fig, axs = plt.subplots(2, 2, figsize=(4, 4), constrained_layout=True)\nfor ax in axs.flatten():\n im = ax.pcolormesh(arr, **pc_kwargs)\nfig.colorbar(im, ax=axs, shrink=0.6)\nfig.suptitle('Big Suptitle')"
174174
]
175175
},
176176
{
@@ -260,7 +260,7 @@
260260
},
261261
"outputs": [],
262262
"source": [
263-
"fig, axs = plt.subplots(2, 2, constrained_layout=True)\nfor ax in axs.flatten():\n pc = ax.pcolormesh(arr, rasterized=True)\n fig.colorbar(im, ax=ax, shrink=0.6, pad=0)\n ax.set_xticklabels('')\n ax.set_yticklabels('')\nfig.set_constrained_layout_pads(w_pad=2./72., h_pad=2./72.,\n hspace=0.2, wspace=0.2)"
263+
"fig, axs = plt.subplots(2, 2, constrained_layout=True)\nfor ax in axs.flatten():\n pc = ax.pcolormesh(arr, **pc_kwargs)\n fig.colorbar(im, ax=ax, shrink=0.6, pad=0)\n ax.set_xticklabels('')\n ax.set_yticklabels('')\nfig.set_constrained_layout_pads(w_pad=2./72., h_pad=2./72.,\n hspace=0.2, wspace=0.2)"
264264
]
265265
},
266266
{
@@ -278,7 +278,7 @@
278278
},
279279
"outputs": [],
280280
"source": [
281-
"fig, axs = plt.subplots(2, 2, constrained_layout=True)\nfor ax in axs.flatten():\n pc = ax.pcolormesh(arr, rasterized=True)\n fig.colorbar(im, ax=ax, shrink=0.6, pad=0.05)\n ax.set_xticklabels('')\n ax.set_yticklabels('')\nfig.set_constrained_layout_pads(w_pad=2./72., h_pad=2./72.,\n hspace=0.2, wspace=0.2)"
281+
"fig, axs = plt.subplots(2, 2, constrained_layout=True)\nfor ax in axs.flatten():\n pc = ax.pcolormesh(arr, **pc_kwargs)\n fig.colorbar(im, ax=ax, shrink=0.6, pad=0.05)\n ax.set_xticklabels('')\n ax.set_yticklabels('')\nfig.set_constrained_layout_pads(w_pad=2./72., h_pad=2./72.,\n hspace=0.2, wspace=0.2)"
282282
]
283283
},
284284
{
@@ -368,7 +368,7 @@
368368
},
369369
"outputs": [],
370370
"source": [
371-
"def docomplicated(suptitle=None):\n fig = plt.figure(constrained_layout=True)\n gs0 = gridspec.GridSpec(1, 2, figure=fig, width_ratios=[1., 2.])\n gsl = gridspec.GridSpecFromSubplotSpec(2, 1, gs0[0])\n gsr = gridspec.GridSpecFromSubplotSpec(2, 2, gs0[1])\n\n for gs in gsl:\n ax = fig.add_subplot(gs)\n example_plot(ax)\n axs = []\n for gs in gsr:\n ax = fig.add_subplot(gs)\n pcm = ax.pcolormesh(arr, rasterized=True)\n ax.set_xlabel('x-label')\n ax.set_ylabel('y-label')\n ax.set_title('title')\n\n axs += [ax]\n fig.colorbar(pcm, ax=axs)\n if suptitle is not None:\n fig.suptitle(suptitle)\n\ndocomplicated()"
371+
"def docomplicated(suptitle=None):\n fig = plt.figure(constrained_layout=True)\n gs0 = gridspec.GridSpec(1, 2, figure=fig, width_ratios=[1., 2.])\n gsl = gridspec.GridSpecFromSubplotSpec(2, 1, gs0[0])\n gsr = gridspec.GridSpecFromSubplotSpec(2, 2, gs0[1])\n\n for gs in gsl:\n ax = fig.add_subplot(gs)\n example_plot(ax)\n axs = []\n for gs in gsr:\n ax = fig.add_subplot(gs)\n pcm = ax.pcolormesh(arr, **pc_kwargs)\n ax.set_xlabel('x-label')\n ax.set_ylabel('y-label')\n ax.set_title('title')\n\n axs += [ax]\n fig.colorbar(pcm, ax=axs)\n if suptitle is not None:\n fig.suptitle(suptitle)\n\ndocomplicated()"
372372
]
373373
},
374374
{
@@ -544,7 +544,7 @@
544544
},
545545
"outputs": [],
546546
"source": [
547-
"fig, ax = plt.subplots(1, 2, constrained_layout=True)\nim = ax[0].pcolormesh(arr, rasterized=True)\nfig.colorbar(im, ax=ax[0], shrink=0.6)\nim = ax[1].pcolormesh(arr, rasterized=True)\nplot_children(fig, fig._layoutbox, printit=False)"
547+
"fig, ax = plt.subplots(1, 2, constrained_layout=True)\nim = ax[0].pcolormesh(arr, **pc_kwargs)\nfig.colorbar(im, ax=ax[0], shrink=0.6)\nim = ax[1].pcolormesh(arr, **pc_kwargs)\nplot_children(fig, fig._layoutbox, printit=False)"
548548
]
549549
},
550550
{
@@ -562,7 +562,7 @@
562562
},
563563
"outputs": [],
564564
"source": [
565-
"fig, ax = plt.subplots(2, 2, constrained_layout=True)\nfor a in ax.flatten():\n im = a.pcolormesh(arr, rasterized=True)\nfig.colorbar(im, ax=ax, shrink=0.6)\nplot_children(fig, fig._layoutbox, printit=False)"
565+
"fig, ax = plt.subplots(2, 2, constrained_layout=True)\nfor a in ax.flatten():\n im = a.pcolormesh(arr, **pc_kwargs)\nfig.colorbar(im, ax=ax, shrink=0.6)\nplot_children(fig, fig._layoutbox, printit=False)"
566566
]
567567
},
568568
{
@@ -580,7 +580,7 @@
580580
},
581581
"outputs": [],
582582
"source": [
583-
"fig = plt.figure(constrained_layout=True)\ngs = gridspec.GridSpec(2, 2, figure=fig)\nax = fig.add_subplot(gs[:, 0])\nim = ax.pcolormesh(arr, rasterized=True)\nax = fig.add_subplot(gs[0, 1])\nim = ax.pcolormesh(arr, rasterized=True)\nax = fig.add_subplot(gs[1, 1])\nim = ax.pcolormesh(arr, rasterized=True)\nplot_children(fig, fig._layoutbox, printit=False)"
583+
"fig = plt.figure(constrained_layout=True)\ngs = gridspec.GridSpec(2, 2, figure=fig)\nax = fig.add_subplot(gs[:, 0])\nim = ax.pcolormesh(arr, **pc_kwargs)\nax = fig.add_subplot(gs[0, 1])\nim = ax.pcolormesh(arr, **pc_kwargs)\nax = fig.add_subplot(gs[1, 1])\nim = ax.pcolormesh(arr, **pc_kwargs)\nplot_children(fig, fig._layoutbox, printit=False)"
584584
]
585585
},
586586
{
@@ -598,7 +598,7 @@
598598
},
599599
"outputs": [],
600600
"source": [
601-
"fig = plt.figure(constrained_layout=True)\ngs = gridspec.GridSpec(3, 2, figure=fig,\n height_ratios=[1., 0.5, 1.5],\n width_ratios=[1.2, 0.8])\nax = fig.add_subplot(gs[:2, 0])\nim = ax.pcolormesh(arr, rasterized=True)\nax = fig.add_subplot(gs[2, 0])\nim = ax.pcolormesh(arr, rasterized=True)\nax = fig.add_subplot(gs[0, 1])\nim = ax.pcolormesh(arr, rasterized=True)\nax = fig.add_subplot(gs[1:, 1])\nim = ax.pcolormesh(arr, rasterized=True)\nplot_children(fig, fig._layoutbox, printit=False)"
601+
"fig = plt.figure(constrained_layout=True)\ngs = gridspec.GridSpec(3, 2, figure=fig,\n height_ratios=[1., 0.5, 1.5],\n width_ratios=[1.2, 0.8])\nax = fig.add_subplot(gs[:2, 0])\nim = ax.pcolormesh(arr, **pc_kwargs)\nax = fig.add_subplot(gs[2, 0])\nim = ax.pcolormesh(arr, **pc_kwargs)\nax = fig.add_subplot(gs[0, 1])\nim = ax.pcolormesh(arr, **pc_kwargs)\nax = fig.add_subplot(gs[1:, 1])\nim = ax.pcolormesh(arr, **pc_kwargs)\nplot_children(fig, fig._layoutbox, printit=False)"
602602
]
603603
},
604604
{
@@ -616,7 +616,7 @@
616616
},
617617
"outputs": [],
618618
"source": [
619-
"fig = plt.figure(constrained_layout=True)\ngs = gridspec.GridSpec(1, 3, figure=fig)\nax = fig.add_subplot(gs[0])\nim = ax.pcolormesh(arr, rasterized=True)\nax = fig.add_subplot(gs[-1])\nim = ax.pcolormesh(arr, rasterized=True)\nplot_children(fig, fig._layoutbox, printit=False)\nplt.show()"
619+
"fig = plt.figure(constrained_layout=True)\ngs = gridspec.GridSpec(1, 3, figure=fig)\nax = fig.add_subplot(gs[0])\nim = ax.pcolormesh(arr, **pc_kwargs)\nax = fig.add_subplot(gs[-1])\nim = ax.pcolormesh(arr, **pc_kwargs)\nplot_children(fig, fig._layoutbox, printit=False)\nplt.show()"
620620
]
621621
},
622622
{

2.2.2/_downloads/constrainedlayout_guide.py

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040

4141
import matplotlib.pyplot as plt
4242
import numpy as np
43+
import matplotlib.colors as mcolors
4344
import matplotlib.gridspec as gridspec
4445

4546
import matplotlib._layoutbox as layoutbox
@@ -98,10 +99,20 @@ def example_plot(ax, fontsize=12, nodec=False):
9899
# automatically. Note that if you specify ``use_gridspec=True`` it will be
99100
# ignored because this option is made for improving the layout via
100101
# ``tight_layout``.
102+
#
103+
# .. note::
104+
#
105+
# For the `pcolormesh` kwargs (``pc_kwargs``) we use a dictionary.
106+
# Below we will assign one colorbar to a number of axes each containing
107+
# a `ScalarMappable`; specifying the norm and colormap ensures
108+
# the colorbar is accurate for all the axes.
101109

102110
arr = np.arange(100).reshape((10, 10))
111+
norm = mcolors.Normalize(vmin=0., vmax=100.)
112+
# see note above: this makes all pcolormesh calls consistent:
113+
pc_kwargs = {'rasterized':True, 'cmap':'viridis', 'norm':norm}
103114
fig, ax = plt.subplots(figsize=(4, 4), constrained_layout=True)
104-
im = ax.pcolormesh(arr, rasterized=True)
115+
im = ax.pcolormesh(arr, **pc_kwargs)
105116
fig.colorbar(im, ax=ax, shrink=0.6)
106117

107118
############################################################################
@@ -110,7 +121,7 @@ def example_plot(ax, fontsize=12, nodec=False):
110121

111122
fig, axs = plt.subplots(2, 2, figsize=(4, 4), constrained_layout=True)
112123
for ax in axs.flatten():
113-
im = ax.pcolormesh(arr, rasterized=True)
124+
im = ax.pcolormesh(arr, **pc_kwargs)
114125
fig.colorbar(im, ax=axs, shrink=0.6)
115126

116127
############################################################################
@@ -122,9 +133,9 @@ def example_plot(ax, fontsize=12, nodec=False):
122133

123134
fig, axs = plt.subplots(3, 1, figsize=(4, 4), constrained_layout=True)
124135
for ax in axs[:2]:
125-
im = ax.pcolormesh(arr, rasterized=True)
136+
im = ax.pcolormesh(arr, **pc_kwargs)
126137
fig.colorbar(im, ax=axs[:2], shrink=0.6)
127-
im = axs[2].pcolormesh(arr, rasterized=True)
138+
im = axs[2].pcolormesh(arr, **pc_kwargs)
128139
fig.colorbar(im, ax=axs[2], shrink=0.6)
129140

130141
############################################################################
@@ -133,9 +144,9 @@ def example_plot(ax, fontsize=12, nodec=False):
133144

134145
fig, axs = plt.subplots(3, 1, figsize=(4, 4), constrained_layout=True)
135146
for ax in axs[:2]:
136-
im = ax.pcolormesh(arr, rasterized=True)
147+
im = ax.pcolormesh(arr, **pc_kwargs)
137148
fig.colorbar(im, ax=axs[:2], shrink=0.6)
138-
im = axs[2].pcolormesh(arr, rasterized=True)
149+
im = axs[2].pcolormesh(arr, **pc_kwargs)
139150
fig.colorbar(im, ax=[axs[2]], shrink=0.6)
140151

141152
####################################################
@@ -146,7 +157,7 @@ def example_plot(ax, fontsize=12, nodec=False):
146157

147158
fig, axs = plt.subplots(2, 2, figsize=(4, 4), constrained_layout=True)
148159
for ax in axs.flatten():
149-
im = ax.pcolormesh(arr, rasterized=True)
160+
im = ax.pcolormesh(arr, **pc_kwargs)
150161
fig.colorbar(im, ax=axs, shrink=0.6)
151162
fig.suptitle('Big Suptitle')
152163

@@ -225,7 +236,7 @@ def example_plot(ax, fontsize=12, nodec=False):
225236

226237
fig, axs = plt.subplots(2, 2, constrained_layout=True)
227238
for ax in axs.flatten():
228-
pc = ax.pcolormesh(arr, rasterized=True)
239+
pc = ax.pcolormesh(arr, **pc_kwargs)
229240
fig.colorbar(im, ax=ax, shrink=0.6, pad=0)
230241
ax.set_xticklabels('')
231242
ax.set_yticklabels('')
@@ -239,7 +250,7 @@ def example_plot(ax, fontsize=12, nodec=False):
239250

240251
fig, axs = plt.subplots(2, 2, constrained_layout=True)
241252
for ax in axs.flatten():
242-
pc = ax.pcolormesh(arr, rasterized=True)
253+
pc = ax.pcolormesh(arr, **pc_kwargs)
243254
fig.colorbar(im, ax=ax, shrink=0.6, pad=0.05)
244255
ax.set_xticklabels('')
245256
ax.set_yticklabels('')
@@ -349,7 +360,7 @@ def docomplicated(suptitle=None):
349360
axs = []
350361
for gs in gsr:
351362
ax = fig.add_subplot(gs)
352-
pcm = ax.pcolormesh(arr, rasterized=True)
363+
pcm = ax.pcolormesh(arr, **pc_kwargs)
353364
ax.set_xlabel('x-label')
354365
ax.set_ylabel('y-label')
355366
ax.set_title('title')
@@ -620,9 +631,9 @@ def docomplicated(suptitle=None):
620631
# colorbar is associated wiht a gridspec.
621632

622633
fig, ax = plt.subplots(1, 2, constrained_layout=True)
623-
im = ax[0].pcolormesh(arr, rasterized=True)
634+
im = ax[0].pcolormesh(arr, **pc_kwargs)
624635
fig.colorbar(im, ax=ax[0], shrink=0.6)
625-
im = ax[1].pcolormesh(arr, rasterized=True)
636+
im = ax[1].pcolormesh(arr, **pc_kwargs)
626637
plot_children(fig, fig._layoutbox, printit=False)
627638

628639
#######################################################################
@@ -637,7 +648,7 @@ def docomplicated(suptitle=None):
637648

638649
fig, ax = plt.subplots(2, 2, constrained_layout=True)
639650
for a in ax.flatten():
640-
im = a.pcolormesh(arr, rasterized=True)
651+
im = a.pcolormesh(arr, **pc_kwargs)
641652
fig.colorbar(im, ax=ax, shrink=0.6)
642653
plot_children(fig, fig._layoutbox, printit=False)
643654

@@ -664,11 +675,11 @@ def docomplicated(suptitle=None):
664675
fig = plt.figure(constrained_layout=True)
665676
gs = gridspec.GridSpec(2, 2, figure=fig)
666677
ax = fig.add_subplot(gs[:, 0])
667-
im = ax.pcolormesh(arr, rasterized=True)
678+
im = ax.pcolormesh(arr, **pc_kwargs)
668679
ax = fig.add_subplot(gs[0, 1])
669-
im = ax.pcolormesh(arr, rasterized=True)
680+
im = ax.pcolormesh(arr, **pc_kwargs)
670681
ax = fig.add_subplot(gs[1, 1])
671-
im = ax.pcolormesh(arr, rasterized=True)
682+
im = ax.pcolormesh(arr, **pc_kwargs)
672683
plot_children(fig, fig._layoutbox, printit=False)
673684

674685
#######################################################################
@@ -681,13 +692,13 @@ def docomplicated(suptitle=None):
681692
height_ratios=[1., 0.5, 1.5],
682693
width_ratios=[1.2, 0.8])
683694
ax = fig.add_subplot(gs[:2, 0])
684-
im = ax.pcolormesh(arr, rasterized=True)
695+
im = ax.pcolormesh(arr, **pc_kwargs)
685696
ax = fig.add_subplot(gs[2, 0])
686-
im = ax.pcolormesh(arr, rasterized=True)
697+
im = ax.pcolormesh(arr, **pc_kwargs)
687698
ax = fig.add_subplot(gs[0, 1])
688-
im = ax.pcolormesh(arr, rasterized=True)
699+
im = ax.pcolormesh(arr, **pc_kwargs)
689700
ax = fig.add_subplot(gs[1:, 1])
690-
im = ax.pcolormesh(arr, rasterized=True)
701+
im = ax.pcolormesh(arr, **pc_kwargs)
691702
plot_children(fig, fig._layoutbox, printit=False)
692703

693704
########################################################################
@@ -705,9 +716,9 @@ def docomplicated(suptitle=None):
705716
fig = plt.figure(constrained_layout=True)
706717
gs = gridspec.GridSpec(1, 3, figure=fig)
707718
ax = fig.add_subplot(gs[0])
708-
im = ax.pcolormesh(arr, rasterized=True)
719+
im = ax.pcolormesh(arr, **pc_kwargs)
709720
ax = fig.add_subplot(gs[-1])
710-
im = ax.pcolormesh(arr, rasterized=True)
721+
im = ax.pcolormesh(arr, **pc_kwargs)
711722
plot_children(fig, fig._layoutbox, printit=False)
712723
plt.show()
713724

2.2.2/_downloads/custom_projection.ipynb

Lines changed: 54 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)