I have been tasked with making a plot with a couple variables of available data. I'm to make a normal 2D scatter plot of the data with respect to 2 of the variables given, easy enough. But then I'm supposed to color (from red to blue) each point according to a 3rd variable, which is a derivative of a couple other variables (getting convoluted yet?). When I asked what this is about I was told its supposed to be a spacecraft orbit around a planet, where x-axis is Kurth Phase (a moving Saturn SKR coordinate), y-axis invariant latitude. And the derivative spoken of earlier is supposed to be changes in the magnetic field readings taken with respect to latitude). So that with the end result you will have a line (of points where the data was taken) representing the spacecraft trajectory but colored to indicate how the magnetic field is changing to signify places where there is strong changes or weak changes.(adsbygoogle = window.adsbygoogle || []).push({});

When explained it makes sense to me, but I can't see how I'm supposed to code this. What steps do I take to color individual points according to some color scheme/variable?

**Physics Forums | Science Articles, Homework Help, Discussion**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# MATLAB Color Points According to Variable

**Physics Forums | Science Articles, Homework Help, Discussion**