.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_model_comparisons_taylordiagram.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_model_comparisons_taylordiagram.py: =========================== Customise Taylor Diagram =========================== This examples shows hot to plot multiple model results in one figure For simplicity, we separate different variables of the sample model into two lists and we pretend that they are two models. .. GENERATED FROM PYTHON SOURCE LINES 11-43 .. image-sg:: /auto_examples/images/sphx_glr_plot_model_comparisons_taylordiagram_001.png :alt: plot model comparisons taylordiagram :srcset: /auto_examples/images/sphx_glr_plot_model_comparisons_taylordiagram_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none /home/docs/checkouts/readthedocs.org/user_builds/cgeniepy/envs/stable/lib/python3.12/site-packages/cgeniepy/model.py:58: UserWarning: No gemflag is provided, use default gemflags: [biogem] warnings.warn("No gemflag is provided, use default gemflags: [biogem]") /home/docs/checkouts/readthedocs.org/user_builds/cgeniepy/envs/stable/lib/python3.12/site-packages/cgeniepy/skill.py:422: UserWarning: *c* argument looks like a single numeric RGB or RGBA sequence, which should be avoided as value-mapping will have precedence in case its length matches with *x* & *y*. Please use the *color* keyword-argument or provide a 2D array with a single row if you intend to specify the same RGB or RGBA value for all points. self.ax.scatter(np.arccos(correlation), std,*args, **kwargs) | .. code-block:: Python import matplotlib.pyplot as plt import cgeniepy from cgeniepy.skill import ArrComparison, TaylorDiagram sample_model = cgeniepy.sample_model() bgc_data = cgeniepy.load_obs('worjh2') genie_var = ['ocn_O2', 'ocn_ALK','ocn_PO4', 'ocn_temp', 'ocn_sal', 'ocn_SiO2', 'ocn_DIC'] obs_var = ['o2', 'alk', 'po4', 'temp', 'sal', 'si', 'dic'] arr_comps = [] for x,y in zip(genie_var, obs_var): obs = bgc_data[y] model = sample_model.get_var(x).isel(time=-1) tmp = ArrComparison(model.data.to_numpy(), obs.to_numpy(), label=y) arr_comps.append(tmp) # you can set the figure size and dpi here fig = plt.figure(dpi=200,figsize=(4,4)) # Assume this your first model td = TaylorDiagram(arr_comps[:3]) td.setup_ax(crmse_contour=True,fig=fig) td.plot(s=100, cmap=plt.get_cmap('tab10',3)) # Assume this your second model td.ac = arr_comps[3:6] td.extract_data() # refresh the data td.plot(s=100, cmap=plt.get_cmap('tab10',3),linestyle='--') plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.256 seconds) .. _sphx_glr_download_auto_examples_plot_model_comparisons_taylordiagram.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_model_comparisons_taylordiagram.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_model_comparisons_taylordiagram.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_model_comparisons_taylordiagram.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_