(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!