How do I write a line for adding a text to my plot?
4 views (last 30 days)
Show older comments
Hi,
I am trying to add a text to my plot. I tried adding the following line to the code: text('k=28');
I also tried: txt= 'k=28';
Both lines didn't add the text , I am atatching my existing code below. This code is part of the function file.
fig = figure('position', utilities.centerFigPos(1500, 1200));
set(fig, 'Color', 'white', 'defaultLineLineWidth', 2, 'defaultAxesFontSize', 24);
ax = axes(fig);
scatter(ax,X,Y,'o');
line(ax, xFit, yFit);
ax.Title.String = 'Data';
ax.XScale = 'linear';
ax.YScale = 'log';
ax.XLim = [0,1];
ax.YLim = [yMin,1];
ax.YDir = 'reverse';
0 Comments
Answers (1)
See Also
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!