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

Add a tutorial for plotting vectors #1070

Merged
merged 92 commits into from
Apr 2, 2021
Merged

Add a tutorial for plotting vectors #1070

merged 92 commits into from
Apr 2, 2021

Conversation

noorbuchi
Copy link
Contributor

@noorbuchi noorbuchi commented Mar 17, 2021

In this pull request, we plan to add a tutorial to plot different types of vectors. This includes steps for:

  1. Styling the vector arrowheads using an already existing guide here
  2. Creating the 3 main types of vectors supported (Cartesian, Circular, and Geographic)
  3. Using different types of data to create the vectors: (start point and endpoint, or start point angle and magnitude)

We are open to adding different types of examples as we get more feedback on this PR so please let us know if you'd like to see more/different variations.

These changes are being developed in response to issue #892 which requested this documentation. We agree that adding a tutorial would be very helpful for new users who want to learn how to plot vectors using PyGMT.

Our current progress: We created a copy of lines.py with existing examples and we plan to follow a similar format but with vector examples. As of opening this PR, we have a draft of 2 examples, one is cartesian and the other is circular, which we are still revising.

We really appreciate any feedback we can get on this PR. The goal is to have an easy-to-understand and comprehensive tutorial for creating vectors using PyGMT.

Fixes #892

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If adding new functionality, add an example to docstrings or tutorials.

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash commands are:

  • /format: automatically format and lint the code
  • /test-gmt-dev: run full tests on the latest GMT development version

@welcome
Copy link

welcome bot commented Mar 17, 2021

💖 Thanks for opening this pull request! 💖

Please make sure you read our contributing guidelines and abide by our code of conduct.

A few things to keep in mind:

  • If you need help writing tests, take a look at the existing ones for inspiration. If you don't know where to start, let us know and we'll walk you through it.
  • All new features should be documented. It helps to write the docstrings for your functions/classes before writing the code. This will help you think about your code design and results in better code.
  • No matter what, we are really grateful that you put in the effort to do this! 🎉

@michaelgrund michaelgrund added the documentation Improvements or additions to documentation label Mar 17, 2021
examples/tutorials/vectors.py Outdated Show resolved Hide resolved
examples/tutorials/vectors.py Outdated Show resolved Hide resolved
examples/tutorials/vectors.py Outdated Show resolved Hide resolved
examples/tutorials/vectors.py Outdated Show resolved Hide resolved
@noorbuchi
Copy link
Contributor Author

@seisman this should be it for our final changes for now. Please let me know if there is anything else you'd like us to add. I left one comment unresolved because I thought it would be a nice idea to add 2 examples to explain the +s and -S= it's just not feasible at the moment and maybe it could be added later.

Copy link
Member

@seisman seisman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@noorbuchi Great work! Just a few small suggestions and I'm OK with this PR.

examples/tutorials/vectors.py Outdated Show resolved Hide resolved
examples/tutorials/vectors.py Outdated Show resolved Hide resolved
examples/tutorials/vectors.py Outdated Show resolved Hide resolved
examples/tutorials/vectors.py Outdated Show resolved Hide resolved
examples/tutorials/vectors.py Outdated Show resolved Hide resolved
examples/tutorials/vectors.py Outdated Show resolved Hide resolved
@noorbuchi
Copy link
Contributor Author

@seisman great! I'll be adding those in few minutes

@seisman seisman added the final review call This PR requires final review and approval from a second reviewer label Apr 2, 2021
@noorbuchi
Copy link
Contributor Author

@seisman Just added your requested changes! everything should be OK. This has been a great community to work with, we will likely start working on another issue in this project very soon.

@seisman
Copy link
Member

seisman commented Apr 2, 2021

@noorbuchi Could you please also click the "Update branch" button so that this branch is up-to-date with our master branch?

image

@core-man It would be great if you can give this PR a final review, but please only suggest small changes if possible. For any big changes, you can still leave your comments here, but we will most likely work on them in a separate RP.

@seisman seisman changed the title Add Vector Plotting Tutorial Add a tutorial for plotting vectors Apr 2, 2021
@noorbuchi noorbuchi requested a review from core-man April 2, 2021 04:03
examples/tutorials/vectors.py Outdated Show resolved Hide resolved
examples/tutorials/vectors.py Outdated Show resolved Hide resolved
examples/tutorials/vectors.py Outdated Show resolved Hide resolved
examples/tutorials/vectors.py Outdated Show resolved Hide resolved
examples/tutorials/vectors.py Outdated Show resolved Hide resolved
examples/tutorials/vectors.py Outdated Show resolved Hide resolved
examples/tutorials/vectors.py Outdated Show resolved Hide resolved
examples/tutorials/vectors.py Outdated Show resolved Hide resolved
examples/tutorials/vectors.py Outdated Show resolved Hide resolved
examples/tutorials/vectors.py Outdated Show resolved Hide resolved
@core-man
Copy link
Member

core-man commented Apr 2, 2021

Looks great to merge this PR. Thanks a lot, @noorbuchi @nathandloria @cklima616 for the great tutorial. I think a lot of PyGMT users will learn a lot from it. Please see the above minor comments.

@noorbuchi
Copy link
Contributor Author

@core-man thanks again for the review. I just added those changes so everything should be set for now.

@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label Apr 2, 2021
@seisman seisman merged commit c05c975 into GenericMappingTools:master Apr 2, 2021
@welcome
Copy link

welcome bot commented Apr 2, 2021

🎉🎉🎉 Congrats on merging your first pull request and welcome to the team! 🎉🎉🎉

Please open a new pull request to add yourself to the AUTHORS.md file. We hope that this was a good experience for you. Let us know if there is any way that the contributing process could be improved.

@michaelgrund
Copy link
Member

Great work! Thanks for the contribution.

@maxrjones maxrjones mentioned this pull request Jun 20, 2021
13 tasks
sixy6e pushed a commit to sixy6e/pygmt that referenced this pull request Dec 21, 2022
Co-authored-by: Nathan Loria <[email protected]>
Co-authored-by: Claire Klima <[email protected]>
Co-authored-by: Claire <[email protected]>
Co-authored-by: Nathandloria <[email protected]>
Co-authored-by: Megan Munzek <[email protected]>
Co-authored-by: Yao Jiayuan <[email protected]>
Co-authored-by: Dongdong Tian <[email protected]>
Co-authored-by: Meghan Jones <[email protected]>
Co-authored-by: Michael Grund <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a tutorial for plotting vectors
7 participants