Increase colour variation in a 2D scatter graph

2 views (last 30 days)
I am making a scatter graph of my data and am using one column of my data to colour code my points, so I am using the following code:
scatter(x,y,[],v,'filled')
However I would like to play with the colour option a little bit and change it so that I have a wider variation in colour and also change the colour scheme to blue yellow and red. How can I do this? I thought about squaring the vector that I use so as to show up a greater difference between points? Any other suggestions?

Answers (1)

Image Analyst
Image Analyst on 9 May 2015
One of the optional inputs to scatter is a list of colors for every marker. Use that. You can make them up with some custom code, or you can use one of the standard functions like hsv(), jet(), winter(), etc. Pass in the number of data markers into those color map creating functions.

Categories

Find more on Discrete Data Plots 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!