From daac600fa86e08480a809aa18252ebbf84c6f78b Mon Sep 17 00:00:00 2001 From: Brendt Wohlberg Date: Tue, 30 Jul 2024 16:18:52 -0600 Subject: [PATCH] Fix figure font size and line width --- docs/source/pyfigures/cylindgrad.py | 27 +++++++++-------- docs/source/pyfigures/polargrad.py | 14 +++++---- docs/source/pyfigures/spheregrad.py | 27 +++++++++-------- docs/source/pyfigures/xray_2d_geom.py | 42 +++++++++++++++------------ docs/source/pyfigures/xray_3d_ang.py | 2 +- 5 files changed, 62 insertions(+), 50 deletions(-) diff --git a/docs/source/pyfigures/cylindgrad.py b/docs/source/pyfigures/cylindgrad.py index 9b26220ac..d2d6f9cf2 100644 --- a/docs/source/pyfigures/cylindgrad.py +++ b/docs/source/pyfigures/cylindgrad.py @@ -26,21 +26,24 @@ fig = plot.plt.figure(figsize=(20, 6)) ax = fig.add_subplot(1, 3, 1, projection="3d") ax.quiver(g0, g1, g2, ang[0], ang[1], ang[2], colors=clr, length=0.9) -ax.set_title("Angular local coordinate axis") -ax.set_xlabel("$x$") -ax.set_ylabel("$y$") -ax.set_zlabel("$z$") +ax.set_title("Angular local coordinate axis", fontsize=18) +ax.set_xlabel("$x$", fontsize=15) +ax.set_ylabel("$y$", fontsize=15) +ax.set_zlabel("$z$", fontsize=15) +ax.tick_params(labelsize=15) ax = fig.add_subplot(1, 3, 2, projection="3d") ax.quiver(g0, g1, g2, rad[0], rad[1], rad[2], colors=clr, length=0.9) -ax.set_title("Radial local coordinate axis") -ax.set_xlabel("$x$") -ax.set_ylabel("$y$") -ax.set_zlabel("$z$") +ax.set_title("Radial local coordinate axis", fontsize=18) +ax.set_xlabel("$x$", fontsize=15) +ax.set_ylabel("$y$", fontsize=15) +ax.set_zlabel("$z$", fontsize=15) +ax.tick_params(labelsize=15) ax = fig.add_subplot(1, 3, 3, projection="3d") ax.quiver(g0, g1, g2, axi[0], axi[1], axi[2], colors=clr[0], length=0.9) -ax.set_title("Axial local coordinate axis") -ax.set_xlabel("$x$") -ax.set_ylabel("$y$") -ax.set_zlabel("$z$") +ax.set_title("Axial local coordinate axis", fontsize=18) +ax.set_xlabel("$x$", fontsize=15) +ax.set_ylabel("$y$", fontsize=15) +ax.set_zlabel("$z$", fontsize=15) +ax.tick_params(labelsize=15) fig.tight_layout() fig.show() diff --git a/docs/source/pyfigures/polargrad.py b/docs/source/pyfigures/polargrad.py index 23da202f2..a0a6b119a 100644 --- a/docs/source/pyfigures/polargrad.py +++ b/docs/source/pyfigures/polargrad.py @@ -20,15 +20,17 @@ fig, ax = plot.plt.subplots(nrows=1, ncols=2, figsize=(13, 6)) ax[0].quiver(g0, g1, ang[0], ang[1], clr) -ax[0].set_title("Angular local coordinate axis") -ax[0].set_xlabel("$x$") -ax[0].set_ylabel("$y$") +ax[0].set_title("Angular local coordinate axis", fontsize=16) +ax[0].set_xlabel("$x$", fontsize=14) +ax[0].set_ylabel("$y$", fontsize=14) +ax[0].tick_params(labelsize=14) ax[0].xaxis.set_ticks((-10, -5, 0, 5, 10)) ax[0].yaxis.set_ticks((-10, -5, 0, 5, 10)) ax[1].quiver(g0, g1, rad[0], rad[1], clr) -ax[1].set_title("Radial local coordinate axis") -ax[1].set_xlabel("$x$") -ax[1].set_ylabel("$y$") +ax[1].set_title("Radial local coordinate axis", fontsize=16) +ax[1].set_xlabel("$x$", fontsize=14) +ax[1].set_ylabel("$y$", fontsize=14) +ax[1].tick_params(labelsize=14) ax[1].xaxis.set_ticks((-10, -5, 0, 5, 10)) ax[1].yaxis.set_ticks((-10, -5, 0, 5, 10)) fig.tight_layout() diff --git a/docs/source/pyfigures/spheregrad.py b/docs/source/pyfigures/spheregrad.py index ea2149d92..2f5e8ffc8 100644 --- a/docs/source/pyfigures/spheregrad.py +++ b/docs/source/pyfigures/spheregrad.py @@ -27,21 +27,24 @@ fig = plot.plt.figure(figsize=(20, 6)) ax = fig.add_subplot(1, 3, 1, projection="3d") ax.quiver(g0, g1, g2, azi[0], azi[1], azi[2], colors=clr, length=0.9) -ax.set_title("Azimuthal local coordinate axis") -ax.set_xlabel("$x$") -ax.set_ylabel("$y$") -ax.set_zlabel("$z$") +ax.set_title("Azimuthal local coordinate axis", fontsize=18) +ax.set_xlabel("$x$", fontsize=15) +ax.set_ylabel("$y$", fontsize=15) +ax.set_zlabel("$z$", fontsize=15) +ax.tick_params(labelsize=15) ax = fig.add_subplot(1, 3, 2, projection="3d") ax.quiver(g0, g1, g2, pol[0], pol[1], pol[2], colors=clr, length=0.9) -ax.set_title("Polar local coordinate axis") -ax.set_xlabel("$x$") -ax.set_ylabel("$y$") -ax.set_zlabel("$z$") +ax.set_title("Polar local coordinate axis", fontsize=18) +ax.set_xlabel("$x$", fontsize=15) +ax.set_ylabel("$y$", fontsize=15) +ax.set_zlabel("$z$", fontsize=15) +ax.tick_params(labelsize=15) ax = fig.add_subplot(1, 3, 3, projection="3d") ax.quiver(g0, g1, g2, rad[0], rad[1], rad[2], colors=clr, length=0.9) -ax.set_title("Radial local coordinate axis") -ax.set_xlabel("$x$") -ax.set_ylabel("$y$") -ax.set_zlabel("$z$") +ax.set_title("Radial local coordinate axis", fontsize=18) +ax.set_xlabel("$x$", fontsize=15) +ax.set_ylabel("$y$", fontsize=15) +ax.set_zlabel("$z$", fontsize=15) +ax.tick_params(labelsize=15) fig.tight_layout() fig.show() diff --git a/docs/source/pyfigures/xray_2d_geom.py b/docs/source/pyfigures/xray_2d_geom.py index c1714851f..45cd7f554 100644 --- a/docs/source/pyfigures/xray_2d_geom.py +++ b/docs/source/pyfigures/xray_2d_geom.py @@ -1,8 +1,12 @@ import numpy as np +import matplotlib as mpl import matplotlib.patches as patches import matplotlib.pyplot as plt +mpl.rcParams["savefig.transparent"] = True + + c = 1.0 / np.sqrt(2.0) e = 1e-2 style = "Simple, tail_width=0.5, head_width=4, head_length=8" @@ -13,10 +17,10 @@ ax[n].set_ylim(-1.1, 1.1) ax[n].set_xticks(np.linspace(-1.0, 1.0, 5)) ax[n].set_yticks(np.linspace(-1.0, 1.0, 5)) - ax[n].tick_params(axis="x", labelsize=12) - ax[n].tick_params(axis="y", labelsize=12) - ax[n].set_xlabel("axis 1", fontsize=14) - ax[n].set_ylabel("axis 0", fontsize=14) + ax[n].tick_params(axis="x", labelsize=14) + ax[n].tick_params(axis="y", labelsize=14) + ax[n].set_xlabel("axis 1", fontsize=16) + ax[n].set_ylabel("axis 0", fontsize=16) # scico plist = [ @@ -31,30 +35,30 @@ arrowstyle=style, color="r", ), - patches.Arc((0.0, 0.0), 2.0, 2.0, theta1=180, theta2=-45.0, color="b", ls="dotted"), + patches.Arc((0.0, 0.0), 2.0, 2.0, theta1=180, theta2=-45.0, color="b", lw=2, ls="dotted"), patches.FancyArrowPatch((c - e, -c - e), (c + e, -c + e), arrowstyle=style, color="b"), ] for p in plist: ax[0].add_patch(p) -ax[0].text(-0.88, 0.02, r"$\theta=0$", color="r", fontsize=14) -ax[0].text(-3 * c / 4 - 0.01, -3 * c / 4 - 0.1, r"$\theta=\frac{\pi}{4}$", color="r", fontsize=14) -ax[0].text(0.03, -0.8, r"$\theta=\frac{\pi}{2}$", color="r", fontsize=14) -ax[0].set_title("scico", fontsize=14) +ax[0].text(-0.88, 0.02, r"$\theta=0$", color="r", fontsize=16) +ax[0].text(-3 * c / 4 - 0.01, -3 * c / 4 - 0.1, r"$\theta=\frac{\pi}{4}$", color="r", fontsize=16) +ax[0].text(0.03, -0.8, r"$\theta=\frac{\pi}{2}$", color="r", fontsize=16) +ax[0].set_title("scico", fontsize=18) # astra plist = [ patches.FancyArrowPatch((0.0, -1.0), (0.0, -0.5), arrowstyle=style, color="r"), patches.FancyArrowPatch((c, -c), (c / 2.0, -c / 2.0), arrowstyle=style, color="r"), patches.FancyArrowPatch((1.0, 0.0), (0.5, 0.0), arrowstyle=style, color="r"), - patches.Arc((0.0, 0.0), 2.0, 2.0, theta1=-90, theta2=45.0, color="b", ls="dotted"), + patches.Arc((0.0, 0.0), 2.0, 2.0, theta1=-90, theta2=45.0, color="b", lw=2, ls="dotted"), patches.FancyArrowPatch((c + e, c - e), (c - e, c + e), arrowstyle=style, color="b"), ] for p in plist: ax[1].add_patch(p) -ax[1].text(0.02, -0.75, r"$\theta=0$", color="r", fontsize=14) -ax[1].text(3 * c / 4 + 0.01, -3 * c / 4 + 0.01, r"$\theta=\frac{\pi}{4}$", color="r", fontsize=14) -ax[1].text(0.65, 0.05, r"$\theta=\frac{\pi}{2}$", color="r", fontsize=14) -ax[1].set_title("astra", fontsize=14) +ax[1].text(0.02, -0.75, r"$\theta=0$", color="r", fontsize=16) +ax[1].text(3 * c / 4 + 0.01, -3 * c / 4 + 0.01, r"$\theta=\frac{\pi}{4}$", color="r", fontsize=16) +ax[1].text(0.65, 0.05, r"$\theta=\frac{\pi}{2}$", color="r", fontsize=16) +ax[1].set_title("astra", fontsize=18) # svmbir plist = [ @@ -69,15 +73,15 @@ arrowstyle=style, color="r", ), - patches.Arc((0.0, 0.0), 2.0, 2.0, theta1=45, theta2=180, color="b", ls="dotted"), + patches.Arc((0.0, 0.0), 2.0, 2.0, theta1=45, theta2=180, color="b", lw=2, ls="dotted"), patches.FancyArrowPatch((c - e, c + e), (c + e, c - e), arrowstyle=style, color="b"), ] for p in plist: ax[2].add_patch(p) -ax[2].text(-0.88, 0.02, r"$\theta=0$", color="r", fontsize=14) -ax[2].text(-3 * c / 4 + 0.01, 3 * c / 4 + 0.01, r"$\theta=\frac{\pi}{4}$", color="r", fontsize=14) -ax[2].text(0.03, 0.75, r"$\theta=\frac{\pi}{2}$", color="r", fontsize=14) -ax[2].set_title("svmbir", fontsize=14) +ax[2].text(-0.88, 0.02, r"$\theta=0$", color="r", fontsize=16) +ax[2].text(-3 * c / 4 + 0.01, 3 * c / 4 + 0.01, r"$\theta=\frac{\pi}{4}$", color="r", fontsize=16) +ax[2].text(0.03, 0.75, r"$\theta=\frac{\pi}{2}$", color="r", fontsize=16) +ax[2].set_title("svmbir", fontsize=18) fig.tight_layout() fig.show() diff --git a/docs/source/pyfigures/xray_3d_ang.py b/docs/source/pyfigures/xray_3d_ang.py index 5b0c677db..d2d6bf8e3 100644 --- a/docs/source/pyfigures/xray_3d_ang.py +++ b/docs/source/pyfigures/xray_3d_ang.py @@ -25,7 +25,7 @@ patches.FancyArrowPatch((0.0, -1.0), (0.0, -0.5), arrowstyle=style, color="r"), patches.FancyArrowPatch((c, -c), (c / 2.0, -c / 2.0), arrowstyle=style, color="r"), patches.FancyArrowPatch((1.0, 0.0), (0.5, 0.0), arrowstyle=style, color="r"), - patches.Arc((0.0, 0.0), 2.0, 2.0, theta1=-90, theta2=45.0, color="b", ls="dotted"), + patches.Arc((0.0, 0.0), 2.0, 2.0, theta1=-90, theta2=45.0, color="b", lw=2, ls="dotted"), patches.FancyArrowPatch((c + e, c - e), (c - e, c + e), arrowstyle=style, color="b"), ] for p in plist: