![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/192574/image.png)
How can I create axis labels with subscripts and greek letters?
17 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/192573/image.png)
0 comentarios
Respuestas (1)
Giridharan Kumaravelu
el 25 de Jul. de 2018
Editada: Giridharan Kumaravelu
el 25 de Jul. de 2018
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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/192574/image.png)
3 comentarios
Giridharan Kumaravelu
el 25 de Jul. de 2018
Editada: Giridharan Kumaravelu
el 25 de Jul. de 2018
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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/192804/image.png)
Walter Roberson
el 25 de Jul. de 2018
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.
Ver también
Categorías
Más información sobre Labels and Annotations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!