# \#legend

**URL:** https://forum.generic-mapping-tools.org/tag/legend/4.md

[Latest](https://forum.generic-mapping-tools.org/latest.md) · [Categories](https://forum.generic-mapping-tools.org/categories.md) · [Tags](https://forum.generic-mapping-tools.org/tags.md)

---

## [I want to give symbols to my earthquake data like size to magnitude and color to depth but im unable can someone help me](https://forum.generic-mapping-tools.org/t/i-want-to-give-symbols-to-my-earthquake-data-like-size-to-magnitude-and-color-to-depth-but-im-unable-can-someone-help-me/6357)

<div class="topic-metadata">

**Author:** [@parbuss2-hue](https://forum.generic-mapping-tools.org/u/parbuss2-hue)\
**Replies:** 5\
**Last updated:** [March 2, 2026, 1:20am UTC](https://forum.generic-mapping-tools.org/t/i-want-to-give-symbols-to-my-earthquake-data-like-size-to-magnitude-and-color-to-depth-but-im-unable-can-someone-help-me/6357 "2026-03-02T01:20:57Z")

</div>

filtered\_data\_gmt.txt (100.0 KB) this is the file. import numpy as np import pygmt fig = pygmt.Figure() # CPT (adjust to your depth/magnitude range if needed) pygmt.makecpt(cmap="red,green,blue", series="0/300/10", …

---

## [Categorical cpt for plotting netCDF file with custom colours (Hex codes)](https://forum.generic-mapping-tools.org/t/categorical-cpt-for-plotting-netcdf-file-with-custom-colours-hex-codes/5383)

<div class="topic-metadata">

**Author:** [@trivial](https://forum.generic-mapping-tools.org/u/trivial)\
**Replies:** 2\
**Last updated:** [September 30, 2024, 8:53am UTC](https://forum.generic-mapping-tools.org/t/categorical-cpt-for-plotting-netcdf-file-with-custom-colours-hex-codes/5383 "2024-09-30T08:53:28Z")

</div>

I have a NetCDF (.nc) file which contain grid-cell classified data where I have assigned values 1, 2, 3 for cells on basis of classification criteria. I plotted this using pygmt.grdimage while following basic categorical…

---

## [Pygmt.legend](https://forum.generic-mapping-tools.org/t/pygmt-legend/5237)

<div class="topic-metadata">

**Author:** [@kjz1997](https://forum.generic-mapping-tools.org/u/kjz1997)\
**Replies:** 4\
**Last updated:** [August 30, 2024, 7:15pm UTC](https://forum.generic-mapping-tools.org/t/pygmt-legend/5237 "2024-08-30T19:15:11Z")

</div>

hello everyone I want to use shift\_origin to draw multiple graphics on a canvas, and then draw the labels from each graphic into the same legend. Here is my code, but the result of the legend doesn’t seem to be very goo…

---

## [In case of categorical cpt, z=value is not applied to the fill of the legend symbol](https://forum.generic-mapping-tools.org/t/in-case-of-categorical-cpt-z-value-is-not-applied-to-the-fill-of-the-legend-symbol/5103)

<div class="topic-metadata">

**Author:** [@tllc46](https://forum.generic-mapping-tools.org/u/tllc46)\
**Replies:** 4\
**Last updated:** [July 22, 2024, 8:19am UTC](https://forum.generic-mapping-tools.org/t/in-case-of-categorical-cpt-z-value-is-not-applied-to-the-fill-of-the-legend-symbol/5103 "2024-07-22T08:19:28Z")

</div>

Hello gmt users, I posted this question because I didn’t get the expected results while using gmt’s legend module. According to the legend module manual, the symbol’s fill can be specified by cpt and z=value format. Howe…

---

## [Symbol of strike-slip faults - Legend](https://forum.generic-mapping-tools.org/t/symbol-of-strike-slip-faults-legend/4841)

<div class="topic-metadata">

**Author:** [@IKTE](https://forum.generic-mapping-tools.org/u/IKTE)\
**Replies:** 4\
**Last updated:** [May 20, 2024, 2:08pm UTC](https://forum.generic-mapping-tools.org/t/symbol-of-strike-slip-faults-legend/4841 "2024-05-20T14:08:07Z")

</div>

Hi there! I’m interested in learning how to adjust the distance between the front line and the symbol for strike-slip faults (arrays). I understand that there are parameters to modify the distance between the symbols (g…

---

## [How to add legend and scale to the map](https://forum.generic-mapping-tools.org/t/how-to-add-legend-and-scale-to-the-map/4706)

<div class="topic-metadata">

**Author:** [@vis2hnu1](https://forum.generic-mapping-tools.org/u/vis2hnu1)\
**Replies:** 1\
**Last updated:** [March 8, 2024, 1:49pm UTC](https://forum.generic-mapping-tools.org/t/how-to-add-legend-and-scale-to-the-map/4706 "2024-03-08T13:49:33Z")

</div>

Dear sir/madam, I recently started using the GMT for making maps. I don’t know how to add legend, I tried but I am not able to add it. please help me by providing the information regrading how to add legend for the bel…

---

## [Font change in plot -l string not correctly intpreted in legend command](https://forum.generic-mapping-tools.org/t/font-change-in-plot-l-string-not-correctly-intpreted-in-legend-command/3989)

<div class="topic-metadata">

**Author:** [@volkerk](https://forum.generic-mapping-tools.org/u/volkerk)\
**Replies:** 0\
**Last updated:** [June 2, 2023, 4:02pm UTC](https://forum.generic-mapping-tools.org/t/font-change-in-plot-l-string-not-correctly-intpreted-in-legend-command/3989 "2023-06-02T16:02:02Z")

</div>

Using gmt 6.4 I came across the problem that the font change in the first legend string was not correct # generate legend rm -f legend.txt cat \<\<- END \> dummy.dat -128 -9000 0 -9000 END gmt begin a gmt basemap -JX7/…

---

## [Pslegend crash with a segmentation faults](https://forum.generic-mapping-tools.org/t/pslegend-crash-with-a-segmentation-faults/3822)

<div class="topic-metadata">

**Author:** [@Rom1](https://forum.generic-mapping-tools.org/u/Rom1)\
**Replies:** 1\
**Last updated:** [April 5, 2023, 1:45pm UTC](https://forum.generic-mapping-tools.org/t/pslegend-crash-with-a-segmentation-faults/3822 "2023-04-05T13:45:26Z")

</div>

Hello there! I’m having an issue pslegend. It’s returning a Segmentation fault (see below) \[Session gmt (0)\]: Error returned from GMT API: GMT\_READ\_ONCE (70) \[Session gmt (0)\]: Error returned from GMT API: GMT\_READ\_O…

---

## [GMT 6.1.1 API crash when executing legend module](https://forum.generic-mapping-tools.org/t/gmt-6-1-1-api-crash-when-executing-legend-module/3780)

<div class="topic-metadata">

**Author:** [@CHigginbotham](https://forum.generic-mapping-tools.org/u/CHigginbotham)\
**Replies:** 3\
**Last updated:** [March 25, 2023, 4:53pm UTC](https://forum.generic-mapping-tools.org/t/gmt-6-1-1-api-crash-when-executing-legend-module/3780 "2023-03-25T16:53:49Z")

</div>

First, I fixed it–the pslegend.c source code checks for memory allocation incorrectly. Second, because of institutional restrictions, I cannot use a newer version than what compiles on RHEL8 Linux. If the problem is fix…

---

## [How Plot Legend in Pygmt](https://forum.generic-mapping-tools.org/t/how-plot-legend-in-pygmt/3645)

<div class="topic-metadata">

**Author:** [@quake10](https://forum.generic-mapping-tools.org/u/quake10)\
**Replies:** 3\
**Last updated:** [February 26, 2023, 11:21pm UTC](https://forum.generic-mapping-tools.org/t/how-plot-legend-in-pygmt/3645 "2023-02-26T23:21:02Z")

</div>

Hello guys I have problem for plot legend in Pygmt, the script ini GMT bellow. So I want to make this scritp ini PyGmt. Maybe you can help me Thanks a lot pscoast -R90/100/0/7 -JM20c -Ba10g5 -Ggreen3 -S140/235/255 -Dh…
