You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
How can i remove irrelevant information in plotting
5 views (last 30 days)
Show older comments
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 Comments
Voss
on 19 Feb 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
on 19 Feb 2022
Edited: Walter Roberson
on 19 Feb 2022
Ok, i hope i can explain my problem here,
Estimated_Lat = 180 / pi * lat; %Dimension of (1x17341)
Estimated_Long = 180 / pi * lon; %Dimension of (1x17341)
figure;
plot(Estimated_Long, Estimated_Lat,'x','Linewidth',0.5);
hold on
Ground_Truth = xlsread('27');
G_Long = Ground_Truth(:,1); (43x1)
G_Lat = Ground_Truth(:,2); (43x1)
plot(G_Long,G_Lat,'-x','Linewidth',2)
hold off
ylabel('Latitude, [deg]','FontSize', 13);
xlabel('Longitude, [deg]','FontSize', 13);
title('Trajectory of vehicle with position close to Lane level','FontSize', 14)
legend('Estimated trajectory', 'Centre nodes of True trajectory','best')
% To find error between estimated and true trajectory, i used difference as shown below
Error_dataLat = G_Lat - 180 / pi * lat; (43x17341)
Error_dataLong = G_Long - 180 / pi * lon; (43x17341)
plot(Error_dataLong,Error_dataLat)
[ This is the image i have shared below, where instead of only highleghted area more of noise is available ]
Voss
on 19 Feb 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
on 20 Feb 2022
Hi, there thank you for explaining me the problem. I used your code and have figure, but is it possible for you to explain what actually figure is visualizing. I mean what is figure telling about the errors plotted ?
Voss
on 20 Feb 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
on 20 Feb 2022
Thank you verymuch for your valuable time, your help was very useful for me. :)
Answers (0)
See Also
Categories
Find more on Marine and Underwater Vehicles in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)