How can i remove irrelevant information in plotting
Afficher commentaires plus anciens
Hello, i have plotted for error but seems like i have been getting a lot of noise in image. i want to only get the "Orange" highlighted path instead of shaded "grey-black" part. Any suggestions enclosing image below.

9 commentaires
Voss
le 19 Fév 2022
Please share the code and data necessary to generate that plot.
Abdul Sajeed Mohammed
le 19 Fév 2022
Voss
le 19 Fév 2022
Sorry, I don't read emails.
Perhaps you could construct a similar case (i.e., one that exhibits the same problematic behavior) using made-up data, and share that. Doing that may also give you insight on how to fix the problem.
Abdul Sajeed Mohammed
le 19 Fév 2022
Modifié(e) : Walter Roberson
le 19 Fév 2022
OK, so the figure is showing just Error_dataLat vs Error_dataLong (because hold is turned off after plotting the previous lines), and each of these are matrices of size 43-by-17341. When you use plot() with matrices, you get one line for each column of the matrix, so that's 17341 lines in this case (each with 43 data points). The line colors cycle through the axes' ColorOrder, and the lines are all on top of one another, so that's why the plot looks like a shaded grey-black region like that.
Rather than plotting those matrices as 17341 lines, maybe it is better to visualize them as two surfaces, something like this (I don't have your data, so I used random numbers but you can just comment out my surf(randn(...)) lines and uncomment the preceding lines that use your variables Error_dataLat/Error_dataLong, and see how that looks):
figure()
subplot(2,1,1);
% surf(Error_dataLat,'EdgeColor','none');
surf(randn(43,17341),'EdgeColor','none');
view([0 90]);
colorbar();
title('Lat Error');
subplot(2,1,2);
% surf(Error_dataLong,'EdgeColor','none');
surf(randn(43,17341),'EdgeColor','none');
view([0 90]);
colorbar();
title('Long Error');
Abdul Sajeed Mohammed
le 20 Fév 2022
Voss
le 20 Fév 2022
Recall, the errors are defined like this:
Error_dataLat = G_Lat - 180 / pi * lat;
Error_dataLong = G_Long - 180 / pi * lon;
So, yellow color in the surfaces means relatively high positive error (meaning G_Lat > 180 / pi * lat, or, respectively, G_Long > 180 / pi * lon) and blue means high (in magnitude) negative error (so G_Lat < 180/pi*lat, resp., lon).
However, usually error is defined to be in terms of absolute value of the difference if we don't care whether it's positive or negative and we just care about the magnitude, e.g.:
Error_dataLat = abs(G_Lat - 180 / pi * lat);
Error_dataLong = abs(G_Long - 180 / pi * lon);
and that might be more instructive to look at. In that case yellow will be high error using the new definition (i.e., high in magnitude, positive or negative, using the old definition) and blue will be low error (that is, closer to 0, so a better match).
I don't know what the 2 dimensions of the lat/long matrices represent, so I can't comment on what the "spatial" variation across the surface in X or Y might mean.
Abdul Sajeed Mohammed
le 20 Fév 2022
Voss
le 20 Fév 2022
Glad I could help!
Réponses (0)
Catégories
En savoir plus sur Interact with Maps dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

