Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Ticks on dual axis ...
Date: Thu, 12 Mar 2009 12:43:02 +0000 (UTC)
Organization: Kapteyn Astronomical Institute, University of Groningen
Lines: 19
Message-ID: <gpb00m$dl2$1@fred.mathworks.com>
References: <fja7ik$4fg$1@fred.mathworks.com> <fjac16$5sr$1@fred.mathworks.com> <fjaj5h$bll$1@fred.mathworks.com> <fjbmn2$egl$1@fred.mathworks.com> <fs8rd3$b0f$1@fred.mathworks.com> <fs98mg$5u$1@fred.mathworks.com> <g2lvf6$321$1@fred.mathworks.com> <g3761q$3pi$1@fred.mathworks.com> <g37cvt$mv3$1@fred.mathworks.com> <g39ocv$f9s$1@fred.mathworks.com> <g39po1$pv1$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1236861782 13986 172.30.248.38 (12 Mar 2009 12:43:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 12 Mar 2009 12:43:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1323474
Xref: news.mathworks.com comp.soft-sys.matlab:524304


If you still want a dual axis plot with the 'box on' you can consider to use a dummy as follows:

% dummy axes for the box and background color
ax0 = axes;
set (ax0, 'Box', 'on', 'Color', 'white', 'XTick', [], 'YTick', []);

% first axes for left y-axis
ax1 = axes ('Position', get (ax0, 'Position'));
set (ax1, 'Box', 'off', 'Color', 'none', 'YAxisLocation', 'left');

% second axes for right y-axis assuming common x-axis controlled by ax1
ax2 = axes ('Position', get (ax0, 'Position'));
set (ax2, 'Box', 'off', 'Color', 'none', 'XTick', [], 'YAxisLocation', 'right');

Now manipulate ax1 and ax2 as you like, the dual axis plot will appear as you expect intuitively without interfering ticks of left and right y-axes.

Cheers,

Willem