Plot 2D mesh data by coloured temperature

18 views (last 30 days)
Hi all, I have imported mesh solution data from FLUENT into Matlab, and would like to plot a graph with Y and Z distance on the axes, and with each point coloured as per the temperature associated with each mesh point (e.g. red for hottest points, blue for coldest etc). This allows me to accurately display and explain my findings at a fluid outlet.
I've seen this kind of plot before but I have no idea what it's called. Can anyone help?
Thanks, Alex

Accepted Answer

Walter Roberson
Walter Roberson on 4 Dec 2015
mesh(Y, Z, Temperature)
colormap(hot)
See however http://blogs.mathworks.com/steve/2014/10/20/a-new-colormap-for-matlab-part-2-troubles-with-rainbows/ for reasons why you might prefer the new parula colormap rather than hot
  5 Comments
Mike Garrity
Mike Garrity on 4 Dec 2015
Ah, mesh requires the data to be gridded. We were discussing some of the options over on this thread. You should also look at the doc for the griddata function.
Alex
Alex on 4 Dec 2015
Edited: Alex on 4 Dec 2015
Thanks Mike, I'll look into that. Appreciate it!
Edit: I have achieved the desired results. I also looked at this, which clarified how to use the scatter command to its fullest.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!