pcolorm ignores lines of data

2 views (last 30 days)
Anna S
Anna S on 28 Aug 2020
Commented: Anna S on 28 Aug 2020
I try to plot data. Unfortunately, the region is the composition of three single maps. The edges of these maps seem to produce funny effects as can be seen in the figure.
The data set is continuous, but nevertheless by zooming in some data seems to miss.
These plots are produced by using pcolorm(lat,lon,field). Below, the last picture shows the same data set plotted with plotm, to check that the data is existing.
How can i fix this?
I am using matlab 2019a

Accepted Answer

Bjorn Gustavsson
Bjorn Gustavsson on 28 Aug 2020
The way I've understood pcolor (which I assume pcolorm is a modification of) makes a colour-patch with corners at [x(n,m),y(n,m)],[x(n+1,m),y(n+1,m)],[x(n+1,m),y(n+1,m+1)] and [x(n,m+1),y(n,m+1)], using the intensity/color from Z(n,m) (this is using shading 'flat'). Sometimes that is an OK behaviour. However when I have some small-sized data that I considere centred at the coordinate-points I have to adjust the input to pcolor to take into account the function's behaviour by repeating the last row and column of the data and modify the [x,y] coordinates by shifting a "half dx and a half dy" and add a last column and row to both. Maybe that's part of your missing-data problem?
HTH
  5 Comments
Bjorn Gustavsson
Bjorn Gustavsson on 28 Aug 2020
Anna, I can imagine that when you try to merge the data you will run into problems with the different data-sets having different sizes? If that's the case you might get somewhere by using scatteredInterpolant - but this would be a bit of a cumbersome detour. Another option might be to use scatterm instead of pcolorm, it might work OK - primarily if you're currently in a "facing a deadline and something gots to work now" situation.
Anna S
Anna S on 28 Aug 2020
Yes, I think the scatterm solution is working best for my problem because the data is not shifted - thank you for that hint!

Sign in to comment.

More Answers (0)

Tags

Products

Community Treasure Hunt

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

Start Hunting!