How can I add another label with plotPosition in Automated Driving tool box?

조회 수: 2(최근 30일)
QIAO WANG
QIAO WANG 2021년 11월 13일
답변: Pranjal Kaura 2021년 11월 24일
Hi seniors,
I'm trying to use plotPosition in Automated Driving tool box to plot a few coordinates. I have successfully plotted these points with relevant labels besides them as depicted in the figure but I want to plot another vector of labels associated with each point and intend to put these labels any position not overlapping the current ones. Please could anyone instruct me to solve this? Any suggestions are appreciated!

답변(1개)

Pranjal Kaura
Pranjal Kaura 2021년 11월 24일
Hey Qiao,
It is my understanding that you want to add more than 1 label to the points plotted using 'plotPosition'. You can use the 'text' function to add textual description to data points. You can set the 'geoplayer' object axes as the axes to plot on and pass lattitude and longitude values of the points followed by the text/label you want to add.
You can refer the following code snippet:
data = load('geoRoute.mat');
player = geoplayer(data.latitude(1),data.longitude(1),12);
plotRoute(player,data.latitude,data.longitude);
plotPosition(player,data.latitude(1),data.longitude(1));
text(player.Axes, data.latitude(1),data.longitude(1), "LABEL", 'Color','red','FontSize',7);
Hope this helps!

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by