Skip to content

Commit

Permalink
respond to pr review
Browse files Browse the repository at this point in the history
  • Loading branch information
jukent committed Mar 22, 2024
1 parent 68b86af commit 741f7cd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ docs/_build/
dist/
.eggs/
*egg-info

# IDEs
settings.json
18 changes: 9 additions & 9 deletions src/geocat/viz/taylor.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,12 +441,12 @@ def add_xgrid(self,

return self.add_corr_grid(arr, color, linestyle, linewidth, **kwargs)

def add_stdev_grid(self,
arr: typing.Union[xr.DataArray, np.ndarray, list, float],
color: str = 'lightgray',
linestyle=(0, (9, 5)),
linewidth: int = 1,
**kwargs):
def add_std_grid(self,
arr: typing.Union[xr.DataArray, np.ndarray, list, float],
color: str = 'lightgray',
linestyle=(0, (9, 5)),
linewidth: int = 1,
**kwargs):
"""Add radial gridlines to the standard deviation axis specified by
array.
Expand Down Expand Up @@ -478,7 +478,7 @@ def add_stdev_grid(self,
--------
All usage examples are within the GeoCAT-Examples Gallery. To see more usage cases, search the function on the `website <https://geocat-examples.readthedocs.io/en/latest/index.html>`_.
- `NCL_taylor_2.py <https://geocat-examples.readthedocs.io/en/latest/gallery/TaylorDiagrams/NCL_taylor_2.html?highlight=add_stdev_grid>`_
- `NCL_taylor_2.py <https://geocat-examples.readthedocs.io/en/latest/gallery/TaylorDiagrams/NCL_taylor_2.html?highlight=add_std_grid>`_
"""

t_array = np.linspace(0, np.pi / 2)
Expand All @@ -501,10 +501,10 @@ def add_ygrid(self,
*arr*.
This function will be deprecated in favor of `add_stdev_grid()`
This function will be deprecated in favor of `add_std_grid()`
"""

return self.add_stdev_grid(arr, color, linestyle, linewidth, **kwargs)
return self.add_std_grid(arr, color, linestyle, linewidth, **kwargs)

def add_grid(self, *args, **kwargs):
"""Add a grid.
Expand Down
7 changes: 5 additions & 2 deletions src/geocat/viz/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ def set_titles_and_labels(ax: typing.Union[matplotlib.axes.Axes,
>>> | Axes |
>>> | |
Be aware that the `suptitle` functionality does not automaticallly render well for Cartopy plots. Recommended fixes are to iterate on your figure size until it does not extend as far past your plot OR to use string manipulation to add enough spaces to center your left or right title keyword argument.
Be aware that the `suptitle` functionality does not always render well for Cartopy plots. If your main title appears too far above your plot, the recommended fix is to decrease the y-dimension of your figure size.
Examples
--------
Expand All @@ -573,7 +573,10 @@ def set_titles_and_labels(ax: typing.Union[matplotlib.axes.Axes,
if maintitle is not None:
if subtitle is not None:
fig = ax.get_figure()
fig.suptitle(maintitle, fontsize=maintitlefontsize, y=1.04)
fig.suptitle(maintitle,
fontsize=maintitlefontsize,
y=1.04,
ha='center')
elif lefttitle is not None or righttitle is not None:
ax.set_title(maintitle, fontsize=maintitlefontsize + 2, y=1.12)
else:
Expand Down

0 comments on commit 741f7cd

Please sign in to comment.