Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix spelling in plot.py #1147

Merged
merged 1 commit into from
Feb 14, 2025
Merged
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
30 changes: 15 additions & 15 deletions src/CSET/operators/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def _colorbar_map_levels(varname: str, **kwargs):
List of levels to use for plotting. For continuous plots the min and max
should be taken as the range.
norm:
BoundryNorm information.
BoundaryNorm information.
"""
colorbar = _load_colorbar_map()

Expand Down Expand Up @@ -258,14 +258,14 @@ def _plot_and_save_spatial_plot(
# Add coastlines if cube contains x and y map coordinates.
# If is spatial map, fix extent to keep plot tight.
try:
lataxis, lonaxis = get_cube_yxcoordname(cube)
lat_axis, lon_axis = get_cube_yxcoordname(cube)
axes.coastlines(resolution="10m")
axes.set_extent(
[
np.min(cube.coord(lonaxis).points),
np.max(cube.coord(lonaxis).points),
np.min(cube.coord(lataxis).points),
np.max(cube.coord(lataxis).points),
np.min(cube.coord(lon_axis).points),
np.max(cube.coord(lon_axis).points),
np.min(cube.coord(lat_axis).points),
np.max(cube.coord(lat_axis).points),
]
)
except ValueError:
Expand Down Expand Up @@ -298,7 +298,7 @@ def _plot_and_save_spatial_plot(
# Add title.
axes.set_title(title, fontsize=16)

# Add watermark with min/max/mean. Currently not user toggable.
# Add watermark with min/max/mean. Currently not user togglable.
# In the bbox dictionary, fc and ec are hex colour codes for grey shade.
axes.annotate(
f"Min: {np.min(cube.data):.3g} Max: {np.max(cube.data):.3g} Mean: {np.mean(cube.data):.3g}",
Expand Down Expand Up @@ -383,14 +383,14 @@ def _plot_and_save_postage_stamp_spatial_plot(
# Add coastlines if cube contains x and y map coordinates.
# If is spatial map, fix extent to keep plot tight.
try:
lataxis, lonaxis = get_cube_yxcoordname(cube)
lat_axis, lon_axis = get_cube_yxcoordname(cube)
ax.coastlines(resolution="10m")
ax.set_extent(
[
np.min(cube.coord(lonaxis).points),
np.max(cube.coord(lonaxis).points),
np.min(cube.coord(lataxis).points),
np.max(cube.coord(lataxis).points),
np.min(cube.coord(lon_axis).points),
np.max(cube.coord(lon_axis).points),
np.min(cube.coord(lat_axis).points),
np.max(cube.coord(lat_axis).points),
]
)
except ValueError:
Expand Down Expand Up @@ -539,7 +539,6 @@ def _plot_and_save_vertical_line_series(
)
ax.ticklabel_format(axis="x")
ax.tick_params(axis="y")
# ax.autoscale()

# Save plot.
fig.savefig(filename, bbox_inches="tight", dpi=_get_plot_resolution())
Expand Down Expand Up @@ -654,7 +653,7 @@ def _plot_and_save_histogram_series(

for cube in iter_maybe(cubes):
# Easier to check title (where var name originates)
# than seeing if longnames exist etc.
# than seeing if long names exist etc.
# Exception case, where distribution better fits log scales/bins.
if "surface_microphysical_rainfall_rate" in title:
# Usually in seconds but mm/hr more intuitive.
Expand Down Expand Up @@ -1136,7 +1135,8 @@ def plot_vertical_line_series(
f"Cube must have a {sequence_coordinate} coordinate or be 1D."
) from err

# Append cube data to the list to alculate vmin and vmax across entire cubelist
# Append cube data to the list to calculate vmin and vmax across entire
# cubelist.
all_data.append(cube_iter.data)

# Combine all data into a single NumPy array
Expand Down