You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue serves as the central place for discussing and tracking the implementation of the Figure.paragraph method in PyGMT. The issue will be closed when the initial implementation is complete. Progress is tracked at PyGMT: Wrapping GMT modules.
Figure.paragraph is a high-level wrapper of GMT's text module -M option to typeset one or multiple paragraphs in a plot.
text's -M option means "paragraph mode". In this mode, the input file must be multi-segment files. Segments are separated by a special record whose first character must be flag [Default is >]. Multiple paragraphs are separated with a blank line. Its format is like:
> x y [font angle justify] linespace parwidth parjust
text for paragraph1
text for paragraph2
> x y [font angle justify] linespace parwidth parjust
text for paragraph3
x/y: position of the paragraph
font/angle: font and angle of the text [Requires -F]
justify: justification of the paragraph box [Requires -F]
linespace: line spacing
parwidth: paragraph width
parjust: text justification in the paragraph, can be l(eft), c(enter), r(ight), or j(ustified)
Notes:
Multiple paragraphs should be separated by a blank line when passing to GMT. A sequence of string is the most Pythonic way to represent multiple paragraphs.
When typesetting multiple paragraphs, each paragraph can have its own font/angle/justify/linespace/parwidth/parjust. It means the corresponding parameters should accept a sequence as input. I think it will makes codes much complicated, so prefer not to support it. Users who need different styles for different paragraphs can call Figure.paragraph multiple times.
Passing a plaintext file is not supported. I prefer not to support it anyway.
This issue serves as the central place for discussing and tracking the implementation of the
Figure.paragraphmethod in PyGMT. The issue will be closed when the initial implementation is complete. Progress is tracked at PyGMT: Wrapping GMT modules.Figure.paragraphis a high-level wrapper of GMT'stextmodule-Moption to typeset one or multiple paragraphs in a plot.Documentation
GMT Option Flags and Modifieres
☑️: Implemented; ⬜: To be implemented/discussed;
Strikethrough: Won't implement.<table>: Add Figure.paragraph to typeset one or multiple paragraph of text strings #3709-J-R-A-B-C-D-F+a: set angle Add Figure.paragraph to typeset one or multiple paragraph of text strings #3709+c:+f: set font Add Figure.paragraph to typeset one or multiple paragraph of text strings #3709+j: set justify Add Figure.paragraph to typeset one or multiple paragraph of text strings #3709: Can't be used in paragraph mode.+h|l|r|z|t-G:fillAdd Figure.paragraph to typeset one or multiple paragraph of text strings #3709-L-M: paragraph mode Add Figure.paragraph to typeset one or multiple paragraph of text strings #3709-N-Q-S: Use~~-UFigure.timestamp.-V:verboseAdd Figure.paragraph to typeset one or multiple paragraph of text strings #3709-W:penAdd Figure.paragraph to typeset one or multiple paragraph of text strings #3709: Use~~-XFigure.shift_origin.: Use~~-YFigure.shift_origin.: Not implemented for paragraph mode-Z-a-c:panelAdd Figure.paragraph to typeset one or multiple paragraph of text strings #3709-e-f-h-it: This option is not implemented in paragraph mode.-p-qi-t:transparencyAdd Figure.paragraph to typeset one or multiple paragraph of text strings #3709-wy-:Notes on Input Formats
text's-Moption means "paragraph mode". In this mode, the input file must be multi-segment files. Segments are separated by a special record whose first character must be flag [Default is>]. Multiple paragraphs are separated with a blank line. Its format is like:x/y: position of the paragraphfont/angle: font and angle of the text [Requires-F]justify: justification of the paragraph box [Requires-F]linespace: line spacingparwidth: paragraph widthparjust: text justification in the paragraph, can be l(eft), c(enter), r(ight), or j(ustified)Notes:
Figure.paragraphmultiple times.Linked Pull Requests
Related Issues and Discussions