Personalising contour plot, map colour scheme
Show older comments
Hi,
I have 2 sets of data, which when subtracted will give me the absolute performance of a system. Therefore there will be positive and negative values. These values are then plotted on a contour plot to understand which is best. I would like to personalise the colour bar with my own colour scheme as shown below:
-10 to -2: blue, -2 to 2: white, 2 to 10: red.
I would also like the colours to shade with change of magnitude - so the blue starts at dark blue from -10 to light blue to -2, then white between -2 and 2 and light red to dark red from 2 to 10.
I have already managed to plot the contour plot but need to change the colour map.
Matlab code
figure contourf(N_X3,N_Y3,N_Z3,50,'edgecolor','none') %N_X3 is the x axis 1x9 matrix N_Y3 is the y axis 7x1 matrix and N_Z3 is the z axis 7x9 matrix
title(d);
colormap cool %map colour style
xlabel('Peak Period (t)');
ylabel('Heading (deg)');
c = colorbar('southoutside');
c.Label.String = ('MSI%'); %This is how you label the colourbar
Accepted Answer
More Answers (0)
Categories
Find more on Blue in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

