Change specific colours in pcolour
Afficher commentaires plus anciens
Hi, i'm trying to change the background of my graphs so that NaN values come up as black.
I have tried putting the following commands in various places through out the plot program such as:
whitebg([0 0 0])
set(gca, 'Color', 'Black')
but nothing seems to work. I also need to change the colour of the 0 values to white. here is the plotting part of the program
figure('Visible','off') % observation u
plot1=pcolor(times, heights, obsArrayU);
set(plot1,'edgecolor','none');
title(['Observation of u for station: ' radarStr ' from ' ...
sDayStr '-' sMonthStr '-' sYearStr ' to ' eDayStr '-' eMonthStr '-' eYearStr ...
' for ' model ' model'], 'FontWeight','bold')
set(gca, 'Clim', [-50, 50]); colorbar;
colormap(jet(20)); xlabel(['Time ' timeLabelName]);
ylabel('Height (km)'); set(gca, 'XTick', xTickPoints);
set(gca, 'XTickLabel', date); %xticklabel_rotate;
n=get(gca,'YTick');
set(gca,'yticklabel',sprintf('%.1f |',n/1000'));
print('-djpeg', ...
['Images/obs__u_radar_' radarStr '_' model '_frm_' sYearStr sMonthStr sDayStr...
'_to_' eYearStr eMonthStr eDayStr])
here is a link to the outcome: https://www.dropbox.com/s/0rzlcrxl6ex3h4g/obs__u_radar_03019_ukv_frm_20110101_to_20110107.jpg
any help would be appreciated, thank you
Réponse acceptée
Plus de réponses (1)
Jason Baxter
le 11 Août 2012
0 votes
Catégories
En savoir plus sur Red dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!