Comments on: Customizing axes part 4 – additional properties https://undocumentedmatlab.com/blog_old/customizing-axes-part-4-additional-properties Charting Matlab's unsupported hidden underbelly Mon, 25 Apr 2022 12:26:16 +0000 hourly 1 https://wordpress.org/?v=4.4.1 By: RayInoshttps://undocumentedmatlab.com/blog_old/customizing-axes-part-4-additional-properties#comment-361624 Sun, 15 Nov 2015 15:33:12 +0000 https://undocumentedmatlab.com/?p=5190#comment-361624 Hey everybody!

I got a little update on this one, fixing the select3d for Matlab >= R14b.

Replacing

% Transform vertices from data space to pixel space
xvert = local_Data2PixelTransform(ax,vert)';
xcp = local_Data2PixelTransform(ax,cp')';

with

% Transform vertices from data space to pixel space (fixed for Matlab R2014b+)
if ~graphicsversion(get(ax,'Parent'),'handlegraphics')
  xvert = specgraphhelper('convertDataSpaceCoordsToViewerCoords', axchild, vert');
  xcp   = specgraphhelper('convertDataSpaceCoordsToViewerCoords', ax, cp);
else
  xvert = local_Data2PixelTransform(ax,vert)';
  xcp   = local_Data2PixelTransform(ax,cp')';
end

should work perfectly all right (tested with linear axes and DataAspectRatio=1).

One might change the condition

  ~graphicsversion(get(ax,'Parent'),'handlegraphics')

to something more elegant. This code line assumes the axes object ax is direct child to the figure (which fits in my case). An alternative might be checking the matlab version with

  ~verLessThan('matlab','8.4')

, since the graphics update came in 8.4 (R14b).

Note, that the transposition of vert and cp in the arguments of specgraphhelper(…) is crucial to the result. Transposing one of them leads to wrong results.

Hope it helps,
Ray

]]>
By: Konstantin Alexeevhttps://undocumentedmatlab.com/blog_old/customizing-axes-part-4-additional-properties#comment-348935 Thu, 07 May 2015 12:14:38 +0000 https://undocumentedmatlab.com/?p=5190#comment-348935 Hello Yair,

I used the select3d tool from matlab file exchange to find, where the mouse clicked on 3d, surface. Since matlab 2014, the select3d function seems to don’t work anymore because, “x_RenderTransform” and other propertiese were removed.

However, now the matlab provides the coordinates of the section of mouse point and the surface as the second parameter of the surface callback.

K>> varargin{2}

ans =

Hit with properties:

Button: 1
IntersectionPoint: [20.8219 16.8589 20.7370]
Source: [1×1 Surface]
EventName: ‘Hit’

]]>
By: Yair Altmanhttps://undocumentedmatlab.com/blog_old/customizing-axes-part-4-additional-properties#comment-348927 Thu, 07 May 2015 07:56:49 +0000 https://undocumentedmatlab.com/?p=5190#comment-348927 @Sher – have you seen my recent post on view transformations (and the reader comments on it)?

]]>
By: Sher Razahttps://undocumentedmatlab.com/blog_old/customizing-axes-part-4-additional-properties#comment-348923 Thu, 07 May 2015 06:46:44 +0000 https://undocumentedmatlab.com/?p=5190#comment-348923 Has anyone found an alternative to the x_RenderOffset, x_RenderScale, x_RenderTransform axes properties? I have been working for a long time and have not found a workaround.

Sher

]]>
By: Jill Bhttps://undocumentedmatlab.com/blog_old/customizing-axes-part-4-additional-properties#comment-345691 Tue, 17 Feb 2015 02:08:07 +0000 https://undocumentedmatlab.com/?p=5190#comment-345691 Hi Yair-

Great information. I’ve been using some code that accessed x_RenderTransform, x_RenderOffset, and x_RenderScale undocumented properties in HG1, that “broke” in HG2. I’ve been in search of a solution, and your tips in your blog are the closest I’ve come. I’m ever hopeful that a workaround will arise, but I’m not experienced enough to take it myself.

Thanks for the blog,
Jill

]]>