 function  T = hgtransform(ax)
    T = hggroup(ax);
	addproperty ("matrix", T, "data");

    addlistener (T, "matrix", @transform_listener);
  endfunction

  function transform_listener (h, p1)
   	rM = get (h, "matrix");
    Ch = get (h, "children");
	
	for i=1:length(Ch)
	  % x data
	  xD = get(Ch(i), "xdata");
%	  xD = [xD ones(rows(xD),1)];
	  xD = padarray (xD, [2 0], 0, "post");
	  for j=1:columns(xD)
	    nD(:,j) = rM * xD(:,j);
      end
	  xD = nD(1:2,:);
	  set(Ch(i), "xdata", xD);
%	  pXD = get(Ch(i), "xdata");
	  
      % y data
	  yD = get(Ch(i), "ydata");
	  yD = padarray (yD, [2 0], 0, "post");
	  for j=1:columns(yD)
	    nD(:,j) = rM * yD(:,j);
      end
	  yD = nD(1:2,:);
	  set(Ch(i), "ydata", yD);

	  % z data
	  zD = get(Ch(i), "zdata");
	  zD = padarray (zD, [2 0], 0, "post");
	  for j=1:columns(zD)
	    nD(:,j) = rM * zD(:,j);
      end
	  zD = nD(1:2,:);
	  set(Ch(i), "zdata", zD);
	end
 endfunction