Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
plot() inverted?

Subject: plot() inverted?

From: Judy

Date: 20 Mar, 2009 23:25:19

Message: 1 of 3

Hi all,

Is anyone aware of how you may invert a simple y vs. x plot so that it is rotated 90 degrees? I know it seems unconventional, but it is needed.. I was thinking of just switching the y and the x so that plot(x,y) becomes plot(y,x), but connecting the dots wouldn't work. Any thoughts is much appreciated. :) Thanks.

Subject: plot() inverted?

From: Faraz Afzal

Date: 21 Mar, 2009 00:48:01

Message: 2 of 3

"Judy " <sauwen.jl@gmail.com> wrote in message <gq18kv$fmn$1@fred.mathworks.com>...
> Hi all,
>
> Is anyone aware of how you may invert a simple y vs. x plot so that it is rotated 90 degrees? I know it seems unconventional, but it is needed.. I was thinking of just switching the y and the x so that plot(x,y) becomes plot(y,x), but connecting the dots wouldn't work. Any thoughts is much appreciated. :) Thanks.

Dear Judy,

To me rotating and inverting are two different issues. When u say u want to rotate it to 90 it means u are infact generating a 3D surface.
then u can use [x,y,z] = (xvalues, yvalues, theta values)
and define theta for pi/2 values..
Thus u have rotated your x , y thing with a surface generated for a quarter..use surf or mesh to see results..

else if u want to invert or flip data just use fliplr or flipud or in the plot tool bar use clockwise or mirror whateevr u need...

I hope it helps.!!

Let me know your progress!!

have a nice weekend..

Subject: plot() inverted?

From: Peter Boettcher

Date: 23 Mar, 2009 13:47:36

Message: 3 of 3

"Judy " <sauwen.jl@gmail.com> writes:

> Is anyone aware of how you may invert a simple y vs. x plot so that it
> is rotated 90 degrees? I know it seems unconventional, but it is
> needed.. I was thinking of just switching the y and the x so that
> plot(x,y) becomes plot(y,x), but connecting the dots wouldn't work.
> Any thoughts is much appreciated. :) Thanks.

In what way would connecting the dots not work? If you think swapping x
and y come close to what you want, try it, then post back with a clear
description of what is wrong with the result.

Remember, swapping x and y is more of a transpose than a rotation. It
will mirror the plot around the diagonal y=x. Is that what you want?


-Peter

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us