-
Notifications
You must be signed in to change notification settings - Fork 224
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
Add examples for plotting lines #493
Comments
|
I'll work on this. |
I'm trying to figure out how to add a specific CPT, but I'm not getting it to plot on the actual line. I tried setting a specific CPT to |
Yeah it's complicated, took me a while to figure it out recently too. Try this for inspiration: import pygmt
import numpy as np
fig = pygmt.Figure()
fig.basemap(frame=["WSne", "af"], region=[20, 30, -10, 10])
pygmt.makecpt(cmap="batlow", series=[0, 10, 1])
x = np.arange(start=20, stop=30, step=0.2)
for zvalue in range(0, 10):
y = zvalue * np.sin(x)
fig.plot(x=x, y=y, cmap=True, zvalue=zvalue, pen=f"thick,+z,-")
fig.show() |
@weiji14 Impressive find, but that seems like a big step up in complexity from the rest of the tutorial. I've been out of geoscience for 8+ years so I don't keep up with what people want in their plots, but this seems out of place for a basic "How to plot lines" tutorial. My opinion is something like this belongs in a gallery example. |
@weiji14's example is pretty good and could be added to the gallery (https://www.pygmt.org/dev/gallery/index.html#lines). |
@weiji14 Are you planning on adding your code to the gallery? I can submit a pull request for it if you're too busy. |
I literally came up with that in 5 minutes 😅, but yeah, feel free to adapt it into the gallery. |
Sounds good! Didn't want to step on your toes; I'll type it up in the next day or so. |
There are some lines/arrows we may want to add in the gallery. See #493 (comment) |
So we still want more line examples?
Which one is on the top priority? @seisman |
I'm closing the issue, because I feel that the |
Description of the desired feature
There are already have nice tutorials for plotting data points of various sizes and colors, but no examples for plotting lines.
It would be good to add some examples showing
Unfortunately, PyGMT currently can't handle multi-segments data as in GMT. To plot multiple lines, we still have to call
fig.plot()
multiple times.The text was updated successfully, but these errors were encountered: