.. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_plot_demo_hist2d.py: `hist2d <.core.hist2d>` demo ---------------------------- `hist2d <.core.hist2d>` can be used like `matplotlib.pyplot.hist2d`. See also: https://matplotlib.org/examples/pylab_examples/hist2d_log_demo.html .. rst-class:: sphx-glr-horizontal * .. image:: /gallery/images/sphx_glr_plot_demo_hist2d_001.png :class: sphx-glr-multi-img * .. image:: /gallery/images/sphx_glr_plot_demo_hist2d_002.png :class: sphx-glr-multi-img .. code-block:: python from matplotlib import pyplot import numpy import adaptiveheatmap pyplot.style.use("ggplot") x = numpy.exp(numpy.random.randn(100000)) y = numpy.random.randn(100000) ah = adaptiveheatmap.hist2d(x, y, bins=40, vmin=1) ah.relate_xyzq(5, 0) ah.figure.suptitle('adaptiveheatmap.hist2d') ah.ax_main.set_xlim(xmax=30) pyplot.figure() pyplot.hist2d(x, y, bins=40, vmin=1) pyplot.colorbar() pyplot.suptitle('pyplot.hist2d') pyplot.xlim(xmax=30) pyplot.show() **Total running time of the script:** ( 0 minutes 0.154 seconds) .. _sphx_glr_download_gallery_plot_demo_hist2d.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download :download:`Download Python source code: plot_demo_hist2d.py ` .. container:: sphx-glr-download :download:`Download Jupyter notebook: plot_demo_hist2d.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_