diff --git a/utilities/MTEX/PlotIPFColoredSection.m b/utilities/MTEX/PlotIPFColoredSection.m index 12570f50..60b2f863 100644 --- a/utilities/MTEX/PlotIPFColoredSection.m +++ b/utilities/MTEX/PlotIPFColoredSection.m @@ -56,7 +56,11 @@ if (numphases == 2) figure(fig_counter); ebsd(pname1).color = [0 0 0]; - ebsd(pname2).color = [1 1 1]; + % only assign white color to second phase if ebsd object is multiphase + second_phase_present = any(ebsd.phase == 2, 'all'); + if (second_phase_present) + ebsd(pname2).color = [1 1 1]; + end plot(ebsd); OutputFileName = strcat(BaseFileName,'_SolidifiedPhases.png'); export_fig(OutputFileName,'-r150');