Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,10 @@ Basics
:align: center

:doc:`tutorials/basics/coastlines`

- .. image:: _images/18736ae188d169a16383b28a3a7afcb8.png
:target: tutorials/basics/frames.html
:width: 80%
:align: center

:doc:`tutorials/basics/frames`
70 changes: 70 additions & 0 deletions docs/tutorials/basics/frames.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
Frames, ticks, titles, and labels
-----------------------

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`.

Plot Frame
~~~~~~~~~~

By default, GMT does not add a frame to your plot. For example, we can plot
the coastlines of the world with a Mercator projection:


.. gmtplot::

gmt begin frames png
gmt coast -R-180/180/-60/60 -JM25c -W
gmt end show


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


.. gmtplot::

gmt begin frames png
gmt coast -R-180/180/-60/60 -JM25c -W
gmt basemap -Bf
gmt end show


Tick labels
~~~~~~~~~~

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

.. gmtplot::

gmt begin frames png
gmt coast -R-180/180/-60/60 -JM25c -W
gmt basemap -Baf
gmt end show



Gridlines
~~~~~~~~~~

Add automatic grid lines to the plot by adding **g**:


.. gmtplot::

gmt begin frames png
gmt coast -R-180/180/-60/60 -JM25c -W
gmt basemap -Bafg
gmt end show


Title
~~~~~~~~~~

The figure title can be set by passing **+ttitle**:

.. gmtplot::

gmt begin frames png
gmt coast -R-180/180/-60/60 -JM25c -W
gmt basemap -Bafg
gmt basemap -B+t"Mercator Map"
gmt end show