Hi, I have made the following contour plots using cdsplot.contour_plot:

with the following code:

fig_aug = ct.cdsplot.contour_plot(data_con_aug,fig = fig_pc_aug, contour_kwargs={'colors':'grey'},clabel_kwargs={'fontsize':'10', 'colors': 'r'},xlabel='Latitude',ylabel='Pressure [pa]',title='METOP - Humidity - Aug 2017 - zonal monthly mean -')

(The rest of it can be found at https://cds.climate.copernicus.eu/toolbox-editor/38981/use-case-1-)


Issue: The contour labels are not appearing even though I have set a fontsize and color in clabel_kwargs.

I hope someone can help.

thank you and stay healthy!


Best regards, 

Huayuan

2 Comments

  1. Dear Huayuan,

    The clabel_kwargs are actually only read if you specify contour_levels. Note that you should also specify the colors of each contour level in contour_levels_colors and not in contour_kwargs anymore.

    Here is a the modified workflow https://cds.climate.copernicus.eu/toolbox-editor/168/use-case-1 and the relevant code snipet below:


        fig_aug = ct.cdsplot.contour_plot(
            data_con_aug,
            fig = fig_pc_aug,
            contour_levels=[5., 10., 15.],
            contour_levels_colors=['grey', 'grey', 'grey'],
            clabel_kwargs = {'fontsize':'10', 'colors': 'r'},
            xlabel='Latitude',
            ylabel='Pressure [pa]',
            title='METOP - Humidity - Aug 2017 - zonal monthly mean -'
        )


    I hope this helps.

    Vivien

    1. Thanks for the help, Vivien!