MATLAB: Labeling Plots inside Function

label function

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);

Best Answer

I would try putting the labeling commands after the plotting command.