Dear all,
Here is my plot:
I want to convert it to something like this picture below that I found on google:
Here is my code: I want to plot, plot() and area() as regular and plot bar() like the picture above (inverse)
h = plot(t);set(h,'linewidth',1);set(gca,'xtick',1:12,... 'xticklabel',{'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'});newcolors = ['#77AC30'; '#0072BD';'#D95319';'#7E2F8E';'#EDB120';'#4DBEEE';'#A2142F'];colororder(newcolors);set(0,'DefaultLegendAutoUpdate','off');box ongrid onxlim([1 12]);ylim([0 70]);xticks(1:12);hold on hh = area(Obs,'LineStyle','none');hh.FaceAlpha = 0.4;hh.FaceColor = [0 0 0];set(gca, 'YGrid', 'off', 'XGrid', 'off')%VVVVV % HERE is second plot % VVVV
hold on % plot bar chart
cc = bar(t);
I tried:
ax1_pos = ax1.Position; % position of first axes
ax2 = axes('Position',ax1_pos,... 'XAxisLocation','top',... 'YAxisLocation','right',... 'Color','none');
But it isn't accomplished well.
Thank you all.
Best Answer