Skip to content

Commit

Permalink
Add non-geographic plots to projection gallery (#728)
Browse files Browse the repository at this point in the history
* Add cartesian.py
* Add polar.py
  • Loading branch information
willschlitzer authored Dec 14, 2020
1 parent 6434b55 commit 47fbf9c
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
21 changes: 21 additions & 0 deletions examples/projections/nongeo/cartesian.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"""
Cartesian
=========
``Xwidth/[height]``: Give the ``width`` of the figure and the optional argument ``height``.
"""
import pygmt

fig = pygmt.Figure()
fig.plot(
# The ``x`` and ``y`` parameters are used to plot lines on the figure.
x=[3, 9, 2],
y=[4, 9, 37],
pen="3p,red",
# ``region`` sets the x and y ranges or the Cartesian figure.
region=[0, 10, 0, 50],
# The argument ``WSne`` is passed to ``frame`` to put axis labels only on the left and bottom axes.
projection="X15c/10c",
frame=["af", "WSne"],
)
fig.show()
22 changes: 22 additions & 0 deletions examples/projections/nongeo/polar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""
Polar
=====
``Pwidth``: Give the ``width`` of the figure.
"""
import pygmt

fig = pygmt.Figure()
fig.plot(
# x inputs are the theta values for a polar plot.
x=[180, 120, 270, 60, 0],
# y inputs are the radius values for a polar plot.
y=[15, 35, 15, 35, 15],
pen="2p,blue",
# The region values are theta-min/theta-max/radius-min/radius-max.
region=[0, 360, 0, 40],
projection="P15c",
frame=["afg"],
)
fig.show()

0 comments on commit 47fbf9c

Please sign in to comment.