How can I create axis labels with subscripts and greek letters?
35 次查看(过去 30 天)
显示 更早的评论
I am trying to replicate the style of this graph (see attached image), the only parts I am missing are the axis labels and filling in the shaded area between the lines. I've looked into LaTex but havent been able to recreate the same style with it.
0 个评论
回答(1 个)
Giridharan Kumaravelu
2018-7-25
编辑:Giridharan Kumaravelu
2018-7-25
The following should work:
y1 = 1:10;
y2 = (1:10)*0.5;
x = 1:10;
plot(y1); hold on;
plot(y2);
xlabel('Size (\delta)');
ylabel('\kappa');
X = [x, fliplr(x)];
inBetween = [y1, fliplr(y2)];
fill(X, inBetween, 'g');
The above code gave me the following output
3 个评论
Giridharan Kumaravelu
2018-7-25
编辑:Giridharan Kumaravelu
2018-7-25
Try plotting the last plot after shading as shown below:
y1 = 1:10;
y2 = (1:10)*0.5;
ymean = (y1+y2)/2;
x = 1:10;
plot(y1); hold on;
plot(y2);
xlabel('Size (\delta)');
ylabel('\kappa');
X = [x, fliplr(x)];
inBetween = [y1, fliplr(y2)];
fill(X, inBetween, 'g');
plot(ymean);
You would get something like this
Walter Roberson
2018-7-25
Alternately, one of:
- uistack() to move the relative drawing order of the objects; or
- set the mean line to have a slightly positive Z component so that it is above the shaded area; or
- set alphadata on the shaded area so that the line is visible through it.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Labels and Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!