Temperature Profile Plot on Cylinder
Show older comments
I have a set of data in a 1x18 array. This data will be used to create a temperature profile on a cylindrical shaped object. I need to somehow create a plot of this data with a colormap that displays the colors for different temperatures. Everything I have seen so far has not allowed me to 1) change the colorbar to the correct axis and 2)manipulate this data to display in a cylindrical or circle form. The end goal I had in sight was to animate this profile over time, for which I have a lot more data. If it isn't possible to plot this data in 3D form, I would be able to plot 2 separate 2D plots representing the cylinder's front and side view. Any help is much appreciated.
Accepted Answer
More Answers (1)
Walter Roberson
on 29 Jan 2018
0 votes
"change the colorbar to the correct axis"
colorbar() accepts an axes as the first argument, if you are referring to which plot the colorbar is to be associated with.
If you are referring to where colorbar shows up on the plot, then colorbar() takes a location parameter such as 'SouthOutside' . If that is not enough control then you can pass a 'Position' name/value pair, and a 'Units' name/value pair: note that coordinates are relative to the figure not to the axes (because the colorbar is typically drawn outside the axes.)
"manipulate this data to display in a cylindrical or circle form"
There are multiple ways of handling this.
One of the easiest ways to use pcolor(), which permits you to pass a matrix of X coordinates and a matrix of Y coordinates for each pixel. However this is really only 2D coordinates and adapting this to 3D in a way that you could rotate your plots is probably not worth it.
pcolor() is really just surface() followed by view(2). You can instead use surface() directly, specifying X, Y, and Z coordinates. If your data is intended to represent "pixels" then you would typically want to use texturemap . Or instead of doing it yourself you could all warp() to do the texture mapping for you.
You can also texture map a patch() object, but there are fewer wrapper interfaces like warp() for doing so. The main reason you might prefer patch() to surface() for something like this is that surface() associates colors with the center of faces -- so if you had 20 x 40 array then you would get 19 x 39 faces. patch() gives you more flexibility about how color is determined, including different ways of configuring interpolation of color.
Categories
Find more on Orange 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!

