Clear Filters
Clear Filters

Labeling Plots inside Function

1 view (last 30 days)
Kyle
Kyle on 28 Jul 2011
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);

Accepted Answer

the cyclist
the cyclist on 28 Jul 2011
I would try putting the labeling commands after the plotting command.
  1 Comment
Paulo Silva
Paulo Silva on 28 Jul 2011
or create first the axes, label it and plot the data

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!