.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_set_vmin_vmax.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_plot_set_vmin_vmax.py: Set vmin and vmax for Plot =============================== This example shows how to set the vmin and vmax for a variable for a plot. .. GENERATED FROM PYTHON SOURCE LINES 9-11 Load the sample data ----------------------------------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 11-21 .. code-block:: Python from gerg_plotting import data_from_netcdf,ScatterPlot data = data_from_netcdf('example_data/sample_glider_data.nc' ,interp_glider=True,bounds_padding=1.5) # Show the default unsliced data plotter_data = ScatterPlot(data) plotter_data.hovmoller('salinity') plotter_data.show() plotter_data.save('example_plots/set_vmin_vmax_default.png',bbox_inches='tight') .. image-sg:: /auto_examples/images/sphx_glr_plot_set_vmin_vmax_001.png :alt: plot set vmin vmax :srcset: /auto_examples/images/sphx_glr_plot_set_vmin_vmax_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 22-24 Set the vmin and vmax for the salinty variable ----------------------------------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 24-31 .. code-block:: Python data.salinity.vmin = 34.5 data.salinity.vmax = 37.1 # Show the default unsliced data plotter_data = ScatterPlot(data) plotter_data.hovmoller('salinity') plotter_data.show() plotter_data.save('example_plots/set_vmin_vmax.png',bbox_inches='tight') .. image-sg:: /auto_examples/images/sphx_glr_plot_set_vmin_vmax_002.png :alt: plot set vmin vmax :srcset: /auto_examples/images/sphx_glr_plot_set_vmin_vmax_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 3.085 seconds) .. _sphx_glr_download_auto_examples_plot_set_vmin_vmax.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_set_vmin_vmax.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_set_vmin_vmax.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_set_vmin_vmax.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_