.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_data_from_netcdf_with_custom_vars_example.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_data_from_netcdf_with_custom_vars_example.py: Data From Netcdf Example with Custom Variables ============================================== How to use the data_from_netcdf function to load data from a netcdf file. We also show how to include custom_vars into data with data_from_netcdf We also plot a hovmoller plot of m_pressure. .. GENERATED FROM PYTHON SOURCE LINES 12-25 .. image-sg:: /auto_examples/images/sphx_glr_plot_data_from_netcdf_with_custom_vars_example_001.png :alt: plot data from netcdf with custom vars example :srcset: /auto_examples/images/sphx_glr_plot_data_from_netcdf_with_custom_vars_example_001.png :class: sphx-glr-single-img .. code-block:: Python from gerg_plotting import data_from_netcdf, ScatterPlot # Read in the data from a netcdf file data = data_from_netcdf("example_data/sample_glider_data.nc", interp_glider=True,custom_vars='m_pressure') # Set the label for the custom variable to look better data.custom_variables['m_pressure'].label = 'Mission Pressure' # Plot the data scatter = ScatterPlot(data) scatter.hovmoller('m_pressure') scatter.save('example_plots/data_from_netcdf_with_custom_vars_example.png',bbox_inches='tight') .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.552 seconds) .. _sphx_glr_download_auto_examples_plot_data_from_netcdf_with_custom_vars_example.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_data_from_netcdf_with_custom_vars_example.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_data_from_netcdf_with_custom_vars_example.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_data_from_netcdf_with_custom_vars_example.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_