Prev: Setting uigetfile file type or filterindex
Next: matlab crashes (win 7 64 bit) without messages, logs or dumps while using mex-files linked with itpp library and compiled with mingw
From: Andy on 20 Jul 2010 11:14 Can you produce a small sample of code reproducing your error that we can copy/paste into MATLAB to see for ourselves? Thanks.
From: someone on 20 Jul 2010 11:20 luke <ernandeth(a)gmail.com> wrote in message <acb64ef3-8a23-45cd-833c-4b9e7fb10475(a)w30g2000yqw.googlegroups.com>... snip ... > > I checked for the XLim and XLimMode properties, they are set to [0 > 300] and 'Auto'. I just really don't get why the x-coordinate on that > axis should ever be negative. This is pretty frustrating... > > But....Since matlab is reporting the coordinates correctly on the > "floating textbox" on the figure, do you know a way to access the > context of that box (without using the interactive GUI stuff) ? > > -L % If I execute the following from the command line: Z = peaks; [C,h] = contour(interp2(Z,4)); % Then if I click somewhere on the axis and execute the following command: pt = get(gca,'CurrentPoint') % The X&Y coordinates seem about right to me. How do you get a "floating textbox" on the figure?
From: luke on 20 Jul 2010 11:39 On Jul 20, 11:20 am, "someone" <some...(a)somewhere.net> wrote: > luke <ernand...(a)gmail.com> wrote in message <acb64ef3-8a23-45cd-833c-4b9e7fb10...(a)w30g2000yqw.googlegroups.com>... > > snip ... > > > > > I checked for the XLim and XLimMode properties, they are set to [0 > > 300] and 'Auto'. I just really don't get why the x-coordinate on that > > axis should ever be negative. This is pretty frustrating... > > > But....Since matlab is reporting the coordinates correctly on the > > "floating textbox" on the figure, do you know a way to access the > > context of that box (without using the interactive GUI stuff) ? > > > -L > > % If I execute the following from the command line: > Z = peaks; > [C,h] = contour(interp2(Z,4)); > > % Then if I click somewhere on the axis and execute the following command: > pt = get(gca,'CurrentPoint') > > % The X&Y coordinates seem about right to me. > > How do you get a "floating textbox" on the figure? @someone: it just shows up spontaneously when I make the call get(gca, 'CurrentPoint') @ Andy: here is a snippet of the code (there is a lot of other stuff and some dependencies , so it won't work for you). I'm suspecting that since the function "lightbox" calls "axis xy" and "axis off", it's messing up the coordinate frame. if ~DOCORRELATION subplot(223) %%%% this is what I use to show the images - it's a wrapper around the function "image" %%% lightbox(reshape(cumasl, xres, xres, Nslices)); title(['Cummulative ASL ...(six avgs)' num2str(vnum)]); end %if DEBUG, pause(0.1), end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Find the coordinates of where I clicked subplot(223) myclick=get(gca,'CurrentPoint');
From: luke on 20 Jul 2010 11:58 > > % If I execute the following from the command line: > Z = peaks; > [C,h] = contour(interp2(Z,4)); > > % Then if I click somewhere on the axis and execute the following command: > pt = get(gca,'CurrentPoint') > > % The X&Y coordinates seem about right to me. > > How do you get a "floating textbox" on the figure? PS - hmmm.... the "floating text box" does not show up when I run your snippet. I even tried using my code to display the data subplot(2,2,3) lightbox(Z) No floating textbox, but I get the right coordinates back... head being scratched vigorously.
From: Steven_Lord on 20 Jul 2010 12:06
"luke" <ernandeth(a)gmail.com> wrote in message news:e40b3f1f-3a0f-4a7b-be73-b588476c6e9d(a)g19g2000yqc.googlegroups.com... > On Jul 20, 10:16 am, "someone" <some...(a)somewhere.net> wrote: >> luke <ernand...(a)gmail.com> wrote in message >> <675994fe-9849-4497-ac95-b84eed73b...(a)w30g2000yqw.googlegroups.com>... *snip* > what I mean is that the values in the variable "pt" do not agree with > the little text box with the coordinates that matlab puts on the image > when I call the function. For example, when I click on a point, I'll > get a textbox on the image with x:219 Y:103 , > but when I display pt, I get > > -134.456 27.429 1.000 > -134.456 27.429 0 > > Does that make more sense? The documentation seems to be failing me. Does GCA in your GET call refer to the axes that you expect? Try changing that to contain the exact handle of the axes that you're trying to query, just to make sure. -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ To contact Technical Support use the Contact Us link on http://www.mathworks.com |