Skip to content

Commit c92e767

Browse files
authored
Improve frame example (#16)
1 parent c5989ce commit c92e767

File tree

1 file changed

+38
-11
lines changed

1 file changed

+38
-11
lines changed

docs/tutorials/basics/frames.rst

+38-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Frames, ticks, titles, and labels
2-
-----------------------
2+
---------------------------------
33

44
Setting frame, ticks, title, etc., of the plot is handled by the :gmt-module:`-B <basemap#b>` parameter that most plotting modules contain like :gmt-module:`basemap`.
55

@@ -10,14 +10,14 @@ By default, GMT does not add a frame to your plot. For example, we can plot
1010
the coastlines of the world with a Mercator projection:
1111

1212

13-
.. gmtplot::
13+
.. gmtplot::
1414

15-
gmt begin frames png
16-
gmt coast -R-180/180/-60/60 -JM25c -W
17-
gmt end show
15+
gmt begin frames png
16+
gmt coast -R-180/180/-60/60 -JM25c -W
17+
gmt end show
1818

1919

20-
To add the default GMT frame style to the plot, add **f** to the :gmt-module:`-B <basemap#b>`.
20+
To add the default GMT frame style to the plot, add ``f`` to the :gmt-module:`-B <basemap#b>`.
2121

2222

2323
.. gmtplot::
@@ -29,9 +29,9 @@ To add the default GMT frame style to the plot, add **f** to the :gmt-module:`-B
2929

3030

3131
Tick labels
32-
~~~~~~~~~~
32+
~~~~~~~~~~~
3333

34-
In GMT the tick labels are called annotations. Add them by passing **a** through the :gmt-module:`-B <basemap#b>` parameter:
34+
In GMT the tick labels are called annotations. Add them by passing ``a`` through the :gmt-module:`-B <basemap#b>` parameter:
3535

3636
.. gmtplot::
3737

@@ -45,7 +45,7 @@ In GMT the tick labels are called annotations. Add them by passing **a** through
4545
Gridlines
4646
~~~~~~~~~~
4747

48-
Add automatic grid lines to the plot by adding **g**:
48+
Add automatic grid lines to the plot by adding ``g``:
4949

5050

5151
.. gmtplot::
@@ -56,10 +56,24 @@ Add automatic grid lines to the plot by adding **g**:
5656
gmt end show
5757

5858

59+
Custom annotations and intervals
60+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
61+
62+
To adjust the step widths of annotations, frame, and grid lines we can
63+
add the desired step widths after ``a``, ``f``, or ``g``. In the example
64+
below, the step widths are set to 30°, 7.5°, and 15°, respectively.
65+
66+
.. gmtplot::
67+
68+
gmt begin frames png
69+
gmt coast -R-180/180/-60/60 -JM25c -W
70+
gmt basemap -Ba30f7.5g15
71+
gmt end show
72+
5973
Title
60-
~~~~~~~~~~
74+
~~~~~
6175

62-
The figure title can be set by passing **+ttitle**:
76+
The figure title can be set by passing ``+ttitle``:
6377

6478
.. gmtplot::
6579

@@ -68,3 +82,16 @@ The figure title can be set by passing **+ttitle**:
6882
gmt basemap -Bafg
6983
gmt basemap -B+t"Mercator Map"
7084
gmt end show
85+
86+
Subtitle
87+
~~~~~~~~
88+
89+
Then you can add a subtitle with ``+ssubtitle``:
90+
91+
.. gmtplot::
92+
93+
gmt begin frames png
94+
gmt coast -R-180/180/-60/60 -JM25c -W
95+
gmt basemap -Bafg
96+
gmt basemap -B+t"Mercator Map"+s"Subtitle"
97+
gmt end show

0 commit comments

Comments
 (0)