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

Conversation

michaelgrund
Copy link
Member

Description of proposed changes

Adjust title for each plot so that the formatting looks like the string given to the projection parameter (double quotations are shown in the plot titles instead of single ones).

Old:

plot_old


New:

plot_new

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If wrapping a new module, open a 'Wrap new GMT module' issue and submit reasonably-sized PRs.
  • If adding new functionality, add an example to docstrings or tutorials.
  • Use underscores (not hyphens) in names of Python files and directories.

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash command is:

  • /format: automatically format and lint the code

@michaelgrund michaelgrund added documentation Improvements or additions to documentation skip-changelog Skip adding Pull Request to changelog labels Dec 19, 2024
@michaelgrund michaelgrund added this to the 0.14.0 milestone Dec 19, 2024
@michaelgrund michaelgrund added the needs review This PR has higher priority and needs review. label Dec 19, 2024
Copy link
Member

@seisman seisman left a comment

Choose a reason for hiding this comment

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

Looks good.

@seisman seisman added final review call This PR requires final review and approval from a second reviewer and removed needs review This PR has higher priority and needs review. labels Dec 19, 2024
@@ -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.

@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label Dec 20, 2024
@seisman
Copy link
Member

seisman commented Dec 24, 2024

I'm closing the PR.

@seisman seisman closed this Dec 24, 2024
@seisman seisman deleted the polar-proj-titles branch December 24, 2024 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation skip-changelog Skip adding Pull Request to changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants