Interesting question +1. The following example shows how to exchange the x
and y
axes of the current figure:
X = (1:100)'; %# Create x axis data
Y = randn(100, 1); %# Create y axis data
plot(X, Y); %# Plot the data
view(-90, 90) %# Swap the axes
set(gca, 'ydir', 'reverse'); %# Reverse the y-axis (Optional step)
Also, a relevant link to Matlab Central is here.