pygmt.params.LegendSpec
- class pygmt.params.LegendSpec[source]
A legend specification for
pygmt.Figure.legend.- add_header(text, font=None)[source]
Add a centered header (
H) [Default font is FONT_TITLE].
- add_symbol(symbol, size, fill=None, pen=None, label=None, dx1=None, dx2=None)[source]
Add a symbol, with an optional explanatory
label.dx1is the offset of the symbol from the left margin of the column anddx2the offset of the label; both are computed by GMT if not given.
- add_line(pen=None, length=None, label=None, dx1=None, dx2=None)[source]
Add a line segment (
S), with an optional explanatorylabel.A line segment is a symbol record using GMT’s horizontal dash symbol, so
lengthis the length of the segment andpenits attributes.dx1is the offset of the segment from the left margin of the column anddx2the offset of the label; both are computed by GMT if not given.
- to_stringio()[source]
Return the specification as a
io.StringIOobject.- Return type: