-
Notifications
You must be signed in to change notification settings - Fork 368
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
Add all 60 zones of the UTM projection to the docs projection list #1103
Conversation
@pelson could you review this please? |
docs/make_projection.py
Outdated
|
||
def plate_carree_plot(i, nplots): | ||
central_longitude = 0 if i == 1 else 180 | ||
ax = fig.add_subplot(1, nplots-1, i, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
F821 undefined name 'fig'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed for generating plotting code.
docs/make_projection.py
Outdated
central_longitude = 0 if i == 1 else 180 | ||
ax = fig.add_subplot(1, nplots-1, i, | ||
projection=ccrs.PlateCarree( | ||
central_longitude=central_longitude)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E122 continuation line missing indentation or outdented
docs/make_projection.py
Outdated
|
||
|
||
def utm_plot(i, nplots): | ||
ax = fig.add_subplot(1, nplots-1, i, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
F821 undefined name 'fig'
docs/make_projection.py
Outdated
for instance_args in SPECIAL_CASES.get(prj, [{}]): | ||
prj_inst = prj(**instance_args) | ||
|
||
if prj not in MULTI_PLOT_CASES: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E303 too many blank lines (2)
docs/make_projection.py
Outdated
# Generate plotting code | ||
code = textwrap.dedent(""" | ||
.. plot:: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W293 blank line contains whitespace
docs/make_projection.py
Outdated
|
||
import matplotlib.pyplot as plt | ||
import cartopy.crs as ccrs | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W293 blank line contains whitespace
docs/make_projection.py
Outdated
|
||
code = textwrap.dedent(""" | ||
.. plot:: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W293 blank line contains whitespace
docs/make_projection.py
Outdated
import cartopy.crs as ccrs | ||
|
||
fig = plt.figure(figsize=(10, 3)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W293 blank line contains whitespace
docs/make_projection.py
Outdated
fig = plt.figure(figsize=(10, 3)) | ||
|
||
{func_code} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W293 blank line contains whitespace
docs/make_projection.py
Outdated
\n""".format(width=width, proj_constructor=instance_creation_code, | ||
coastline_resolution=COASTLINE_RESOLUTION.get(prj, '110m')) | ||
""").format(nplots=nplots+1, | ||
func_code=func_code, func_name=func.__name__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E128 continuation line under-indented for visual indent
docs/make_projection.py
Outdated
|
||
def plate_carree_plot(i, nplots): | ||
central_longitude = 0 if i == 1 else 180 | ||
ax = fig.add_subplot(1, nplots-1, i, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
F821 undefined name 'fig'
docs/make_projection.py
Outdated
# Generate plotting code | ||
code = textwrap.dedent(""" | ||
.. plot:: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W293 blank line contains whitespace
docs/make_projection.py
Outdated
|
||
def plate_carree_plot(i, nplots): | ||
central_longitude = 0 if i == 1 else 180 | ||
ax = fig.add_subplot(1, nplots-1, i, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
F821 undefined name 'fig'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is mostly better, but there's something a bit off with the width. It seems like the existing plots were never too wide, but these new figures are too wide to fit and are shrunk down a bit, producing a slightly poorer looking figure.
Also, some minor stylistic issues below.
docs/make_projection.py
Outdated
@@ -19,26 +19,53 @@ | |||
|
|||
import os | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't need this blank line.
docs/make_projection.py
Outdated
@@ -19,26 +19,53 @@ | |||
|
|||
import os | |||
|
|||
import inspect | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also unnecessary blank line.
docs/make_projection.py
Outdated
|
||
def plate_carree_plot(i, nplots, fig): | ||
central_longitude = 0 if i == 1 else 180 | ||
ax = fig.add_subplot(1, nplots-1, i, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This -1
is confusing; you should +1
on the i
instead.
docs/make_projection.py
Outdated
|
||
\n""".format(width=width, proj_constructor=instance_creation_code, | ||
coastline_resolution=COASTLINE_RESOLUTION.get(prj, '110m')) | ||
""").format(nplots=nplots+1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And then remove this +1
.
docs/source/crs/projections.rst
Outdated
@@ -67,7 +62,7 @@ AzimuthalEquidistant | |||
|
|||
plt.figure(figsize=(3, 3)) | |||
ax = plt.axes(projection=ccrs.AzimuthalEquidistant( | |||
central_latitude=90)) | |||
central_latitude=90)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's too much indent to this now.
Good point about the width @QuLogic. I've returned PlateCarree to being vertically stacked. |
I was going to suggest |
I'm not sure how this is related since this PR is just documentation, so I haven't closed that issue yet. |
Rationale
In the projection list of the documentation the UTM projection is depicted using only one zone. It would be more informative to include all 60 zones of the projection in the list, side by side (similar to the example added in PR #954).
Implications
Rewrites make_projection.py to include options for multiple subplots as well as single plots. Multiple subplots have been utilised for both PlateCarree and UTM projections.
Closes issue #986.