Making GMT custom symbols (Part I)

We are going to create a custom symbol to use in GMT. Please note that to reproduce this example it is necessary to have a Mirone version updated to 9 January 2016 or later. Older versions also work but they allow importing a background image.

Open a background window of type "frame"

Select the .def mode

Make sure you check the .def checkbox, hit the OK button and than you will see the following image.

Mirone window in the GMT custom symbol mode

At this point you can start drawing your symbol using the usual line and polygon tools but we are going to make it more interesting (and easy) by loading an image to background that will help to draw the symbol. We are going to digitize the well known and typical Portuguese "Playboy Cactus". So let's load a photo of if by clicking the folder icon and selecting the file.

Digitize the shape of the Playboy Cactus

Here we went ahead and digitized the the cactus silhouette using the polygon drawing tool. We made ir yellow so that it can be seen clearer but you better not do it and leave the color control to when you use the symbol in GMT.
And to finish we only have to export the symbol. We do that by selecting:

Export the symbol

Save the symbol with a name of your choice (playboy_cactus in our case), which will be appended with the .def extension.
And that's it, we have now a symbol that we can use in the GMT's psxy program. As an example of usage, run the following GMT commands to get the image bellow.

pscoast -R-11/-3/36/44 -Gbrown -Slightblue -JM8c -Di -Ba2WSen -W1p -P -K > playboy_cactus.ps
echo -8 37.5 | psxy -R -J -Skplayboy_cactus/2.0c -Ggreen -W1p -O -K >> playboy_cactus.ps
echo -9.5 39.0 | psxy -R -J -Skplayboy_cactus/2.0c -Ggreen -W1p -O -K >> playboy_cactus.ps
echo -6.8 40.6 | psxy -R -J -Skplayboy_cactus/1.5c -Ggreen -W1p -O -K >> playboy_cactus.ps
echo -7 39.0 | psxy -R -J -Skplayboy_cactus/2.0c -Ggreen -W1p -O -K >> playboy_cactus.ps
echo -8.7 40.5 | psxy -R -J -Skplayboy_cactus/1.0c -Ggreen -W1p -O -K >> playboy_cactus.ps
echo -8 41.5 | psxy -R -J -Skplayboy_cactus/2.0c -Ggreen -W1p -O >> playboy_cactus.ps
psconvert playboy_cactus.ps -Tg -A

Some say the spreading of the Playboy Cactus is a sign of the global warming.