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 non-geographic plots to projection gallery #728

Merged
merged 7 commits into from
Dec 14, 2020
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
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
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()