Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: Copy y-axis

Subject: Copy y-axis

From: Peter

Date: 08 May, 2008 09:12:08

Message: 1 of 2

Hi

Is there an easy way to display the y-axis at the left and
right side at the same time (can only chose left or right
but not both)?

As it is for the same dataset so I thought plotyy is not the
right function to use.

However, if someone can let me know how to copy all
properties of the left hand y-axis to the right hand y-axis
(besides its position) maybe plotyy is the right function...

Thank you,
Peter


Subject: Re: Copy y-axis

From: helper

Date: 08 May, 2008 10:28:04

Message: 2 of 2

"Peter " <peter.lueckoff@wirtschaft.uni-giessen.de> wrote
in message <fvug57$j74$1@fred.mathworks.com>...
> Hi
>
> Is there an easy way to display the y-axis at the left and
> right side at the same time (can only chose left or right
> but not both)?
>
> As it is for the same dataset so I thought plotyy is not
the
> right function to use.
>
> However, if someone can let me know how to copy all
> properties of the left hand y-axis to the right hand y-
axis
> (besides its position) maybe plotyy is the right
function...
>
> Thank you,
> Peter
>
>

The following works for this example:

% Example
x = 0:0.01:20;
y1 = 200*exp(-0.05*x).*sin(x);
y2 = 0.8*exp(-0.5*x).*sin(10*x);
[AX,H1,H2] = plotyy(x,y1,x,y2,'plot');

% Match axes ticks
ylim(AX(2),ylim(AX(1)))
set(AX(2),'ytickMode','auto')

Let me know if this doesn't work in your application.


Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics