.. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_packages_scikit-image_auto_examples_plot_check.py: Creating an image ================== How to create an image with basic NumPy commands : ``np.zeros``, slicing... This examples show how to create a simple checkerboard. .. image:: /packages/scikit-image/auto_examples/images/sphx_glr_plot_check_001.png :class: sphx-glr-single-img .. code-block:: python import numpy as np import matplotlib.pyplot as plt check = np.zeros((8, 8)) check[::2, 1::2] = 1 check[1::2, ::2] = 1 plt.matshow(check, cmap='gray') plt.show() **Total running time of the script:** ( 0 minutes 0.011 seconds) .. _sphx_glr_download_packages_scikit-image_auto_examples_plot_check.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download :download:`Download Python source code: plot_check.py ` .. container:: sphx-glr-download :download:`Download Jupyter notebook: plot_check.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_