.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/indiv_funcs/extend.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_indiv_funcs_extend.py: Extend ====== Demonstrate how to extend past the limits of the data. .. GENERATED FROM PYTHON SOURCE LINES 7-26 .. rst-class:: sphx-glr-horizontal * .. image-sg:: /auto_examples/indiv_funcs/images/sphx_glr_extend_001.png :alt: random data :srcset: /auto_examples/indiv_funcs/images/sphx_glr_extend_001.png, /auto_examples/indiv_funcs/images/sphx_glr_extend_001_2_00x.png 2.00x :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/indiv_funcs/images/sphx_glr_extend_002.png :alt: extend along $x$ :srcset: /auto_examples/indiv_funcs/images/sphx_glr_extend_002.png, /auto_examples/indiv_funcs/images/sphx_glr_extend_002_2_00x.png 2.00x :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/indiv_funcs/images/sphx_glr_extend_003.png :alt: extend along $y$ :srcset: /auto_examples/indiv_funcs/images/sphx_glr_extend_003.png, /auto_examples/indiv_funcs/images/sphx_glr_extend_003_2_00x.png 2.00x :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out .. code-block:: none 1: random data |||(None, None) 2: extend along $x$ |||(None, None) 3: extend along $y$ |||(None, None) | .. code-block:: Python from pylab import * from pyspecdata import * from numpy.random import normal, seed from matplotlib.ticker import NullLocator, MultipleLocator, FormatStrFormatter rcParams['image.aspect'] = 'auto' # needed for sphinx gallery # sphinx_gallery_thumbnail_number = 3 seed(7919) d = nddata(normal(size=10000)+1j*normal(size=10000), [100,100], ['y','x']).labels( {'x':r_[0:1:100j], 'y':r_[0:0.1:100j]}) with figlist_var() as fl: fl.next('random data') fl.image(d) d.extend('x',1.5) fl.next('extend along $x$') fl.image(d) d.extend('y',-0.05,fill_with=1) fl.next('extend along $y$') fl.image(d) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 2.360 seconds) .. _sphx_glr_download_auto_examples_indiv_funcs_extend.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: extend.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: extend.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_