Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/2dplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@
ax.pcolormesh(data, cmap="magma", colorbar="b")
ax = fig.subplot(gs[1], title="Logarithmic normalizer with norm='log'")
ax.pcolormesh(data, cmap="magma", norm="log", colorbar="b")
fig.show()


# %% [raw] raw_mimetype="text/restructuredtext"
Expand Down Expand Up @@ -431,6 +432,7 @@
ax.colorbar(m, loc="b")
ax.format(title=f"{mode.title()}-skewed + {fair} scaling")
i += 1
fig.show()

# %% [raw] raw_mimetype="text/restructuredtext"
# .. _ug_discrete:
Expand Down Expand Up @@ -531,6 +533,7 @@
colorbar="b",
colorbar_kw={"locator": 180},
)
fig.show()

# %% [raw] raw_mimetype="text/restructuredtext" tags=[]
# .. _ug_autonorm:
Expand Down
5 changes: 5 additions & 0 deletions docs/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
# fig = uplt.figure(suptitle='Single subplot') # equivalent to above
# ax = fig.subplot(xlabel='x axis', ylabel='y axis')
ax.plot(data, lw=2)
fig.show()


# %% [raw] raw_mimetype="text/restructuredtext"
Expand Down Expand Up @@ -184,6 +185,7 @@
ylabel="ylabel",
)
axs[2].plot(data, lw=2)
fig.show()
# fig.save('~/example2.png') # save the figure
# fig.savefig('~/example2.png') # alternative

Expand Down Expand Up @@ -301,6 +303,7 @@
axs[1, :1].format(fc="sky blue")
axs[-1, -1].format(fc="gray4", grid=False)
axs[0].plot((state.rand(50, 10) - 0.5).cumsum(axis=0), cycle="Grays_r", lw=2)
fig.show()


# %% [raw] raw_mimetype="text/restructuredtext"
Expand Down Expand Up @@ -361,6 +364,7 @@
suptitle="Quick plotting demo",
)
fig.colorbar(m, loc="b", label="label")
fig.show()


# %% [raw] raw_mimetype="text/restructuredtext"
Expand Down Expand Up @@ -565,3 +569,4 @@
for ax, style in zip(axs, styles):
ax.format(style=style, xlabel="xlabel", ylabel="ylabel", title=style)
ax.plot(data, linewidth=3)
fig.show()
14 changes: 13 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

# Import statements
import datetime
import logging
import os
import re
import subprocess
Expand Down Expand Up @@ -78,10 +79,17 @@ def __getattr__(self, name):
except Exception:
pass

# Silence font discovery warnings like "findfont: Font family ..."
for _logger_name in ("matplotlib", "matplotlib.font_manager"):
_logger = logging.getLogger(_logger_name)
_logger.setLevel(logging.ERROR)
_logger.propagate = False

# Suppress deprecated rc key warnings from local configs during docs builds.
try:
from ultraplot.internals.warnings import UltraPlotWarning

warnings.filterwarnings("ignore")
warnings.filterwarnings(
"ignore",
category=UltraPlotWarning,
Expand All @@ -103,6 +111,10 @@ def _reset_ultraplot(gallery_conf, fname):
import ultraplot as uplt
except Exception:
return
for _logger_name in ("matplotlib", "matplotlib.font_manager"):
_logger = logging.getLogger(_logger_name)
_logger.setLevel(logging.ERROR)
_logger.propagate = False
uplt.rc.reset()


Expand Down Expand Up @@ -350,7 +362,7 @@ def _reset_ultraplot(gallery_conf, fname):
nbsphinx_execute = "auto"

# Suppress warnings in nbsphinx kernels without injecting visible cells.
os.environ.setdefault("PYTHONWARNINGS", "ignore::UserWarning")
os.environ["PYTHONWARNINGS"] = "ignore"

# Sphinx gallery configuration
sphinx_gallery_conf = {
Expand Down