Skip to content
Advertisement

__init__() missing 1 error while Adding a Discrete Colorbar to a ContourPlot

I was trying to replicate the Contour Plot: Original Contour Plot

for a new set of interpolated data found on interpolated.nc I got the error:

JavaScript

Nevetheless, I realized that the error was related to the plt.colorbar(ax=ax, shrink=.98) line, so I was wondering if I could get any help in order to solve this issue, since I need the colourbar in order to do the analysis for a report. I would really appreciate any insights in the problem!

The code I used to make this plot is the following:

JavaScript

The dr_nested2 variable is an xarray.DataArray containing the information of the nc file.

JavaScript

Advertisement

Answer

Instead of

JavaScript

It should be this;

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement