Skip to content

Commit b243afe

Browse files
authored
Merge pull request #8 from cvanelteren/main
replaced pplt -> uplt
2 parents 656a746 + 0c4bc1f commit b243afe

Some content is hidden

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

42 files changed

+630
-630
lines changed

WHATSNEW.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ Documentation
364364
-------------
365365

366366
* Populate docs with examples of passing ``format`` arguments to figure and axes
367-
instantiation commands (e.g. ``pplt.figure``, ``fig.subplot``) (:commit:`803a889f`).
367+
instantiation commands (e.g. ``uplt.figure``, ``fig.subplot``) (:commit:`803a889f`).
368368
* Improve website colormap and cycle table rendering time by rasterizing colorbar
369369
data and add `rasterize` as optional keyword arg (:commit:`1a875fc2`).
370370

@@ -536,7 +536,7 @@ Features
536536
--------
537537

538538
* Permit passing ``format`` keywords when instantiating figures and axes
539-
(:commit:`ae98378d`). For example: ``pplt.figure(suptitle='Super title')``
539+
(:commit:`ae98378d`). For example: ``uplt.figure(suptitle='Super title')``
540540
or ``fig.add_subplot(111, xcolor='gray', xticks=10)`` .
541541
* Add back `color` as a valid `ultraplot.axes.CartesianAxes.format` keyword
542542
arg for consistency with `xcolor` and `ycolor` (:commit:`ecb6fa3f`).
@@ -908,7 +908,7 @@ Features
908908
* Dynamically add classes that are "registered" by contructor functions
909909
to the top-level namespace (:commit:`4382a1b1`). This is consistent with
910910
behavior of importing custom-ultraplot tickers, norms, etc. to top-level namespace.
911-
Now e.g. ``pplt.MultipleLocator`` or ``pplt.LogNorm`` are allowed.
911+
Now e.g. ``uplt.MultipleLocator`` or ``uplt.LogNorm`` are allowed.
912912
* Allow creating subplots with `~ultraplot.ui.figure` and either (1) subsequently
913913
calling `~ultraplot.figure.Fiugure.subplots` or (2) passing integers or subplot specs
914914
generated by `~ultraplot.gridspec.GridSpec` to `~ultraplot.figure.Figure.add_subplot`
@@ -951,7 +951,7 @@ Features
951951
geometry by looking up subplotspec indices (:commit:`51967ce3`). Previously 2d
952952
indexing of ``SubplotGrid`` with complex geometry would just return a wrong result.
953953
* Issue warning message when users try ``fig.subplots_adjust()`` or
954-
``pplt.figure(subplotpars=SubplotParams)`` and auto-disable and warn when
954+
``uplt.figure(subplotpars=SubplotParams)`` and auto-disable and warn when
955955
matplotlib "tight layout" rc settings are toggled (:commit:`51967ce3`).
956956
* Add nicer string representations of figures, gridspecs, subplotspecs, and
957957
axes clearly showing the geometry and layout (:commit:`51967ce3`, :commit:`6382cf91`).
@@ -1013,7 +1013,7 @@ Features
10131013
* Make `~ultraplot.config.rc_ultraplot` and `~ultraplot.config.rc_matplotlib` containers
10141014
of ultraplot/matplotlib settings part of the public API (:commit:`a50d5264`).
10151015
* Allow conversion of numeric inputs with `~ultraplot.utils.units` using e.g.
1016-
``pplt.units(num, 'in', 'cm')`` (:commit:`88f3dc88`).
1016+
``uplt.units(num, 'in', 'cm')`` (:commit:`88f3dc88`).
10171017
* Add more intuitive :rcraw:`grid.labelpad` and :rcraw:`tick.labelpad`
10181018
as aliases for :rcraw:`grid.pad` and :rcraw:`tick.pad` (:commit:`a50d5264`).
10191019
* Add `~ultraplot.axes.PlotAxes.line` and `~ultraplot.axes.PlotAxes.linex` command
@@ -1484,7 +1484,7 @@ Internals
14841484
Documentation
14851485
-------------
14861486

1487-
* Finally use ``pplt`` as the recommended abbreviation: ``import ultraplot as pplt``.
1487+
* Finally use ``uplt`` as the recommended abbreviation: ``import ultraplot as uplt``.
14881488
* Major clean up of "Why ultraplot?" page and user guide pages.
14891489
* Fix incomplete ``cmap.from_file`` docstrings (:commit:`54f1bc7c`).
14901490
* Rename "Changelog" to "What's New?" and list all contributors in "About the Authors".

docs/1dplots.py

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,16 @@
6363
# the :rcraw:`cmap.inbounds` setting and the :ref:`user guide <ug_2dstd>`).
6464

6565
# %%
66-
import ultraplot as pplt
66+
import ultraplot as uplt
6767
import numpy as np
6868

6969
N = 5
7070
state = np.random.RandomState(51423)
71-
with pplt.rc.context({"axes.prop_cycle": pplt.Cycle("Grays", N=N, left=0.3)}):
71+
with uplt.rc.context({"axes.prop_cycle": uplt.Cycle("Grays", N=N, left=0.3)}):
7272
# Sample data
7373
x = np.linspace(-5, 5, N)
7474
y = state.rand(N, 5)
75-
fig = pplt.figure(share=False, suptitle="Standardized input demonstration")
75+
fig = uplt.figure(share=False, suptitle="Standardized input demonstration")
7676

7777
# Plot by passing both x and y coordinates
7878
ax = fig.subplot(121, title="Manual x coordinates")
@@ -92,26 +92,26 @@
9292
fig.format(xlabel="xlabel", ylabel="ylabel")
9393

9494
# %%
95-
import ultraplot as pplt
95+
import ultraplot as uplt
9696
import numpy as np
9797

9898
# Sample data
99-
cycle = pplt.Cycle("davos", right=0.8)
99+
cycle = uplt.Cycle("davos", right=0.8)
100100
state = np.random.RandomState(51423)
101101
N, M = 400, 20
102102
xmax = 20
103103
x = np.linspace(0, 100, N)
104104
y = 100 * (state.rand(N, M) - 0.42).cumsum(axis=0)
105105

106106
# Plot the data
107-
fig = pplt.figure(refwidth=2.2, share=False)
107+
fig = uplt.figure(refwidth=2.2, share=False)
108108
axs = fig.subplots([[0, 1, 1, 0], [2, 2, 3, 3]], wratios=(2, 1, 1, 2))
109109
axs[0].axvspan(
110110
0,
111111
xmax,
112112
zorder=3,
113113
edgecolor="red",
114-
facecolor=pplt.set_alpha("red", 0.2),
114+
facecolor=uplt.set_alpha("red", 0.2),
115115
)
116116
for i, ax in enumerate(axs):
117117
inbounds = i == 1
@@ -191,17 +191,17 @@
191191
df.columns.name = "category"
192192

193193
# %%
194-
import ultraplot as pplt
194+
import ultraplot as uplt
195195

196-
fig = pplt.figure(share=False, suptitle="Automatic subplot formatting")
196+
fig = uplt.figure(share=False, suptitle="Automatic subplot formatting")
197197

198198
# Plot DataArray
199-
cycle = pplt.Cycle("dark blue", space="hpl", N=da.shape[1])
199+
cycle = uplt.Cycle("dark blue", space="hpl", N=da.shape[1])
200200
ax = fig.subplot(121)
201201
ax.scatter(da, cycle=cycle, lw=3, colorbar="t", colorbar_kw={"locator": 20})
202202

203203
# Plot Dataframe
204-
cycle = pplt.Cycle("dark green", space="hpl", N=df.shape[1])
204+
cycle = uplt.Cycle("dark green", space="hpl", N=df.shape[1])
205205
ax = fig.subplot(122)
206206
ax.plot(df, cycle=cycle, lw=3, legend="t", legend_kw={"frame": False})
207207

@@ -230,7 +230,7 @@
230230
# <https://matplotlib.org/stable/tutorials/intermediate/color_cycle.html#sphx-glr-tutorials-intermediate-color-cycle-py>`__.
231231

232232
# %%
233-
import ultraplot as pplt
233+
import ultraplot as uplt
234234
import numpy as np
235235

236236
# Sample data
@@ -241,9 +241,9 @@
241241
data1 += state.rand(M, N)
242242
data2 += state.rand(M, N)
243243

244-
with pplt.rc.context({"lines.linewidth": 3}):
244+
with uplt.rc.context({"lines.linewidth": 3}):
245245
# Use property cycle for columns of 2D input data
246-
fig = pplt.figure(share=False)
246+
fig = uplt.figure(share=False)
247247
ax = fig.subplot(121, title="Single plot call")
248248
ax.plot(
249249
2 * data1 + data2,
@@ -283,12 +283,12 @@
283283
# "positive" lines using ``negpos=True`` (see :ref:`below <ug_negpos>` for details).
284284

285285
# %%
286-
import ultraplot as pplt
286+
import ultraplot as uplt
287287
import numpy as np
288288

289289
state = np.random.RandomState(51423)
290-
gs = pplt.GridSpec(nrows=3, ncols=2)
291-
fig = pplt.figure(refwidth=2.2, span=False, share="labels")
290+
gs = uplt.GridSpec(nrows=3, ncols=2)
291+
fig = uplt.figure(refwidth=2.2, span=False, share="labels")
292292

293293
# Vertical vs. horizontal
294294
data = (state.rand(10, 5) - 0.5).cumsum(axis=0)
@@ -359,7 +359,7 @@
359359
# calls `~ultraplot.axes.Axes.scatter` internally.
360360

361361
# %%
362-
import ultraplot as pplt
362+
import ultraplot as uplt
363363
import numpy as np
364364
import pandas as pd
365365

@@ -370,8 +370,8 @@
370370
data = pd.DataFrame(data, columns=pd.Index(["a", "b", "c", "d"], name="label"))
371371

372372
# Figure
373-
gs = pplt.GridSpec(ncols=2, nrows=2)
374-
fig = pplt.figure(refwidth=2.2, share="labels", span=False)
373+
gs = uplt.GridSpec(ncols=2, nrows=2)
374+
fig = uplt.figure(refwidth=2.2, share="labels", span=False)
375375

376376
# Vertical vs. horizontal
377377
ax = fig.subplot(gs[0], title="Dependent x-axis")
@@ -423,12 +423,12 @@
423423
# plot with a colorbar indicating the parametric coordinate.
424424

425425
# %%
426-
import ultraplot as pplt
426+
import ultraplot as uplt
427427
import numpy as np
428428
import pandas as pd
429429

430-
gs = pplt.GridSpec(ncols=2, wratios=(2, 1))
431-
fig = pplt.figure(figwidth="16cm", refaspect=(2, 1), share=False)
430+
gs = uplt.GridSpec(ncols=2, wratios=(2, 1))
431+
fig = uplt.figure(figwidth="16cm", refaspect=(2, 1), share=False)
432432
fig.format(suptitle="Parametric plots demo")
433433
cmap = "IceFire"
434434

@@ -518,7 +518,7 @@
518518
# `~ultraplot.axes.Axes.bar` or `~ultraplot.axes.Axes.barh` internally.
519519

520520
# %%
521-
import ultraplot as pplt
521+
import ultraplot as uplt
522522
import numpy as np
523523
import pandas as pd
524524

@@ -532,10 +532,10 @@
532532
)
533533

534534
# Figure
535-
pplt.rc.abc = "a."
536-
pplt.rc.titleloc = "l"
537-
gs = pplt.GridSpec(nrows=2, hratios=(3, 2))
538-
fig = pplt.figure(refaspect=2, refwidth=4.8, share=False)
535+
uplt.rc.abc = "a."
536+
uplt.rc.titleloc = "l"
537+
gs = uplt.GridSpec(nrows=2, hratios=(3, 2))
538+
fig = uplt.figure(refaspect=2, refwidth=4.8, share=False)
539539

540540
# Side-by-side bars
541541
ax = fig.subplot(gs[0], title="Side-by-side")
@@ -554,10 +554,10 @@
554554
stack=True,
555555
)
556556
fig.format(grid=False, suptitle="Bar plot demo")
557-
pplt.rc.reset()
557+
uplt.rc.reset()
558558

559559
# %%
560-
import ultraplot as pplt
560+
import ultraplot as uplt
561561
import numpy as np
562562

563563
# Sample data
@@ -566,9 +566,9 @@
566566
cycle = ("gray3", "gray5", "gray7")
567567

568568
# Figure
569-
pplt.rc.abc = "a."
570-
pplt.rc.titleloc = "l"
571-
fig = pplt.figure(refwidth=2.3, share=False)
569+
uplt.rc.abc = "a."
570+
uplt.rc.titleloc = "l"
571+
fig = uplt.figure(refwidth=2.3, share=False)
572572

573573
# Overlaid area patches
574574
ax = fig.subplot(121, title="Fill between columns")
@@ -594,7 +594,7 @@
594594
legend_kw={"center": True, "ncols": 2, "labels": ["z", "y", "qqqq"]},
595595
)
596596
fig.format(grid=False, xlabel="xlabel", ylabel="ylabel", suptitle="Area plot demo")
597-
pplt.rc.reset()
597+
uplt.rc.reset()
598598

599599
# %% [raw] raw_mimetype="text/restructuredtext"
600600
# .. _ug_negpos:
@@ -613,17 +613,17 @@
613613
# ``negcolor=color`` and ``poscolor=color`` to the `~ultraplot.axes.PlotAxes` commands.
614614

615615
# %%
616-
import ultraplot as pplt
616+
import ultraplot as uplt
617617
import numpy as np
618618

619619
# Sample data
620620
state = np.random.RandomState(51423)
621621
data = 4 * (state.rand(40) - 0.5)
622622

623623
# Figure
624-
pplt.rc.abc = "a."
625-
pplt.rc.titleloc = "l"
626-
fig, axs = pplt.subplots(nrows=3, refaspect=2, figwidth=5)
624+
uplt.rc.abc = "a."
625+
uplt.rc.titleloc = "l"
626+
fig, axs = uplt.subplots(nrows=3, refaspect=2, figwidth=5)
627627
axs.format(
628628
xmargin=0,
629629
xlabel="xlabel",
@@ -650,4 +650,4 @@
650650
ax.format(title="Area plot")
651651

652652
# Reset title styles changed above
653-
pplt.rc.reset()
653+
uplt.rc.reset()

0 commit comments

Comments
 (0)