rotating contourf in r2014b
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Venkatessh
el 20 de Oct. de 2014
Comentada: Weimin Zhang
el 8 de Jul. de 2024
How to rotate contours generated using contourf command in MATLAB R2014b?
rotating using get(gca, 'Children') doesn't seem to work.
1 comentario
Respuesta aceptada
Mike Garrity
el 20 de Oct. de 2014
Sean's right. The rotate command only works on a few types of objects, and you probably want to try hgtransform instead.
That would look something like this:
g = hgtransform
contourf(peaks,'Parent',g)
set(g,'Matrix',makehgtform('zrotate',pi/3))
1 comentario
Weimin Zhang
el 8 de Jul. de 2024
The contourf plot roation works, thanks! However, after the rotation, the clabel text do not follow the contour lines's directions. Any cure?
Más respuestas (1)
Sean de Wolski
el 20 de Oct. de 2014
What do you mean by rotate?
>>rotate3d on
Still works.
In R2014b, contour is no longer a collection of patches but rather a contour plot object. If you look at it's properties, you might find what you want:
[c,h] = contourf(Z,10);
>> h
h =
Contour with properties:
LineColor: [0 0 0]
LineStyle: '-'
LineWidth: 0.5000
Fill: 'on'
LevelList: [-6.3605 -5.0954 -3.8302 -2.5651 -1.2999 -0.0348 1.2304 2.4955 3.7606 5.0258 6.2909]
XData: [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20]
YData: [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20]
ZData: [20x20 double]
Show all properties
2 comentarios
Sean de Wolski
el 20 de Oct. de 2014
I'm not clear on what you mean by rotating. Whether it's interactive or programmatic, the whole figure will rotate. If you mean rotate the individual color patches relative to the rest of the figure, then you might want to look into using hgtransform.
Ver también
Categorías
Más información sobre Contour Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!