Orient pie chart in clock wise direction

Hello:
In generally, pie chart shows anti-clock wise orientation with its shades. How to orient it to clock wise direction?

 Risposta accettata

X = [1 3 0.5 2.5 2];
Anti-clockwise (original):
pie(X)
Clockwise:
h = pie(X);
set(h(2:2:end),{'HorizontalAlignment'},get(h(end:-2:2),{'HorizontalAlignment'}))
set(gca(),'XDir','reverse')

3 Commenti

Or, if you don't care about preserving which colors map to which numbers, and just want the numbers to go clockwise:
X = [1 3 0.5 2.5 2];
pie(flip(X))
Voss
Voss il 21 Lug 2023
Modificato: Voss il 21 Lug 2023
You're welcome!

Accedi per commentare.

Più risposte (0)

Tag

Richiesto:

il 21 Lug 2023

Modificato:

il 21 Lug 2023

Community Treasure Hunt

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

Start Hunting!

Translated by