data labels in plot- in code

조회 수: 2 (최근 30일)
Eleanna Kritikaki
Eleanna Kritikaki 2019년 11월 2일
댓글: Eleanna Kritikaki 2019년 11월 2일
Hello,
So I am writing code that produces a plot with two different data vectors, and giving instructions about axes labels etc, like so
plot(times, Node1); %going to be a blue line
hold on;
plot(times, Node2); %going to be a red line
hold on;
plot(times,diff_N1_N2)
ylabel('phases')
xlabel('time')
title('Time evolution of oscillator phases and their phase difference');
hold off;
My question is, how do I add data labels to the different data types in the code? I can do that once the figure is produced, but the matlab documentation does not seem to have any relevant instructions for how to do that in the code.
Thank you!
  댓글 수: 2
KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 11월 2일
Are you asking different axes labels in the same figure?
Eleanna Kritikaki
Eleanna Kritikaki 2019년 11월 2일
Hello,
Thanks; I should have been clearer; I am talking about data labels that identify the different data types plotted and represented by a line each; example: on the picture attached, upper right corner.

댓글을 달려면 로그인하십시오.

채택된 답변

the cyclist
the cyclist 2019년 11월 2일
Use the legend command.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Grid Lines, Tick Values, and Labels에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by