why does not MATLAB print/save properly?

1 回表示 (過去 30 日間)
Vahid
Vahid 2012 年 10 月 11 日
I have developed a very straightforward MATLAB code whose sets the background color of the plot to 'blue' and the color of the line to 'white':
x=-10:10;
y=x.^2;
figPath='C:\test.jpg';
% plotting the figure
hFig=figure('PaperType','A4');
line(x,y,'color','w');
box off;
set(gca,'Color','b') ; %color of the area behind the plot
print(hFig,'-djpeg','-r600',figPath);
but what is printed is different from what I have already set, I mean the color of the area behind the plot is white (I set it to blue in my code) and the color of line is black while I set it to white in the code.
I would be grateful if anybody could help me to resolve the problem.
Many thanks in advance, _V

採用された回答

Walter Roberson
Walter Roberson 2012 年 10 月 11 日
See the figure property InvertHardcopy
  1 件のコメント
Vahid
Vahid 2012 年 10 月 12 日
編集済み: Walter Roberson 2012 年 10 月 12 日
thanks a lot!
figure('InvertHardcopy','off');

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by