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

Adjust titles in polar projections overview #3700

Closed
wants to merge 2 commits into from
Closed
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
12 changes: 6 additions & 6 deletions examples/projections/nongeo/polar.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
# Set map width to 5 cm
projection="P5c",
# Set the frame and title; @^ allows for a line break within the title
frame=["xa45f", "+gbisque+tprojection='P5c' @^ region=[0, 360, 0, 1]"],
frame=["xa45f", '+gbisque+tprojection="P5c" @^ region=[0, 360, 0, 1]'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. I am a bit debating on what is more important, (i) using consistently double quotation marks for string arguments or (ii) making the title consistent with the argument. Currently, I am a bit more on the side of (i). A way to use both times double quotation marks is to add a leading \ for the inner double quotation marks. But maybe this makes things only more complicated.

Suggested change
frame=["xa45f", '+gbisque+tprojection="P5c" @^ region=[0, 360, 0, 1]'],
frame=["xa45f", "+gbisque+tprojection=\"P5c\" @^ region=[0, 360, 0, 1]"],

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Backslashes make the codes more difficult to read and should be avoided.

Personally, I'm OK with displaying either single or double quotes in the plot title. Currently, single quotes are displayed like , rather than '. See #3476 for the reason and #3105 for the fix.

Copy link
Member Author

@michaelgrund michaelgrund Dec 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, single quotes are displayed like , rather than '. See #3476 for the reason and #3105 for the fix.

That's the reason why I wanted to change it. The single quotes are looking like accute accents right now and that's something that seems to be weird for users when they see it in plots. And yes, backslashes make the code more difficult and confusing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the reason why I wanted to change it. The single quotes are looking like accute accents right now and that's something that seems to be weird for users when they see it in plots

Then it means we can close the PR without merging if #3105 is approved.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would still go with using double quotations here since the titles directly reference the projection parameter in the code. Using single quotations for a string in such cases is fine in my opinion. But I'm also fine if all others what to keep it as is.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm inclined to keep it as is.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would also prefer to keep it as is, as I prefer to have (if possible) double quotation marks for the string inputs.

)

fig.shift_origin(xshift="w+3c")
Expand All @@ -75,7 +75,7 @@
# standard angle
projection="P5c+a",
# Set the frame and title; @^ allows for a line break within the title
frame=["xa45f", "+gbisque+tprojection='P5c+a' @^ region=[0, 360, 0, 1]"],
frame=["xa45f", '+gbisque+tprojection="P5c+a" @^ region=[0, 360, 0, 1]'],
)

fig.shift_origin(xshift="w+3c")
Expand All @@ -89,7 +89,7 @@
# standard angle
projection="P5c+a",
# Set the frame and title; @^ allows for a line break within the title
frame=["xa45f", "ya0.2", "WNe+gbisque+tprojection='P5c+a' @^ region=[0, 90, 0, 1]"],
frame=["xa45f", "ya0.2", 'WNe+gbisque+tprojection="P5c+a" @^ region=[0, 90, 0, 1]'],
)

fig.shift_origin(xshift="-2w-6c", yshift="-h-2c")
Expand All @@ -106,7 +106,7 @@
frame=[
"xa30f",
"ya0.2",
"WNe+gbisque+tprojection='P5c+a+t45' @^ region=[0, 90, 0, 1]",
'WNe+gbisque+tprojection="P5c+a+t45" @^ region=[0, 90, 0, 1]',
],
)

Expand All @@ -125,7 +125,7 @@
frame=[
"xa30f",
"ya",
"WNse+gbisque+tprojection='P5c+a+t45' @^ region=[0, 90, 3480, 6371]",
'WNse+gbisque+tprojection="P5c+a+t45" @^ region=[0, 90, 3480, 6371]',
],
)

Expand All @@ -145,7 +145,7 @@
frame=[
"xa30f",
"ya",
"WNse+gbisque+tprojection='P5c+a+t45+\\z' @^ region=[0, 90, 3480, 6371]",
'WNse+gbisque+tprojection="P5c+a+t45+\\z" @^ region=[0, 90, 3480, 6371]',
],
)

Expand Down
Loading