Filter löschen
Filter löschen

How can I permute axes of a figure after the figure is created?

4 Ansichten (letzte 30 Tage)
Lucas-Raphael Müller
Lucas-Raphael Müller am 10 Jan. 2017
Beantwortet: Jordan Ross am 13 Jan. 2017
I know I could do like
A = permute(A, [1 3 2]);
image(A,...)
however the problem is, that the figure is produced dynamically and it would save me much effort to have something like:
get the handle of the current figure (and children)
extract x and y axes
permute them.
Thanks in advance

Antworten (1)

Jordan Ross
Jordan Ross am 13 Jan. 2017
You can get the X and Y data of the Image by doing the following:
>> A
A =
1 2
3 4
>> image(A)
>> h = image(A);
>> h.XData
ans =
1 2
>> h.YData
ans =
1 2
Once you have the new X and Y data for the axes, you update the image by doing the following:
h.XData = [2 1];
h.YData = [2 1];
However, please not that this is for MATLAB R2014b and later. You can also use the "get" and "set" functions as shown in the following documentation pages:

Kategorien

Mehr zu Line Plots finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by