Associate colormap to temperature of plot x,y data
Show older comments
Hello,
I'm trying to find a way to map temperature (degC) to a color map, such as 'jet', so that when I plot a x,y graph, I can plot the color of that line to represent the temperature of the data
for example, my temperature range would be -50degC to +150degC.
on one figure plot, I could plot three lines of measurement data, one taken at cold (-30degC), another at room temperature (+23degC), and the last at hot (+75degC). The colors of the plot lines would be blue, green, and red.
I would use some kind of lookup to the color map, based on the known temperature of the data (data file includes temperature in the header).
this would be a 2D plot, so instead of e.g. figure;plot(x,y,'k-');hold on;plot(a,b,'r-') it would be
% lookup temperature of dataset x,y and dataset a,b tempxy = -15; tempab = +45; % find this temperature and associated a color to them colorxy = [0 0 0.789]; colorab = [0 0.456 1]; figure;plot(x,y,'color',colorxy) %etc
Can anyone please advise on the best way to do this?
Thank you.
Accepted Answer
More Answers (2)
Phil Newman
on 11 Apr 2016
0 votes
Categories
Find more on Color and Styling 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!