Skip to content

Commit

Permalink
add axis labels to and modify aspect ratio of plots of radiation pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
oskooi committed Nov 21, 2023
1 parent d7a44a7 commit 01c265c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions doc/docs/Python_Tutorials/Near_to_Far_Field_Spectra.md
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ def plot_radiation_pattern_polar(Ptheta: np.ndarray):
ax.set_thetalim(0, 0.5 * math.pi)
ax.grid(True)
ax.set_rlabel_position(22)
ax.set_ylabel('radial flux (a.u.)')
ax.set_title("radiation pattern in polar coordinates")

if mp.am_master():
Expand Down Expand Up @@ -474,6 +475,9 @@ def plot_radiation_pattern_3d(Ptheta: np.ndarray):
fig, ax = plt.subplots(subplot_kw={"projection": "3d"}, figsize=(6,6))
ax.plot_surface(xs, ys, zs, cmap="inferno")
ax.set_title("radiation pattern in 3d")
ax.set_box_aspect((np.amax(xs), np.amax(ys), np.amax(zs)))
ax.set_zlabel('radial flux (a.u.)')
ax.set(xticklabels=[], yticklabels=[])

if mp.am_master():
fig.savefig(
Expand Down
Binary file modified doc/docs/images/disc_radiation_pattern_polar_vs_3d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions python/examples/disc_radiation_pattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def plot_radiation_pattern_polar(Ptheta: np.ndarray):
ax.set_thetalim(0, 0.5 * math.pi)
ax.grid(True)
ax.set_rlabel_position(22)
ax.set_ylabel('radial flux (a.u.)')
ax.set_title("radiation pattern in polar coordinates")

if mp.am_master():
Expand Down Expand Up @@ -88,6 +89,9 @@ def plot_radiation_pattern_3d(Ptheta: np.ndarray):
fig, ax = plt.subplots(subplot_kw={"projection": "3d"}, figsize=(6, 6))
ax.plot_surface(xs, ys, zs, cmap="inferno")
ax.set_title("radiation pattern in 3d")
ax.set_box_aspect((np.amax(xs), np.amax(ys), np.amax(zs)))
ax.set_zlabel('radial flux (a.u.)')
ax.set(xticklabels=[], yticklabels=[])

if mp.am_master():
fig.savefig(
Expand Down

0 comments on commit 01c265c

Please sign in to comment.