Defining RGB color in curve fitting

조회 수: 11 (최근 30일)
Sarah Fergione
Sarah Fergione 2015년 7월 27일
편집: Jon 2015년 7월 27일
I want to customize the color of my plots and error bars. When I enter 'r' for example where the [R G B] values are, the color shows up perfectly fine. When replaced with the RGB value, the connecting curve is no longer present on the graph. What do I need to change to make the line re-appear?
Thanks
<<
>>
hold on
h1 = scatter(X,Y1);
set(h1,'MarkerEdgeColor',[.204,.098,.055],'MarkerFaceColor',[.204,.098,.055]);
csp = csape( X, Y1, 'periodic' );
fnplt(csp,[.204,.098,.055]);
s1 = errorbar(X, Y1, Z1,'.');
set(s1,'Color',[.204,.098,.055]);
h2 = scatter(X,Y2);
set(h2,'MarkerEdgeColor',[.596,.192,.153],'MarkerFaceColor',[.596,.192,.153]);
csp = csape( X, Y2, 'periodic' );
fnplt(csp,[.596,.192,.153]);
s2 = errorbar(X, Y2, Z2,'.');
set(s2,'Color',[.596,.192,.153]);
h3 = scatter(X,Y3);
set(h3,'MarkerEdgeColor',[.749,.318,.106],'MarkerFaceColor',[.749,.318,.106]);
csp = csape( X, Y3, 'periodic' );
fnplt(csp,[.749,.318,.106]);
s3 = errorbar(X, Y3, Z3,'.');
set(s3,'Color',[.749,.318,.106])
xlim([0 220]);
ax = gca;
ax.XTick = [0 24 48 72 168 192 216];
ylim([10000 10000000]);
ay = gca;
ay.YScale = 'log';
xlabel('Hours') % x-axis label
ylabel('CFU/mL') % y-axis label
title ('R.pickettii growth in various solutions')

답변 (1개)

Jon
Jon 2015년 7월 27일
편집: Jon 2015년 7월 27일
I don't see in the help file for fnplt that you can specify a color (though you must not be getting an error...)
You could try
f1 = fnplt(csp);
set(f1,'linecolor',[your values]);

카테고리

Help CenterFile Exchange에서 Linear and Nonlinear Regression에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by