Code covered by the BSD License  

Highlights from
glinkaxes: interactive linkaxes

5.0

5.0 | 1 rating Rate this file 7 Downloads (last 30 days) File Size: 3.38 KB File ID: #30850

glinkaxes: interactive linkaxes

by Kesh Ikuma

 

24 Mar 2011 (Updated 14 Apr 2011)

GLINKAXES lets user, via mouse clicks, to choose the axes to synchronize their axis limits.

| Watch this File

File Information
Description

GLINKAXES is a wrapper function for the built-in LINKAXES function. Prior to calling LINKAXES function, GLINKAXES accepts user mouse clicks to select axes to synchronize.

There are 4 possible ways to call this function:

GLINKAXES or GLINKAXES(OPTION) to choose as many axes as desired (terminate selection by pressing ENTER key with the focus on a figure window).

GLINKAXES(N) or GLINKAXES(N,OPTION) to choose (up to) N axes. Press ENTER key for less than N.

OPTION argument is directly passed to LINKAXES and must be one of 'x','y','xy',or 'none'.

This function works on Matlab R2008a or later. (It uses a OnCleanup function which is introduced in R2008a.)

Revision:
Rev.1 (4/14/11) - GLINKAXES(OPTION) calling option parsing bug fix

MATLAB release MATLAB 7.10 (2010a)
Other requirements MATLAB R2008a or later required for OnCleanup function.
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
04 May 2011 Riccardo

The function does not seem to behave correctly

I tested it with the following code:

% ------------------------------------------
close all
figure(1)
set(gcf,'windowStyle','docked') % --- undock

Nrows = 2;
Ncols = 2;
fontSize = 14;
h_fig = zeros(Nrows*Ncols,1);
for chartNo = 1:Nrows*Ncols
   h_fig(chartNo) = subplot(Nrows,Ncols,chartNo);
   grid on
   hold on
   set(gca,'box','on')
   set(gca,'fontSize',fontSize)
   xlabel('Common X label []')
   ylabel('Common Y label []')
   title('Common Title')
   switch chartNo
      case 1
         plot(1*(1:100),1*(1:100).^2)
      case 2
         plot(1*(1:100),2*(1:100).^2)
      case 3
         plot(1*(1:100),3*(1:100).^2)
      case 4
         plot(4*(1:100),4*(1:100).^2)
   end
end

% ------------------------------------------

I have Matlab 2010b on windows 7 x64.

I first ran the script above to set up several axes

Then I ran glinkaxes several times clicking on 3 axes and then hitting return.

The function works correctly when I run it the first time.

for each subsequent time it does not wait for a mouse click but it returns directly to the command window.

This function is potentially very useful is if works reliably.

Could you please have a go at fixing it?

Many Thanks

16 Dec 2011 sapientia  
Please login to add a comment or rating.
Updates
14 Apr 2011

GLINKAXES(OPTION) parsing bug fix

Tag Activity for this File
Tag Applied By Date/Time
handle graphics Kesh Ikuma 24 Mar 2011 16:13:08
utility Kesh Ikuma 24 Mar 2011 16:13:08
interactive Kesh Ikuma 25 Mar 2011 18:24:10

Contact us at files@mathworks.com