Skip to content

Commit f072f3a

Browse files
committed
Added tutorial template in file.
1 parent 1e6623f commit f072f3a

File tree

1 file changed

+54
-34
lines changed

1 file changed

+54
-34
lines changed
Lines changed: 54 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"""
2-
Plotting Date Time Charts
3-
================
2+
Plotting Datetime Charts
3+
========================
44
5-
Plotting vectors is handled by :meth:`pygmt.Figure.basemap`.
5+
Plotting datetime charts is handled by :meth:`pygmt.Figure.basemap`.
66
77
.. note::
88
@@ -13,41 +13,61 @@
1313
To save the figure, use ``fig.savefig("figname.pdf")`` where ``"figname.pdf"``
1414
is the desired name and file extension for the saved figure.
1515
"""
16-
# sphinx_gallery_thumbnail_number = 6
16+
# sphinx_gallery_thumbnail_number = 0
1717

1818
import numpy as np
1919
import pygmt
2020

21-
#########################################################################################
22-
# Plot Cartesian Vectors
21+
########################################################################################
22+
# Date - Time Formats into `fig.basemap`
2323
# ----------------------
2424
#
25-
# Create a simple Cartesian vector using a starting point through
26-
# ``x``, ``y``, and ``direction`` parameters.
27-
# On the shown figure, the plot is projected on a 10cm X 10cm region,
28-
# which is specified by the ``projection`` parameter.
29-
# The direction is specified
30-
# by a list of two 1d arrays structured as ``[[angle_in_degrees], [length]]``.
31-
# The angle is measured in degrees and moves counter-clockwise from the
32-
# horizontal.
33-
# The length of the vector uses centimeters by default but
34-
# could be changed using :meth:`pygmt.config`
35-
# (Check the next examples for unit changes).
25+
# Explanation of supported formats.
26+
27+
########################################################################################
28+
# `numpy.datetime64`
29+
30+
31+
# Code
32+
33+
########################################################################################
34+
# `pandas.DatetimeIndex`
35+
36+
# Code
37+
38+
########################################################################################
39+
# `xarray.DataArray`
40+
41+
# Code
42+
43+
########################################################################################
44+
# Raw date-time in ISO format
45+
46+
# Code
47+
48+
########################################################################################
49+
# Python built-in: `datetime.datetime`
50+
51+
# Code
52+
53+
########################################################################################
54+
# Python built-in: `datetime.date`
55+
56+
# Code
57+
58+
########################################################################################
59+
# Using `pygmt.info` to get the min/max time for passing into the `region` parameter,
60+
# but note potential bug at #597.
61+
# ----------------------
3662
#
37-
# Notice that the ``v`` in the ``style`` parameter stands for
38-
# vector; it distinguishes it from regular lines and allows for
39-
# different customization. ``0c`` is used to specify the size
40-
# of the arrow head which explains why there is no arrow on either
41-
# side of the vector.
42-
43-
fig = pygmt.Figure()
44-
fig.plot(
45-
region=[0, 10, 0, 10],
46-
projection="X10c/10c",
47-
frame="ag",
48-
x=2,
49-
y=8,
50-
style="v0c",
51-
direction=[[-45], [6]],
52-
)
53-
fig.show()
63+
# Explanation of supported parameters + bug.
64+
65+
# Code
66+
67+
########################################################################################
68+
# Setting Primary and Secondary Time Axes
69+
# ----------------------
70+
#
71+
# Explanation.
72+
73+
# Code

0 commit comments

Comments
 (0)