Hi. I have a plot without an axis and I want to add a background around my plot. I want to do something like this plot in a picture
t=0:0.1:10;
y=sin(t);
plot(t,y);
xlim([-1,11]);
ylim([-1.1,1.1]);
axis off
set(gcf,'InvertHardCopy','off','Color','white');
saveas(gcf,'plot_test.jpg','jpeg')
plot_test.jpg

 채택된 답변

madhan ravi
madhan ravi 2018년 12월 15일

1 개 추천

t=0:0.1:10;
hFig = figure;
y=sin(t);
plot(t,y);
color = get(hFig,'Color');
set(gca,'XColor',color,'YColor',color,'TickDir','out')

댓글 수: 1

linus shen
linus shen 2020년 2월 7일
That's a great answer. However, I was still able to see the axis even though it's very faint. Alternatively, you can set color = 'none', and it might work better.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

질문:

2018년 12월 15일

댓글:

2020년 2월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by