(App Designer/geoplot ) How can I plot multiple outputs on the same graph from the same function?
14 views (last 30 days)
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;
[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])
% 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]) ;
Anshika Chourasia on 28 Dec 2021
“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.
Please refer this link for more information on specifying hold state for a particular axis.