.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_scatterdata.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_scatterdata.py: ========================================= Plot the 1D ScatterData ========================================= This example shows how to plot the 1D ScatterData object. I use a CO2 data file from the Antarctic EDC ice core (https://doi.pangaea.de/10.1594/PANGAEA.472488) as an example. The following features are used: #. Load the data (which just download from Pangaea without any modification) #. Plot the raw data #. Plot the interpolated data (based on cubic spline interpolation) #. Plot the rolling averaged data .. GENERATED FROM PYTHON SOURCE LINES 18-41 .. image-sg:: /auto_examples/images/sphx_glr_plot_scatterdata_001.png :alt: plot scatterdata :srcset: /auto_examples/images/sphx_glr_plot_scatterdata_001.png :class: sphx-glr-single-img .. code-block:: Python from cgeniepy.table import ScatterData import matplotlib.pyplot as plt # Load data url = "https://doi.pangaea.de/10.1594/PANGAEA.472488" edc_co2 = ScatterData(url) edc_co2.set_index(['Gas age']) fig = plt.figure(figsize=(5, 4)) ax = fig.add_subplot(111) # Plot the raw data edc_co2.plot(var='CO2', ax=ax, label='Raw Data', kind='scatter', edgecolor='black', facecolor='none', marker='o') # # Plot the interpolated data (based on cubic spline interpolation) interpolated_data = edc_co2.interpolate(var='CO2') interpolated_data.plot(var='CO2', ax=ax, label='Interpolated', kind='line') ax.legend() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.395 seconds) .. _sphx_glr_download_auto_examples_plot_scatterdata.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_scatterdata.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_scatterdata.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_scatterdata.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_