0
votes

How can I change the default white for zero for the output of a contour plot to a different color in MATLAB?

longitude = [80 82 95]
latitude = [30 32 35]
temp = [0 0 0; 0 0 0; 0 0 0]
contourf(longitude,latitude,temp)

Thanks,

Amanda

1
see the help for colormap or caxis to see if they are useful.R. Schifini
running your example throws the warning that contourf won't draw anything. Is that intentional?Jonas

1 Answers

1
votes

The key seems to be in the "renderer/rendering" mode from the figure properties. It must be set to either 'painters' or 'zbuffer'. I am not an expert and I didn't understand how to set it by default. I changed it manually through the figure editor (click on the outer figure frame --> More properties --> Renderer) and then I clicked "generate code" from the menu bar to make a function that automatically creates all plots in the same way.