Skip to content

Commit e25ac4b

Browse files
author
Joe Hamman
committed
update docs and change yincrease back to true
1 parent d793e3a commit e25ac4b

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

doc/plotting.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,14 @@ and ``xincrease``.
158158
@savefig 2d_simple_yincrease.png width=4in
159159
air2d.plot(yincrease=False)
160160
161+
.. note::
162+
163+
We use :py:func:`xray.plot.pcolormesh` as the default two-dimensional plot
164+
method because it is more flexible than :py:func:`xray.plot.imshow`.
165+
However, for large arrays, ``imshow`` can be much faster than ``pcolormesh``.
166+
If speed is important to you and you are plotting a regular mesh, consider
167+
using ``imshow``.
168+
161169
Missing Values
162170
~~~~~~~~~~~~~~
163171

xray/plot/plot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ def _plot2d(plotfunc):
331331

332332
@functools.wraps(plotfunc)
333333
def newplotfunc(darray, x=None, y=None, ax=None, row=None, col=None,
334-
col_wrap=None, xincrease=None, yincrease=None,
334+
col_wrap=None, xincrease=True, yincrease=True,
335335
add_colorbar=True, add_labels=True, vmin=None, vmax=None,
336336
cmap=None, center=None, robust=False, extend=None,
337337
levels=None, colors=None, subplot_kws=None, **kwargs):
@@ -434,7 +434,7 @@ def newplotfunc(darray, x=None, y=None, ax=None, row=None, col=None,
434434
# For use as DataArray.plot.plotmethod
435435
@functools.wraps(newplotfunc)
436436
def plotmethod(_PlotMethods_obj, x=None, y=None, ax=None, row=None,
437-
col=None, col_wrap=None, xincrease=None, yincrease=None,
437+
col=None, col_wrap=None, xincrease=True, yincrease=True,
438438
add_colorbar=True, add_labels=True, vmin=None, vmax=None,
439439
cmap=None, colors=None, center=None, robust=False,
440440
extend=None, levels=None, subplot_kws=None, **kwargs):

xray/test/test_plot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ def test_imshow_called(self):
707707
self.assertTrue(self.imshow_called(self.darray.plot.imshow))
708708

709709
def test_xy_pixel_centered(self):
710-
self.darray.plot.imshow()
710+
self.darray.plot.imshow(yincrease=False)
711711
self.assertTrue(np.allclose([-0.5, 14.5], plt.gca().get_xlim()))
712712
self.assertTrue(np.allclose([9.5, -0.5], plt.gca().get_ylim()))
713713

0 commit comments

Comments
 (0)