Help plotting satellite data?

I'm plotting satellite data taken from an HDF5 file. The following are the parameters
latitude(51x2429) -> lat
longitude(51x2429) -> lon
longwave(51x2429) -> long
I'm using the following code
pcolor(lon,lat,long)
shading interp
colorbar
I get this image
This is what I want to get
I want to remove the bars

 Accepted Answer

geoshow(lat(:), lon(:), long(:),'DisplayType','ImageMap');

7 Comments

Davin David
Davin David on 29 Oct 2021
Edited: Davin David on 29 Oct 2021
I got like this
geoshow(lat(:),lon(:),long(:),'DisplayType','ImageMap')
Error using parseRasterInputs>parseQualifiers (line 138)
Expected input number 5, DISPLAYTYPE, to match one of these
values:
'surface', 'contour', 'mesh', 'texturemap', 'image'
The input, 'imagemap', did not match any of the valid values.
Error in parseRasterInputs (line 37)
parseQualifiers(mapfilename, numel(dataArgs), paramPairs{:});
Error in georastershow (line 82)
parseRasterInputs('geoshow', varargin{:});
Error in geoshow (line 248)
h = showFcn(varargin{:});
>> geoshow(lat(:),lon(:),long(:),'DisplayType','contour')
Error using repmat
Requested 59109x59109 (26.0GB) array exceeds maximum array size
preference (23.8GB). This might cause MATLAB to become
unresponsive.
Error in meshgrid (line 61)
xx = repmat(xrow,size(ycol));
Error in parseContourInputs>checkLatLonZ (line 132)
[lon, lat] = meshgrid(lon, lat);
Error in parseContourInputs (line 42)
R = checkLatLonZ(lat, lon, Z);
Error in contourm (line 99)
[Z, R, levelList, pvpairs] = parseContourInputs(varargin);
Error in georastershow>geocontour (line 126)
[~, h] = contourm(lat, lon, Z, 'Parent', ax, HGpairs{:});
Error in georastershow>displayGeoRasterData (line 113)
h = geocontour(ax, Z, SpatialRef, HGpairs);
Error in georastershow (line 90)
h0 = displayGeoRasterData(ax, displayType, Z, SpatialRef, HGpairs);
Error in geoshow (line 248)
h = showFcn(varargin{:});
Related documentation
>> geoshow(lat(:)',lon(:)',long(:)','DisplayType','image')
Warning: Error creating or updating Surface
Error in value of property ZData
Array is wrong shape or size
>> geoshow(lat(:)',lon(:)',double(long(:)'),'DisplayType','image')
Warning: Error creating or updating Surface
Error in value of property ZData
Array is wrong shape or size
>> geoshow(lat(:),lon(:),long(:))
Warning: Error creating or updating Surface
Error in value of property ZData
Array is wrong shape or size
That's my bad. It should be texture map.
geoshow(lat(:), lon(:), long(:),'DisplayType','texturemap');
Also, make sure lat, lon, and long all have the same number of elements.
This is what I got
>> geoshow(latcorr,loncorr,longrow,'DisplayType','texturemap');
Warning: Error creating or updating Surface
Error in value of property ZData
Array is wrong shape or size
lat, lonLatitude or longitude data
numeric vector | M-by-N numeric array
Latitude or longitude data, specified as a numeric vector or an M-by-N numeric matrix.
  • lat and lon are vectors when used with the syntax geoshow(lat,lon).
  • lat and lon are 2-D arrays when used with the geoshow(lat,lon,Z) syntax, the geoshow(lat,lon,I) syntax, or the geoshow(lat,lon,X,cmap) syntax. If lat and lon are matrices, they represent coordinate arrays or a geolocation array in geographic coordinates, and must be the same size as Z, I, or X. If I is an RGB image, lat and lon must be matrices that match the first two dimensions of the image.
This means that you cannot use the (:) form when using three inputs. You would use
geoshow(lat, lon, long)
possibly adding a 'DisplayType' option.
Davin David
Davin David on 29 Oct 2021
Edited: Davin David on 29 Oct 2021
Thanks a lot man. It worked perfectly.
Just wondering if I can add the world map in the background too for a bit of clarity.
Sorry, I do not know much about mapping stuff.
No problem thanks for all the help.

Sign in to comment.

More Answers (1)

Walter Roberson
Walter Roberson on 29 Oct 2021
Your longitude data "wraps" at 360 degrees.
I speculate that the array starts at about 45 or 50 degrees, increases to 360 degrees, and wraps back to 0 degrees and continues upwards.
If geoshow() does not work for you, then you will need to circshift() your arrays to align them so that the longitude does not wrap back. Or else you need to add 360 to all longitude values after the wrap to get it to display properly.

Products

Release

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!