-
Notifications
You must be signed in to change notification settings - Fork 229
Consistent usage of whitespaces across gallery and tutorial examples #2018
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
Consistent usage of whitespaces across gallery and tutorial examples #2018
Conversation
In the section Title of the Tutorial 'Frames, ticks, titles, and labels': ###############################################################################
# Title
# -----
#
# The figure title can be set by passing **+t**\ *title* to the ``frame``
# parameter of :meth:`pygmt.Figure.basemap`. Passing multiple arguments to
# ``frame`` can be done by using a list, as show in the example below.
fig = pygmt.Figure()
# region="IS" specifies Iceland using the ISO country code
fig.coast(shorelines="1/0.5p", region="IS", projection="M25c")
fig.basemap(frame=["a", "+tIceland"])
fig.show()
###############################################################################
# To use a title with multiple words, the title must be placed inside another
# set of quotation marks. To prevent the quotation marks from appearing in the
# figure title, the ``frame`` parameter can be passed in single quotation marks
# and the title can be passed in double quotation marks.
fig = pygmt.Figure()
# region="TT" specifies Trinidad and Tobago
fig.coast(shorelines="1/0.5p", region="TT", projection="M25c")
fig.basemap(frame=["a", '+t"Trinidad and Tobago"'])
fig.show()
@seisman: Is this fine, or do you prefer to go with the 'Island' map as an example? |
Both sound good to me! |
…titles, and labels'
This PR looks good. Are there any more changes you want to make in this PR? |
I think we also need to update a few tests.
These tests can be updated in this PR or in a separate PR. |
Regarding the gallery and tutorials, I think I have found and changed all affected examples.
Good point! Yes.
There is no real preference from my side on this. I can also open a new PR for updating the tests. |
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.
Good to merge.
Perhaps we should keep a few unit tests around that use the nested quotes, as a regression test to ensure backwards compatibility is preserved? |
We already have the following test in docstrings. Do you think it's enough? Lines 189 to 198 in 4902687
|
Oh yes true. That one should be enough. |
Description of proposed changes
Fixes #2013
Overview of affected examples
Tutorials
Gallery
Reminders
make format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
.Slash Commands
You can write slash commands (
/command
) in the first line of a comment to performspecific operations. Supported slash commands are:
/format
: automatically format and lint the code/test-gmt-dev
: run full tests on the latest GMT development version