(App Designer/geoplot ) How can I plot multiple outputs on the same graph from the same function?
7 次查看(过去 30 天)
显示 更早的评论
I want to plot multiple points with Input values. What I have is to take in the user inputs ( variable are northing and easting )
conversion is a function that takes in 2 arguments and give out the latitude and longitude that are used by geoscatter.
What i want to do is to take in another set of user inputs and still display the longitude and latidude of both plots. There is only one graph to be shown in the interface. The problem i am facing is when I click the plot button again, my previous plot disappear and my new plot is shown. I want to show both values.
I have tried checkbox, if i checked it, I want to store the values and still plot it. Is there a way to store the values everytime i click plot?
northing = str2double(app.NorthingEditField.Value);
easting = str2double(app.EastingEditField.Value);
% conversion(easting,northing) arrangement;
testdata= [easting,northing];
[testdatax,testdatay]= conversion(testdata(1),testdata(2)) ;
gx = geoaxes(app.Panel);
app.plotdata = geoscatter(gx,testdatax,testdatay,'ro','filled');
geolimits([1.345 1.35],[103.6 104.04])
geobasemap(gx,"streets")
hold on
% if app.CheckBox.Value
% testdata1= [easting,northing];
% [testdatax1,testdatay1]= EN2LatLon(testdata1(1),testdata1(2)) ;
% gx = geoaxes(app.Panel);
% app.plotdata = geoscatter(gx,testdatax1,testdatay1,'blue','filled');
% geolimits([1.345 1.35],[103.6 104.04]) ;
% geobasemap(gx,"streets");
% end
0 个评论
回答(1 个)
Anshika Chourasia
2021-12-28
Hi,
“hold” function is useful for retaining current plot when adding new plots. Instead of using hold on command, specify the geoaxes as an input argument to the “hold” function to resolve the issue.
2 个评论
Anshika Chourasia
2022-1-7
One possible workaround could be to use global vectors for storing northing-easting values and every time "Plot" button is pressed append the current northing/easting values to the respective global vector. In this way previous values will be retained along with newer values in the vectors, and then plot them using "geoplot" with all the avaliable data entries. Following links may prove helpful to understand the procedure in detail:
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Geographic Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!