We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3022282 commit f14ea73Copy full SHA for f14ea73
pygmt/accessors.py
@@ -3,6 +3,7 @@
3
"""
4
import xarray as xr
5
from pygmt.exceptions import GMTInvalidInput
6
+from pygmt.figure import Figure
7
from pygmt.src.grdinfo import grdinfo
8
9
@@ -72,3 +73,19 @@ def gtype(self, value):
72
73
f"Invalid coordinate system type: {value}, should be a boolean of "
74
"either 0 for Cartesian or 1 for Geographic"
75
)
76
+
77
+ def imshow(self):
78
+ """
79
+ Image plot of 2D DataArray.
80
81
+ Examples
82
+ --------
83
84
+ >>> from pygmt.datasets import load_earth_relief
85
+ >>> grid = load_earth_age()
86
+ >>> grid.gmt.imshow()
87
88
+ fig = Figure()
89
+ fig.grdimage(self._obj, frame=True)
90
+ fig.colorbar()
91
+ fig.show()
0 commit comments