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
Changes from 1 commit
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
5941e33
create vectors file from lines, add example
Mar 13, 2021
ff9e0f8
Fix code snippet syntax
Mar 13, 2021
65e8607
Update index.rst to include vectors.py in Guide
noorbuchi Mar 13, 2021
69b9296
Added circular vector example to vectors.py
nathandloria Mar 17, 2021
5bae9b6
Merge branch 'master' into master
noorbuchi Mar 17, 2021
b333429
re-formatted vectors.py using makefile
nathandloria Mar 17, 2021
4593cd3
Changed verbage in vectors.py for ploting circular vectors
nathandloria Mar 19, 2021
e54db50
Attempt to fix formatting.
cklima616 Mar 19, 2021
adb3b66
Edited vector specification to accomadate code style
nathandloria Mar 19, 2021
39ef01e
Merge branch 'master' into master
cklima616 Mar 19, 2021
5d2c272
Duplicate examples. Change format
Mar 19, 2021
d3d489a
add four total examples
Mar 19, 2021
fb4c82b
change formatting to use # symbol instead of """
Mar 20, 2021
9d87fb7
change more formatting
Mar 20, 2021
3803d44
Merge branch 'master' into Cartesian
noorbuchi Mar 20, 2021
c1dee1d
fromat using black
Mar 20, 2021
066dffb
add two new examples. Description needed
Mar 20, 2021
d2ab6f9
Fix style issues
Mar 20, 2021
87e3da1
Merge branch 'master' into master
noorbuchi Mar 21, 2021
c3f9cbb
Add unit descriptions
Mar 21, 2021
bba843a
add description to vectors over maps
Mar 21, 2021
afc2662
Merge pull request #2 from noorbuchi/Cartesian
noorbuchi Mar 21, 2021
a34570f
update method reference to use :meth:
Mar 21, 2021
6cf3419
remove whitespace to fix style issue
Mar 21, 2021
6015371
remove italics, clarify projection parameter
noorbuchi Mar 22, 2021
d7aaad5
change example projection to 10 X 4
Mar 22, 2021
bf53a8d
Updated diameter to radius to fix previous mistake
nathandloria Mar 23, 2021
01a87e6
Merge branch 'master' into circular
nathandloria Mar 23, 2021
ad213ea
Add some geographic vectors to test
Mar 24, 2021
5b73109
try sphinx reference fix
Mar 24, 2021
4321fb5
Updated example description
nathandloria Mar 24, 2021
a3ec8cd
Erase lines and move around geo vectors
Mar 24, 2021
ecbed60
Added multiple vector example
nathandloria Mar 24, 2021
74556ab
Added multiple vector example
nathandloria Mar 24, 2021
94c8968
Added style description to paragraph rather than a comment.
nathandloria Mar 25, 2021
7d626ac
delete first untitled file
noorbuchi Mar 25, 2021
d5a320c
Delete Untitled1.ipynb
noorbuchi Mar 25, 2021
e9f16fc
Delete Untitled.ipynb
noorbuchi Mar 25, 2021
0a2bc71
Merge branch 'master' into master
noorbuchi Mar 25, 2021
7249ac5
Added new example plotting two vectors using different units
nathandloria Mar 25, 2021
f0fa6ad
Add description and vector
Mar 25, 2021
16c3a7f
Merge branch 'geographic' of github.com:noorbuchi/pygmt into geographic
Mar 25, 2021
4b4a094
Fix descriptions
Mar 25, 2021
ca85046
fix typos, remove imports, fix graph
Mar 25, 2021
1f451bb
Merge pull request #1 from noorbuchi/circular
nathandloria Mar 25, 2021
e3ad0ca
Merge branch 'master' into geographic
noorbuchi Mar 25, 2021
7c4d4ed
Merge pull request #3 from noorbuchi/geographic
noorbuchi Mar 25, 2021
6276e2a
Removed extra # from plot circular vectors heading
nathandloria Mar 25, 2021
43ebc6f
Re-formatted vectors.py with black
nathandloria Mar 25, 2021
afd6267
Fixed bug where fig was not reset after #2
nathandloria Mar 25, 2021
031c597
Add gallery thumbnail number, remove TODO
noorbuchi Mar 25, 2021
5e10413
Update examples/tutorials/vectors.py with contributor suggestion
cklima616 Mar 26, 2021
1f0b273
fix backtics and add other requested changes
Mar 26, 2021
0680c5d
Merge branch 'master' into master
noorbuchi Mar 26, 2021
cba9457
add . and other grammar fixes
Mar 26, 2021
ac502e4
Merge branch 'master' of github.com:noorbuchi/pygmt
Mar 26, 2021
0a78355
add grammar fixes
Mar 26, 2021
f9a7a9c
Update examples/tutorials/vectors.py
nathandloria Mar 26, 2021
908b983
Update examples/tutorials/vectors.py
nathandloria Mar 26, 2021
cf578fb
Updated formatting of examples/tutorials/vectors.py
nathandloria Mar 26, 2021
1cb8a39
Update examples/tutorials/vectors.py
nathandloria Mar 26, 2021
fd2e152
Removed extra line after line 436
nathandloria Mar 26, 2021
cbca270
Update examples/tutorials/vectors.py
noorbuchi Mar 26, 2021
2f90190
reduce projection size
Mar 26, 2021
e0aaed5
Merge branch 'master' of github.com:noorbuchi/pygmt
Mar 26, 2021
b3426b6
Remove backticks from numpy. Add angle description
Mar 27, 2021
562e95f
Apply suggestions from code review
noorbuchi Mar 27, 2021
0559e9e
switch style and direction order
Mar 29, 2021
5a43914
switch area_thress and shorelines
Mar 29, 2021
87db34e
fix first paragraph
Mar 29, 2021
e9cf9cd
Fix plot, remove unnecessary numpy
Mar 30, 2021
1e9aea0
Revise wording around numpy
Mar 30, 2021
79a01bc
Add styling description
Mar 30, 2021
31ca200
Update examples/tutorials/vectors.py
cklima616 Mar 31, 2021
6dd5a25
Update examples/tutorials/vectors.py
nathandloria Mar 31, 2021
cdf4cfc
Update examples/tutorials/vectors.py
nathandloria Mar 31, 2021
1bb8301
Update examples/tutorials/vectors.py
nathandloria Mar 31, 2021
f479599
Update examples/tutorials/vectors.py
nathandloria Mar 31, 2021
e10a7ee
Made changes to circular examples per @core-man reccomendations
nathandloria Mar 31, 2021
5a61cdf
re-formatted with black
nathandloria Mar 31, 2021
c6eadbe
MAde changes to comment section around lines 169
Mar 31, 2021
4629862
Fixed wording in paragraphs
Mar 31, 2021
196d6d0
Add general fixes and clarifications
Apr 2, 2021
c30015a
Add fixes, restructure order
Apr 2, 2021
5f97054
Remove doc link and unneeded example
Apr 2, 2021
92563cb
Add minor typo and comment fixes
Apr 2, 2021
541fed0
Add clarification to example, explain +s
Apr 2, 2021
38f68a6
Add minor typo fixes
Apr 2, 2021
8f4e2d6
Merge branch 'master' into master
noorbuchi Apr 2, 2021
4116816
Apply suggestions from code review
noorbuchi Apr 2, 2021
cce6ad9
Merge branch 'master' into master
noorbuchi Apr 2, 2021
39d61aa
Merge branch 'master' into master
noorbuchi Apr 2, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add clarification to example, explain +s
noorbuchi committed Apr 2, 2021
commit 541fed01df9d87f7edb1ff4bfba9ed4b3aef8215
22 changes: 14 additions & 8 deletions examples/tutorials/vectors.py
Original file line number Diff line number Diff line change
@@ -364,7 +364,10 @@
# Chicago. To style geographic
# vectors, use ``=`` at the begining of the ``style`` parameter.
# Other styling features such as vector stem thickness and head color
# can be passed into ``pen`` and ``color``parameters
# can be passed into ``pen`` and ``color``parameters.
noorbuchi marked this conversation as resolved.
Show resolved Hide resolved
#
# Note that the (**+s**) is added to use a startpoint and an endpoint
noorbuchi marked this conversation as resolved.
Show resolved Hide resolved
# to represent the vector instead of input angle and length.

point_1 = [-114.7420, 44.0682]
point_2 = [-87.6298, 41.8781]
@@ -389,11 +392,13 @@
fig.show()

########################################################################################
# The plotting of the geographic vectors when using latitude and longitude
# are labeled by having the coordinates displayed.
# An array is created so the vectors follow the one vector before it. You
# can diplay this array any way you want.

# Using the same technique shown in the previous example,
# multiple vectors can be plotted in a chain where the endpoint
# of one is the starting point of another. This can be done
# by adding the coordinate lists together to create this structure:
# ``[[start_latitude, start_longitude, end_latitude, end_longitude]]``.
# Each list within the 2D list contains the start and end information
# for each vector.

# Coordinate pairs for all the locations used.
noorbuchi marked this conversation as resolved.
Show resolved Hide resolved
ME = [-69.4455, 45.2538]
@@ -403,6 +408,9 @@
KC = [-94.5786, 39.0997]
CA = [-119.4179, 36.7783]

# Add array to piece together the vectors.
noorbuchi marked this conversation as resolved.
Show resolved Hide resolved
data = [ME + CHI, CHI + SEA, SEA + KC, KC + NO, NO + CA]

fig = pygmt.Figure()
fig.coast(
region=[-127, -64, 24, 53],
@@ -413,8 +421,6 @@
area_thresh=4000,
)

noorbuchi marked this conversation as resolved.
Show resolved Hide resolved
# Add array to piece together the vectors.
data = np.array([ME + CHI, CHI + SEA, SEA + KC, KC + NO, NO + CA])
fig.plot(
data=data,
style="=0.5c+ea+s",