How to flip a Matlab tree plot upside down?

The documentation for treeplot describes an example where a unique root node located at the top of the graph is parent to several "layers" of nodes in a descending order.
I'd like to somehow flip this graph about the horizontal axis so that the root node ends up at the base of the now reversed tree. Then I'd like to add labels to the nodes.
Any idea to get me started?

 Akzeptierte Antwort

madhan ravi
madhan ravi am 28 Okt. 2018

0 Stimmen

yticklabels([1:10]) %an example
set ( gca, 'ydir', 'reverse' )

2 Kommentare

Jonathan
Jonathan am 1 Nov. 2018
Thank you, that did exactly what I needed. I particularly appreciate that the labels I added to the treeplot before flipping it stayed attached to the right nodes and were not flipped themselves. I had anticipated more complication in that regard!
madhan ravi
madhan ravi am 1 Nov. 2018
Anytime buddy :)

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Sparse Matrices finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2013a

Tags

Gefragt:

am 28 Okt. 2018

Bearbeitet:

am 1 Nov. 2018

Community Treasure Hunt

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

Start Hunting!

Translated by