Why does my plot change color from default blue to black after savefig()?

3 ビュー (過去 30 日間)
florian schertenleib
florian schertenleib 2020 年 10 月 21 日
編集済み: florian schertenleib 2020 年 11 月 3 日
Everytime I save figures of simple line plots using savefig() without any additional variables, it’s black instead of blue when I reopen the file. Any good reason why it is like that?
line(((1:length(stimsignal))/fs)*1000,stimsignal);
xlabel('Time (first 250 ms)');
ylabel('Signal amplitude (relative)');
title('Signal in the Time Domain');
savefig('figure1.fig')
Many thanks!
EDIT: it's the line() function that screws up the colors when you try to save them in a .fig; Use plot() instead and it's fine!
  2 件のコメント
Ameer Hamza
Ameer Hamza 2020 年 10 月 21 日
This is not the expected behavior. Can you write a small code sample of how you are creating, saving, and loading the file?
florian schertenleib
florian schertenleib 2020 年 10 月 22 日
Loading file by double click.

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

回答 (1 件)

Arpit Bhatia
Arpit Bhatia 2020 年 10 月 28 日
Hi Florian,
I was not able to reproduce this error by generating the fig file based on the above code snippet and then opening it by double clicking. However, you may be able to resolve your issue by referring to the following MATLAB Answers post:
If this does not fix the issue, could you possibly provide the complete MATLAB script that you are using?

カテゴリ

Help Center および File ExchangeView and Analyze Simulation Results についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by