In reading "from bright yellow to dark red instead of from dark blue to dark red", I think the easiest solution is to use a limited (and flipped) version of the built-in colormap hot
instead of the (pre-R2014b) default jet
. You could limit jet
but may run into other colors unwittingly.
For example:
defaultHot = hot(100); % changing 100 changes the number of gradations
colormap(defaultHot(80:-1:1,:)); % flip so smaller values are bright yellow
Only taking the first 80 rows from the hot
colormap function gives a rich yellow for the small value color. Taking the entire colormap results in a hot white (which you may or may not like).
Further, an easy way to add a bounding black line is to use the ('MarkerEdgeColor','k')
scatter
name-value pair. Consider the sample input
x = rand(n,1);
y = rand(n,1);
z = exp(-20*((x-1/2).^2+(y-1/2).^2));
scatter(x,y,19,z,'filled','MarkerEdgeColor','k');
colorbar(); % Show colorbar
caxis([0,1]); % Explicitly stretch the colormap to cover the entire range
This produces the plot
