Thanks, Andrew! Works well with contourf. Any idea how I can make this
work with pcolormesh?
ValueError: The coordinate 'longitude' is multi-dimensional and cannot
be used in a cell-based plot.
On 28.05.2014 19:38, Andrew Dawson wrote:
> AuxCoords are the way to go for 2D coordinates. When you come to
> plotting note that the 2D plot functions take a 'coords' keyword which
> you can use to specify which coordinates on the cube are used to
> represent each dimension of the plot (in x-y order). You should be able
> to use this to plot your data with 2D coordinates properly I think. I
> can't test it right now but I think something like this should work:
>
> |
> iplt.contourf(cube,coords=['lon2d','lat2d'])
> |
>
> where 'lon2d' and 'lat2d' are the names of your 2d coordinates. Give it
> a go, and shout back if it doesn't work!
>
> On Wednesday, 28 May 2014 17:36:18 UTC+1, Andreas Hilboll wrote:
>
> Hi iris gurus,
>
> how can I create a cube with 2d lat/lon coordinates (i.e., I have 2 2d
> arrays of shape x,y holding latitudes and longitudes, and they do not
> define a regular grid)? A DimCoord only accepts 1d points, and when I
> add latitude and longitude as 2d AuxCoord instances, then the cube
> doesn't seem to "recognize" the coordinates (i.e., when I plot the cube
> using cartopy, the lats/lons of the data are wrong and seem to
> correspond to the indices of the data array).
>
> Thanks for your insight!
> Andreas.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Iris" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
scitools-iri...@googlegroups.com
> <mailto:
scitools-iri...@googlegroups.com>.
> For more options, visit
https://groups.google.com/d/optout.
--
-- Andreas.