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

조회 수: 1 (최근 30일)
Conal Doyle
Conal Doyle 2013년 7월 3일
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