Rank: 2613 based on 42 downloads (last 30 days) and 4 files submitted
photo

Ken Purchase

E-mail
Lat/Long
35.8485, -78.8295

Personal Profile:

Matlab enthusiast


 

Watch this Author's files

 

Files Posted by Ken Purchase View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
26 Apr 2013 Screenshot TextZoomable for text that scales as you zoom Text that zooms as you zoom your plot, rather than staying at a fixed font size. Author: Ken Purchase text, zoom, text zoom, text scaling, scaling, annotation 17 7
  • 4.5
4.5 | 5 ratings
26 Apr 2013 Screenshot TextZoomable for text that scales as you zoom Adds text to a figure that grows/shrinks with figure content as the figure is zoomed/scaled Author: Ken Purchase text, zoomable text, scalable text, text zoom, label, rescale 4 0
07 Jan 2010 Screenshot RenderText Draws text (font) into a matrix, by first drawing it in a figure, then capturing the screen. Author: Ken Purchase graphics, text, render text, text renderer, draw text, font 11 0
03 Dec 2007 fminsearchbnd new improved bounded fminsearch algorithm Author: Ken Purchase optimization, optimize, fminsearch, bound, bounded, output 10 7
  • 5.0
5.0 | 2 ratings
Comments and Ratings by Ken Purchase View all
Updated File Comments Rating
19 Mar 2013 check if coordinates are inside the hexagon check if coordinates are within the hexagon, can be used to filter out positions outside. Author: Yuanye Wang

Simple and elegant - thanks!

26 Jul 2012 optprop - a color properties toolbox General routines for calculation and analysis of color related properties. Author: Jerker Wagberg

22 Aug 2011 Windows System Sounds Play any Windows system sound from within MATLAB. Author: Drew Weymouth

Does just what it said and just what I needed

18 Aug 2009 writedxf.m Given filename, 3-D mesh - generated DXF file with surface specified by the mesh. Author: Greg Siegle

Some documentation and preferably an example would be very helpful - I'm trying to reverse engineer how to use this. Thanks.

Comments and Ratings on Ken Purchase's Files View all
Updated File Comment by Comments Rating
10 Dec 2014 TextZoomable for text that scales as you zoom Text that zooms as you zoom your plot, rather than staying at a fixed font size. Author: Ken Purchase Hoi Wong

TMW's support really go the extra mile helping its customers. With the help of Philip Caplan, the last bit of the puzzle to get this to work on R2014b's new graphic system is solved.

Replace:
hgp = findpackage('hg');
axesC = findclass(hgp,'axes');
LimListener = handle.listener(imAxes,[axesC.findprop('XLim') axesC.findprop('YLim')],...
'PropertyPostSet',@localLimitListener);

With:
LimListener = addlistener(imAxes,{'XLim','YLim'},'PostSet',@localLimitListener);

19 Nov 2014 TextZoomable for text that scales as you zoom Text that zooms as you zoom your plot, rather than staying at a fixed font size. Author: Ken Purchase Matt J

@David,
I believe the particular error you mention is fixable by changing that line as follows

PostPositionListener = addlistener(hFig,'SizeChanged',...
@(o,e) localPostPositionListener(o,e,imAxes) );

See also the following thread in MATLAB Answers,

<http://www.mathworks.com/matlabcentral/answers/163280-addlistener-syntax-not-recognized-in-r2014b>

However, I'm afraid that even after fixing that, I am finding further problems running TextZoomable in R2014b. In particular, the following lines use undocumented functions findpackage and findclass,

hgp = findpackage('hg');
axesC = findclass(hgp,'axes');

whose behavior has changed somehow.

17 Nov 2014 TextZoomable for text that scales as you zoom Text that zooms as you zoom your plot, rather than staying at a fixed font size. Author: Ken Purchase David

I'm trying to use your code with R2014b and I get this error:
No method 'addlistener' with matching signature found for class 'matlab.ui.Figure'.

I've run the script provided by Mathworks to update code for the new graphics system and it changed one line, but it still doesn't work. Any ideas?

27 Mar 2014 TextZoomable for text that scales as you zoom Text that zooms as you zoom your plot, rather than staying at a fixed font size. Author: Ken Purchase Matt J

Here's a better version of the DeleteFcn,

function DeleteMethod(src,event)
% when called, rescale all fonts in image
hAx=gca;
hFig = get(hAx,'Parent');
ud=get(hAx, 'UserData');
idx=(ud.handles==src);

ud.ratios(idx)=[];
ud.handles(idx)=[];



if isempty(ud.handles)
setappdata(hFig,'KenAxeResizeListeners',[]);
set(hAx, 'UserData',[]);
else
set(hAx, 'UserData',ud);
end

delete(src);

end

27 Mar 2014 TextZoomable for text that scales as you zoom Text that zooms as you zoom your plot, rather than staying at a fixed font size. Author: Ken Purchase Matt J

Ken,

There seems to be a duplicate of this submission at

http://www.mathworks.com/matlabcentral/fileexchange/41501-textzoomable-for-text-that-scales-as-you-zoom

Which is the most official/current version? Also, when I do a very high zoom on the text, parts of the text appear outside the axes. Is there a way to prevent this, i.e., so that only text within the window of the axes is visible?

Contact us