필터 지우기
필터 지우기

How can I create axis labels with subscripts and greek letters?

조회 수: 57 (최근 30일)
Connor Sherod
Connor Sherod 2018년 7월 25일
댓글: Walter Roberson 2018년 7월 25일
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.

답변 (1개)

Giridharan Kumaravelu
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
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
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 CenterFile Exchange에서 Labels and Annotations에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by