Rotate & translate a plot

16 views (last 30 days)
Louis Vallance
Louis Vallance on 12 Dec 2012
Hi guys,
I'd like to rotate a curve by 180 degrees, then translate it across the figure to match up with another curve, as follows:
In order to rotate the curve, I use the following code:
%Plot the blue curve
%Rotate the curve by 180 degrees
rotate(h1,[0 0 1],180);
The result is illustrated by the second picture. I then want to move the blue curve so that its left-side fits with the left side of the green curve. In order to achieve this, I tried the following code:
%Create a new set of x/y coordinates for the translated curve
%true[Strain/Stress]Range are the original [x/y] coords of the blue curve
%true[Strain/Stress]RangeFlip are the [x/y] coords of the green curve
%x3/y3 are the new x/y coordinates for the blue curve
However, this produces the following result:
It seems that the code I used above used the old data points from the blue curve before it was rotated, causing the original, un-rotated blue curve to overlap the green curve. I want to be able to use the data points from the newly-rotated curve. Are the data points from a rotated plot available so that I can correctly translate the curve?
Louis Vallance

Answers (0)

Community Treasure Hunt

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

Start Hunting!