Closed weiji14 closed 3 years ago
@Jessie42 will be working on this!
I noticed the same thing. Putting title-setting in the docs would be super helpful. It's slightly tricky with escape-character-quotations... Not sure if you want to explain things like this in the tutorials, but you can set the title on the fly like this:
# my_variable is a string (ex: "shear stress")
title="+t\"Map of "+my_variable+" values\"";
fig.basemap(frame=["ag", title];
I'll take on this issue.
@weiji14 I'm struggling with the stretch goals of adding the axis labels. I thought it would be the same as setting the labels on the color bars, and the arguments would be x+lLongitude
and y+lLatitude
but that is not plotting any axis labels. I can't find anything in the PyGMT or GMT docs for the solution; any idea?
the arguments would be
x+lLongitude
andy+lLatitude
but that is not plotting any axis labels
GMT doesn't allow adding labels to geographic maps. As for geographic maps, the X-axis is always longitude and the Y axis is always latitude.
Since the rest of the tutorial is for geographic maps, do you think it's better to use a non-geographic map for this last part or just not include axis labels in this tutorial?
I don't have a good idea for this. Perhaps it's better to show labels for non-geographic maps and also explain why it doesn't work for geographic maps.
That's a good idea; I'll add it tomorrow
Currently struggling with adding the labels. I'm using:
fig.basemap(region=[0, 10, 0, 20], projection="X4i/3i", frame=["x+lx-axis", "y+ly-axis"])
It is plotting the x-axis label on both the top and bottom and the y-axis label on the left and right side. Not seeing anything in the GMT docs to specify that it only print in one location; any ideas?
Try with frame=["WSne", "x+lx-axis", "y+ly-axis"]
.
It worked! Thanks
@weiji14 @seisman Would needing to add the "WSne" argument be best explained that, by default, all axes are designated as primary axes and "WSne" is needed to make only the left and bottom axes primary?
Closed by #720.
Description of the problem
Even though it's in the title, our map :world_map: tutorial for setting map frames, ticks, titles and labels doesn't actually teach us how to set a title!
We'll need your help :wave: to add that to the example. You'll be working on the pygmt/examples/tutorial/frames.py file which you can edit here or in your Text Editor or Integrated Development Environment (IDE).
To do that, you'll need to know how to use the the
frame (B)
setting in thebasemap
function. Specifically, you might need to refer to the GMT docs on setting theB-option
. This one line of code below (adapted from https://github.com/GenericMappingTools/pygmt/pull/325#issuecomment-540203439) is part of what you need to do the trick:You can find out more about contributing in our CONTRIBUTING.md docs. Leave a comment below if you'd like to start working on this and feel free to ask for help! It's actually as much of a learning experience for us as it will be for you :smile:
Stretch goals
In addition to setting a title, Find out how to set an
x-axis
label called "Longitude" andy-axis
label called "Latitude"!