Mirror plotting on Matlab

18 views (last 30 days)
jl294
jl294 on 19 Jul 2015
Commented: somayeh Mohammady on 25 Jun 2018
Hi , looking to create a plot similar to the plot attached. I have two sets of data which are similar and I want to compare them 'back-to-back'. How do I go about doing that on Matlab? I'm familiar with matlab plotting but with only very basic knowledge. Any help would be appreciated.
This is the image.
Thanks
  1 Comment
somayeh Mohammady
somayeh Mohammady on 25 Jun 2018
I found that the easiest way doing it is to multiply the matrix containing your figure by .*(-1), and plot it as usual. It worked for me.

Sign in to comment.

Answers (1)

Jan
Jan on 19 Jul 2015
Wouldn't it be the most direct and easiest way to draw the data in one axes?
t = 1:10;
data1 = rand(1, 10);
data2 = rand(1, 10);
plot(t, data1, 'r');
hold on
plot(t, data2, 'b');
  3 Comments
Image Analyst
Image Analyst on 19 Jul 2015
JL's "Answer" moved here since it's not an actual official "Answer" to his original question:
No it must be mirrored below y axis like in the photo. The intensities will be roughly the same but not quite so drawing the data in one axis won't show the difference well enough.
Walter Roberson
Walter Roberson on 20 Jul 2015
You mean like
plot(t, data1, 'r', t, -data2, 'b')
?

Sign in to comment.

Categories

Find more on Line Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!