scatter plot with narrowed color range
3 views (last 30 days)
Show older comments
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/197363/image.png)
Hi all,
below scatter plot has two variables plotted against each other and a third variable provides the color. For the third variables most values lie between 1 and 10 and only one value is at 30 (hence the colorbar range from 0-30).
Is there a way that I can shift the color range so I get more variations in color between 0 and 10?
Thanks in advance!
1 Comment
Accepted Answer
jonas
on 8 Oct 2018
Edited: jonas
on 8 Oct 2018
Here's a colorbar for you to give you an idea of how you can build your own. The colorscale is not very intuitive.
part1 = jet(200);
part2 = [linspace(part1(end,1),0,200)',zeros(200,2)];
cmap=[part1;part2];
colormap(cmap)
scatter(rand(1,100),rand(1,100),[],rand(1,100))
colorbar
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/197389/image.jpeg)
EDIT: slight improvement
More Answers (0)
See Also
Categories
Find more on Scatter Plots in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!