Using the same Colors for a Bar and a Plot graph?

1 次查看(过去 30 天)
figure hold all
subplot(2,2,1:2)
bar(PnL_Major);
title ('Evolution of PnL for Major pairs week by week');
xlabel('Time(Weeks)');
ylabel('PnL');
set(gca,'XTick',XTicks);
set(gca,'XTickLabel',XLabels);
legend('EURUSD','EURGBP','EURJPY','USDJPY','GBPUSD','USDCHF','USDCAD','AUDUSD','NZDUSD');
subplot(2,2,3)
h=plot(Volume_Major,'LineWidth',2);
title ('Evolution of Volume for Major pairs week by week');
xlabel('Time(Weeks)');
ylabel('Volume');
set(gca,'XTick',XTicks);
set(gca,'XTickLabel',XLabels);
legend('EURUSD','EURGBP','EURJPY','USDJPY','GBPUSD','USDCHF','USDCAD','AUDUSD','NZDUSD');
I want to able to use the same colors used by the function 'bar' in the function 'plot' as they both use different colormaps by default. Is there anyway of setting the 'plot' function so it will produce the exact same colors as plotted defaultly by the 'bar' function?
As far as I can tell, 'bar' uses colormap 'jet' and 'plot' uses colormap 'lines'?

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Colormaps 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by