Labeling Plots inside Function

조회 수: 19 (최근 30일)
Kyle
Kyle 2011년 7월 28일
I have a function that creates a plot, but when I call it in my main script, I don't get any labels. Is there a way I can assign the labels within the function (without doing it in the main script)?
function [] = myplot(data)
xlabel('x');
ylabel('y');
title('title');
plot(data);

채택된 답변

the cyclist
the cyclist 2011년 7월 28일
I would try putting the labeling commands after the plotting command.
  댓글 수: 1
Paulo Silva
Paulo Silva 2011년 7월 28일
or create first the axes, label it and plot the data

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Axis Labels에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by