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

Skip to content

Commit fb9ba07

Browse files
committed
Merge branch 'master' into wrapper-docs-on-methods
2 parents 6c86d3c + 6fdf978 commit fb9ba07

File tree

14 files changed

+168
-84
lines changed

14 files changed

+168
-84
lines changed

β€ŽCHANGELOG.rstβ€Ž

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ See :pr:`45`, :pr:`46`, and :pr:`50`.
1717

1818
ProPlot v0.5.0 (2020-##-##)
1919
===========================
20-
.. rubric:: Deprecated
21-
22-
- Rename `basemap_defaults` to `~proplot.projs.basemap_kwargs` and `cartopy_projs`
23-
to `~proplot.projs.cartopy_names` (:commit:`431a06ce`).
24-
2520
.. rubric:: Features
2621

2722
- Users can now use `~proplot.subplots.figure` with `~proplot.subplots.Figure.add_subplot`
@@ -43,19 +38,23 @@ ProPlot v0.5.0 (2020-##-##)
4338
stacks rather than getting inserted directly into
4439
the main `~proplot.subplots.GridSpec` (:pr:`50`).
4540

46-
ProPlot v0.4.0 (2020-##-##)
41+
ProPlot v0.4.0 (2020-01-07)
4742
===========================
4843
.. rubric:: Deprecated
4944

45+
46+
- Rename `basemap_defaults` to `~proplot.projs.basemap_kwargs` and `cartopy_projs`
47+
to `~proplot.projs.cartopy_names` (:commit:`431a06ce`).
5048
- Remove ``subplots.innerspace``, ``subplots.titlespace``,
5149
``subplots.xlabspace``, and ``subplots.ylabspace`` spacing arguments,
5250
automatically calculate default non-tight spacing using `~proplot.subplots._get_space`
5351
based on current tick lengths, label sizes, etc.
5452
- Remove redundant `~proplot.rctools.use_fonts`, use ``rcParams['sans-serif']``
5553
precedence instead (:pr:`95`).
56-
- `~proplot.axes.Axes.dualx` and `~proplot.axes.Axes.dualx` no longer accept "scale-spec" arguments.
54+
- `~proplot.axes.Axes.dualx` and `~proplot.axes.Axes.dualy` no longer accept "scale-spec" arguments.
5755
Must be a function, two functions, or an axis scale instance (:pr:`96`).
58-
- Remove `~proplot.axes.Axes` ``share[x|y]``, ``span[x|y]``, and ``align[x|y]`` kwargs (:pr:`99`).
56+
- Remove `~proplot.axes.Axes` ``share[x|y]``, ``span[x|y]``, and ``align[x|y]`` kwargs
57+
(:pr:`99`).
5958
These settings are now always figure-wide.
6059
- Rename `~proplot.styletools.Cycle` ``samples`` to ``N``, rename
6160
`~proplot.styletools.show_colors` ``nbreak`` to ``nhues`` (:pr:`98`).
@@ -64,15 +63,18 @@ ProPlot v0.4.0 (2020-##-##)
6463

6564
- Add `~proplot.styletools.LinearSegmentedColormap.from_file` static methods (:pr:`98`).
6665
You can now load files by passing a name to `~proplot.styletools.Colormap`.
67-
- Add Fira Math as DejaVu Sans-alternative (:pr:`95`). Has complete set of math characters.
68-
- Add TeX Gyre Heros as Helvetica-alternative (:pr:`95`). This is the new open-source default font.
66+
- Add TeX Gyre Heros as open source Helvetica-alternative; this is the new default font.
67+
Add Fira Math as DejaVu Sans-alternative; has complete set of math characters (:pr:`95`).
6968
- Add `xlinewidth`, `ylinewidth`, `xgridcolor`, `ygridcolor` keyword
7069
args to `~proplot.axes.XYAxes.format` (:pr:`95`).
7170
- Add getters and setters for various `~proplot.subplots.Figure` settings like ``share[x|y]``,
7271
``span[x|y]``, and ``align[x|y]`` (:pr:`99`).
7372
- Add `~proplot.subplots.Figure` ``fallback_to_cm`` kwarg. This is used by
7473
`~proplot.styletools.show_fonts` to show dummy glyphs to clearly illustrate when fonts are
7574
missing characters, but preserve graceful fallback for end user.
75+
- Improve `~proplot.projs.Proj` constructor function. It now accepts
76+
`~cartopy.crs.Projection` and `~mpl_toolkits.basemap.Basemap` instances, just like other
77+
constructor functions, and returns only the projection instance (:pr:`92`).
7678
- `~proplot.rctools.rc` `~proplot.rctools.rc_configurator.__getitem__` always
7779
returns the setting. To get context block-restricted settings, you must explicitly pass
7880
``context=True`` to `~proplot.rctools.rc_configurator.get`, `~proplot.rctools.rc_configurator.fill`,
@@ -87,7 +89,7 @@ ProPlot v0.4.0 (2020-##-##)
8789

8890
.. rubric:: Documentation
8991

90-
- Imperative mood for docstring summaries (:pr:`92`).
92+
- Use the imperative mood for docstring summaries (:pr:`92`).
9193
- Fix `~proplot.styletools.show_cycles` bug (:pr:`90`) and show cycles using colorbars
9294
rather than lines (:pr:`98`).
9395

@@ -97,7 +99,9 @@ ProPlot v0.4.0 (2020-##-##)
9799
with a default ``.proplotrc`` file, change the auto-generated user ``.proplotrc``
98100
(:pr:`91`).
99101
- Remove useless `panel_kw` keyword arg from `~proplot.wrappers.legend_wrapper` and
100-
`~proplot.wrappers.colorbar_wrapper` (:pr:`91`).
102+
`~proplot.wrappers.colorbar_wrapper` (:pr:`91`). Remove `wflush`, `hflush`,
103+
and `flush` keyword args from `~proplot.subplots.subplots` that should have been
104+
removed long ago.
101105

102106
ProPlot v0.3.1 (2019-12-16)
103107
===========================

β€Ždocs/basics.ipynbβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
"# Update global settings in several different ways\n",
151151
"plot.rc.cycle = 'colorblind'\n",
152152
"plot.rc.color = 'gray6'\n",
153-
"plot.rc.update({'fontname': 'DejaVu Sans'})\n",
153+
"plot.rc.update({'fontname': 'Noto Sans'})\n",
154154
"plot.rc['figure.facecolor'] = 'gray3'\n",
155155
"plot.rc.axesfacecolor = 'gray4'\n",
156156
"\n",

β€Ždocs/colorbars_legends.ipynbβ€Ž

Lines changed: 46 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
"source": [
121121
"import proplot as plot\n",
122122
"import numpy as np\n",
123-
"f, axs = plot.subplots(ncols=3, nrows=3, axwidth=1.2)\n",
123+
"f, axs = plot.subplots(ncols=3, nrows=3, axwidth=1.4)\n",
124124
"state = np.random.RandomState(51423)\n",
125125
"m = axs.pcolormesh(\n",
126126
" state.rand(20, 20), cmap='grays',\n",
@@ -145,7 +145,7 @@
145145
"import proplot as plot\n",
146146
"import numpy as np\n",
147147
"f, axs = plot.subplots(\n",
148-
" ncols=2, nrows=2, axwidth=1.3,\n",
148+
" ncols=2, nrows=2, axwidth=1.7,\n",
149149
" share=0, wspace=0.3, order='F'\n",
150150
")\n",
151151
"\n",
@@ -164,8 +164,10 @@
164164
"f.colorbar(m[0], label='colorbar label', loc='l')\n",
165165
"f.legend(hs, ncols=2, center=True, frame=False, loc='b', col=2)\n",
166166
"f.legend(hs, ncols=1, label='legend label', frame=False, loc='r')\n",
167-
"axs.format(suptitle='Figure colorbars and legends demo',\n",
168-
" abc=True, abcloc='ul', abcstyle='A')\n",
167+
"axs.format(\n",
168+
" suptitle='Figure colorbars and legends demo',\n",
169+
" abc=True, abcloc='ul', abcstyle='A'\n",
170+
")\n",
169171
"for ax, title in zip(axs, ['2D dataset #1', '2D dataset #2', 'Line set #1', 'Line set #2']):\n",
170172
" ax.format(xlabel='xlabel', title=title)"
171173
]
@@ -196,29 +198,41 @@
196198
"source": [
197199
"import proplot as plot\n",
198200
"import numpy as np\n",
199-
"f, axs = plot.subplots(share=0, ncols=2)\n",
201+
"f, axs = plot.subplots(share=0, ncols=2, axwidth=2)\n",
200202
"\n",
201203
"# Colorbars from lines\n",
202204
"ax = axs[0]\n",
203205
"state = np.random.RandomState(51423)\n",
204206
"data = 1 + (state.rand(12, 10) - 0.45).cumsum(axis=0)\n",
205207
"cycle = plot.Cycle('algae')\n",
206-
"hs = ax.plot(data, lw=4, cycle=cycle, colorbar='lr', colorbar_kw={\n",
207-
" 'length': '8em', 'label': 'from lines'})\n",
208-
"ax.colorbar(hs, loc='t', values=2*np.linspace(0.5, 9.5, 10),\n",
209-
" label='from lines', length=0.7, ticks=2)\n",
208+
"hs = ax.plot(\n",
209+
" data, lw=4, cycle=cycle, colorbar='lr',\n",
210+
" colorbar_kw={'length': '8em', 'label': 'from lines'}\n",
211+
")\n",
212+
"ax.colorbar(\n",
213+
" hs, loc='t', values=2*np.linspace(0.5, 9.5, 10),\n",
214+
" label='from lines', length=0.7, ticks=2\n",
215+
")\n",
210216
"\n",
211217
"# Colorbars from a mappable\n",
212218
"ax = axs[1]\n",
213-
"m = ax.contourf(data.T, extend='both', cmap='algae',\n",
214-
" levels=plot.arange(0, 3, 0.5))\n",
215-
"f.colorbar(m, length=1, loc='r', label='inside ticks',\n",
216-
" tickloc='left')\n",
217-
"ax.colorbar(m, loc='ul', length=1, tickminor=True, drawedges=True, extendrect=True,\n",
218-
" label='inset colorbar', labelcolor='gray7', labelweight='bold',\n",
219-
" linewidth=1, edgecolor='gray7', ticklabelcolor='gray7', alpha=0.5)\n",
220-
"axs.format(suptitle='Colorbar formatting demo',\n",
221-
" xlabel='xlabel', ylabel='ylabel', top=False)"
219+
"m = ax.contourf(\n",
220+
" data.T, extend='both', cmap='algae',\n",
221+
" levels=plot.arange(0, 3, 0.5)\n",
222+
")\n",
223+
"f.colorbar(\n",
224+
" m, length=1, loc='r', label='inside ticks',\n",
225+
" tickloc='left'\n",
226+
")\n",
227+
"ax.colorbar(\n",
228+
" m, loc='ul', length=1, tickminor=True, drawedges=True,\n",
229+
" label='inset colorbar', labelcolor='gray7', labelweight='bold',\n",
230+
" linewidth=1, edgecolor='gray7', ticklabelcolor='gray7', alpha=0.5\n",
231+
")\n",
232+
"axs.format(\n",
233+
" suptitle='Colorbar formatting demo',\n",
234+
" xlabel='xlabel', ylabel='ylabel', top=False\n",
235+
")"
222236
]
223237
},
224238
{
@@ -249,24 +263,30 @@
249263
"import numpy as np\n",
250264
"plot.rc.cycle = 'contrast'\n",
251265
"labels = ['a', 'bb', 'ccc', 'dddd', 'eeeee']\n",
252-
"f, axs = plot.subplots(ncols=2, span=False, share=1)\n",
266+
"f, axs = plot.subplots(ncols=2, span=False, share=1, axwidth=2)\n",
253267
"hs1, hs2 = [], []\n",
254268
"\n",
255269
"# On-the-fly legends\n",
256270
"state = np.random.RandomState(51423)\n",
257271
"for i, label in enumerate(labels):\n",
258-
" data = (state.rand(20)-0.45).cumsum(axis=0)\n",
259-
" h1 = axs[0].plot(data, lw=4, label=label, legend='ul',\n",
260-
" legend_kw={'order': 'F', 'title': 'column major'}) # add to legend in upper left\n",
272+
" data = (state.rand(20) - 0.45).cumsum(axis=0)\n",
273+
" h1 = axs[0].plot(\n",
274+
" data, lw=4, label=label, legend='ul',\n",
275+
" legend_kw={'order': 'F', 'title': 'column major'}\n",
276+
" )\n",
261277
" hs1.extend(h1)\n",
262-
" h2 = axs[1].plot(data, lw=4, label=label, legend='r', cycle='floral',\n",
263-
" legend_kw={'ncols': 1, 'frame': False, 'title': 'no frame'}) # add to legend in right panel\n",
278+
" h2 = axs[1].plot(\n",
279+
" data, lw=4, label=label, legend='r', cycle='floral',\n",
280+
" legend_kw={'ncols': 1, 'frame': False, 'title': 'no frame'}\n",
281+
" )\n",
264282
" hs2.extend(h2)\n",
265283
" \n",
266284
"# Outer legends\n",
267285
"ax = axs[0]\n",
268-
"ax.legend(hs1, loc='b', ncols=3, linewidth=2, title='row major', order='C',\n",
269-
" edgecolor='gray4', facecolor='gray2')\n",
286+
"ax.legend(\n",
287+
" hs1, loc='b', ncols=3, linewidth=2,title='row major', order='C',\n",
288+
" facecolor='gray2'\n",
289+
")\n",
270290
"ax = axs[1]\n",
271291
"ax.legend(hs2, loc='b', ncols=3, center=True, title='centered rows')\n",
272292
"axs.format(xlabel='xlabel', ylabel='ylabel', suptitle='Legend formatting demo')"

β€Ždocs/colormaps.ipynbβ€Ž

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,10 @@
267267
"source": [
268268
"import proplot as plot\n",
269269
"import numpy as np\n",
270-
"f, axs = plot.subplots([[0, 1, 1, 2, 2, 3, 3, 0], [4, 4, 5, 5, 6, 6, 7, 7]],\n",
271-
" axwidth=1.7, span=False)\n",
270+
"f, axs = plot.subplots(\n",
271+
" [[1, 1, 2, 2, 3, 3], [0, 4, 4, 5, 5, 0], [0, 6, 6, 7, 7, 0]],\n",
272+
" axwidth=1.7, span=False\n",
273+
")\n",
272274
"state = np.random.RandomState(51423)\n",
273275
"data = state.rand(40, 40).cumsum(axis=0) - 12\n",
274276
"\n",
@@ -281,8 +283,10 @@
281283
" title, cmap_kw = f'left={coord}', {'left': coord}\n",
282284
" else:\n",
283285
" title, cmap_kw = f'right={coord}', {'right': coord}\n",
284-
" ax.pcolormesh(data, cmap=cmap, cmap_kw=cmap_kw,\n",
285-
" colorbar='b', colorbar_kw={'locator': 'null'})\n",
286+
" ax.pcolormesh(\n",
287+
" data, cmap=cmap, cmap_kw=cmap_kw,\n",
288+
" colorbar='b', colorbar_kw={'locator': 'null'}\n",
289+
" )\n",
286290
" ax.format(xlabel='x axis', ylabel='y axis', title=title)\n",
287291
" \n",
288292
"# Cutting central colors\n",

β€Žproplot/cycles/538.hexβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
# From the 538 matplotlib stylesheet
12
'#008fd5', '#fc4f30', '#e5ae38', '#6d904f', '#8b8b8b', '#810f7c',

β€Žproplot/cycles/Qual1.rgbβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Unknown source
12
91,190,148
23
145,190,100
34
229,207,108

β€Žproplot/cycles/Qual2.rgbβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Unknown source
12
91,190,148
23
182,227,209
34
145,190,100

β€Žproplot/cycles/bmh.hexβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# From bmh stylesheet
2+
'#348ABD', '#A60628', '#7A68A6', '#467821', '#D55E00', '#CC79A7', '#56B4E9', '#009E73', '#F0E442', '#0072B2'

β€Žproplot/cycles/classic.hexβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Matplotlib classic 'bgrcmyk' style
2+
'#0000ff', '#008000', '#ff0000', '#00bfbf', '#bf00bf', '#bfbf00', '#000000'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
# Seaborn and proplot default style
12
'#0072B2', '#D55E00', '#009E73', '#CC79A7', '#F0E442', '#56B4E9',

0 commit comments

Comments
Β (0)