proplot-dev / proplot

🎨 A succinct matplotlib wrapper for making beautiful, publication-quality graphics
https://proplot.readthedocs.io
MIT License
1.12k stars 102 forks source link

Context support #463

Closed cvanelteren closed 3 months ago

cvanelteren commented 3 months ago

Allows for using a temporary style on a plot. This builds on-wards from #459

image

import proplot as plt
import numpy as np

fig, ax = plt.subplots(ncols=3)
ax.imshow(np.random.rand(10, 10))
ax.format(xlabel="x")

with plt.context("poster", after_reset=True):
    fig, ax = plt.subplots()
    ax.imshow(np.random.rand(10, 10))
    ax.format(xlabel="x")

fig, ax = plt.subplots()
ax.imshow(np.random.rand(10, 10))
ax.format(xlabel="x")
plt.show(block=1)
cvanelteren commented 3 months ago

Just saw that this is already implemented:

image