-
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 a gallery example for plotting Cartesian, circular and geographic vectors #950
Conversation
/format |
Hi @kmaterna, welcome back! Appreciate your Pull Request, just wanted to note that we added a gallery example for vectors yesterday (#890) at https://www.pygmt.org/dev/gallery/line/vector-heads-tails.html#sphx-glr-gallery-line-vector-heads-tails-py. So sorry if you missed that! If you want, you can take a look at https://github.com/GenericMappingTools/pygmt/blob/master/examples/gallery/line/vector-heads-tails.py and see if there's anything you would like to add to that example. Or, you can make a full tutorial for plotting vectors instead (see #892). Ping @michaelgrund who might be interested in working together on a full vector plotting tutorial. |
Actually, forget what I said above. Issue #892 also mentions we should add a tutorial for "How to plot Cartesian, circular and geographic vectors/arrows". Should be good to focus on that, I see your example covers plotting geographic arrows over continental US. |
Oh wow, that's wonderful. Funny timing. I missed that. Feel free to close the PR, looks like the tutorial has it all covered. The only thing that might be nice is the +z option with direction=[dx,dy] for us geodesists who didn't know about all of PYGMT's features. Definitely not urgent. I might play around and try another PR later. Thanks to Michael for the nice demo. |
Yes, or keep. Up to maintainers. +1 for the idea of an example with cartesian vectors. |
@michaelgrund might be able to advice. I'd say keep this open for a while, it's easier to modify an already open Pull Request than to start a new one! |
Hey @kmaterna, great that you work on this. Besides the example provided in https://github.com/GenericMappingTools/pygmt/blob/master/examples/gallery/line/vector-heads-tails.py (which only shows different options for heads and tails) in #892 we decided to add another gallery example showing cartesian, circular and geographic vectors. So you covered 1/3 😉 Maybe you can add the two remaining ones in any way? Here's some content I pre-produced for the circular vectors (not comitted so far) you may add:
Additonally, a full tutorial on vectors is planned. |
Nice, I like those circular vectors. By cartesian, do you mean regular vectors (i.e., an x-y plot with vectors given by magnitude/angle)? They're no different from geographic vectors except they're not on maps, right? I can work on something that shows all 3. |
I think what you're plotting (using Geographic vectors (using See https://docs.generic-mapping-tools.org/latest/cookbook/features.html#the-drawing-of-vectors for details. |
/format |
Nice example! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made some minor suggestions, all in all the example looks good to me.
/format |
Co-authored-by: Dongdong Tian <[email protected]>
Co-authored-by: Dongdong Tian <[email protected]>
The example looks pretty good and is close to merging. @GenericMappingTools/python @GenericMappingTools/python-maintainers Do you have any further comments? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is coming along really nicely. Just a few recommendations on documenting what the various modifiers in the style string represent (e.g. +e
, etc).
Co-authored-by: Wei Ji <[email protected]>
Co-authored-by: Wei Ji <[email protected]>
Co-authored-by: Wei Ji <[email protected]>
/format |
Co-authored-by: Wei Ji <[email protected]>
Co-authored-by: Wei Ji <[email protected]>
Thanks @kmaterna for this amazing example (and to @michaelgrund and @seisman for the helpful review suggestions)! Feel free to suggest any new ideas if you have any, and do consider adding your name to AUTHORS.md when you have time 😄 |
… vectors (GenericMappingTools#950) Gallery figure showing how to plot Cartesian/Circular/Geographic vector lines. Example is situated over the continental US, showing how lines of different styles ranging from straight Cartesian lines to Circular arcs and Curved geographic ones (e.g. lines connecting different cities) can be plotted. Co-authored-by: Michael Grund <[email protected]> Co-authored-by: Dongdong Tian <[email protected]> Co-authored-by: Wei Ji <[email protected]>
Contributing a gallery plot with vectors on a map. Feel free to make any and all changes. I thought it would be good to have vector example since not everyone knows the new 'plot' options in GMT6.