Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend / Add gallery example to explain "symbol" parameter of "Figure.plot" #3595

Open
Tracked by #3691
yvonnefroehlich opened this issue Nov 6, 2024 · 5 comments · May be fixed by #3598
Open
Tracked by #3691

Extend / Add gallery example to explain "symbol" parameter of "Figure.plot" #3595

yvonnefroehlich opened this issue Nov 6, 2024 · 5 comments · May be fixed by #3598
Labels
discussions Need more discussion before taking further actions documentation Improvements or additions to documentation enhancement Improving an existing feature
Milestone

Comments

@yvonnefroehlich
Copy link
Member

yvonnefroehlich commented Nov 6, 2024

In PR #1117, the symbol parameter was added to Figure.plot (and similarly for Figure.plot3d in #3559).

As some confusions regarding the style, symbol, and size parameters are likely, we should extend or add a gallery example or / and tutorial which explain this new parameter:

  • Maybe we can extend the gallery example Points.
  • Add a tutorial "Plotting symbols".
@yvonnefroehlich yvonnefroehlich added documentation Improvements or additions to documentation enhancement Improving an existing feature discussions Need more discussion before taking further actions labels Nov 6, 2024
@yvonnefroehlich yvonnefroehlich added this to the 0.14.0 milestone Nov 6, 2024
@yvonnefroehlich yvonnefroehlich changed the title Extend / Add gallery example to explain "symobl" paramter of "Figure.plot" Extend / Add gallery example to explain "symobl" parameter of "Figure.plot" Nov 6, 2024
@yvonnefroehlich yvonnefroehlich changed the title Extend / Add gallery example to explain "symobl" parameter of "Figure.plot" Extend / Add gallery example to explain "symbol" parameter of "Figure.plot" Nov 6, 2024
@yvonnefroehlich yvonnefroehlich linked a pull request Nov 7, 2024 that will close this issue
10 tasks
@yvonnefroehlich
Copy link
Member Author

yvonnefroehlich commented Nov 7, 2024

After adding the symbol parameter, there are these four possibilities:

  1. same symbol and size: style parameter
  2. same symbol but individual sizes: style parameter with size parameter
  3. individual symbols but same size: style parameter with symbol parameter
  4. individual symbols and sizes: size and symbol parameters

These four cases are covered by the examples in #3598.

@seisman
Copy link
Member

seisman commented Nov 8, 2024

The complexity is mainly because:

  1. GMT's plot module can plot both lines/polygons and symbols
  2. The style parameter (alias of -S) was introduced in the early stage of the project and at that time parameters like size/symbol were not available.

Users may think that size="0.2c", symbol="c" should work, but it doesn't. Currently we don't check if the combinations of style/size/symbol are valid.

I think we should implement the Figure.scatter method, which doesn't have the style parameter.

@seisman
Copy link
Member

seisman commented Nov 8, 2024

I think we should implement the Figure.scatter method, which doesn't have the style parameter.

Draft PR at #3602.

@yvonnefroehlich
Copy link
Member Author

Another aspect to think about are Multi-parameter symbols. So far it seems, only single-parameter symbols can be used in the cases 2. and 4. (Multi-parameter symbols make no sense for case 3.).

@seisman
Copy link
Member

seisman commented Nov 8, 2024

Multi-parameter symbols needs more parameters than normal symbols. For example, for a rectangle, we need width and height, rather than size. Even in GMT, it's impossible to plot different multi-parameter symbols in a single call, because the number of columns required by different multi-parameter symbols are different.

For these multi-parameter symbols, matplotlib provides them as patches (https://matplotlib.org/stable/api/patches_api.html).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussions Need more discussion before taking further actions documentation Improvements or additions to documentation enhancement Improving an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants