Defining RGB color in curve fitting
11 views (last 30 days)
Show older comments
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')
0 Comments
See Also
Categories
Find more on Linear and Nonlinear Regression in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!