Effacer les filtres
Effacer les filtres

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

1 vue (au cours des 30 derniers jours)
Conal Doyle
Conal Doyle le 3 Juil 2013
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'?

Réponses (0)

Catégories

En savoir plus sur Colormaps dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by