How do I get the figure position from a plot?

Illustration
ishitaisha6840 - 2020-08-27T11:20:57+00:00
Question: How do I get the figure position from a plot?

I create a 3D contour plot like this:   [C,h]=contour3(w,p,green1,30); t=clabel(C,h); get(t(1)); This created a 3D plot and this output: Annotation = [ (1 by 1) hg.Annotation array] BackgroundColor = none Color = [0 0 0] DisplayName = EdgeColor = none Editing = off Extent = [ (1 by 4) double array] FontAngle = normal FontName = Helvetica FontSize = [10] FontUnits = points FontWeight = normal HorizontalAlignment = center LineStyle = - LineWidth = [0.5] Margin = [2] Position = [-0.661507 0.649385 -0.01794] Rotation = [290.824] String = -0.01794 Units = data Interpreter = tex VerticalAlignment = middle BeingDeleted = off ButtonDownFcn = Children = [] Clipping = on CreateFcn = DeleteFcn = BusyAction = queue HandleVisibility = on HitTest = on Interruptible = on Parent = [170.001] Selected = off SelectionHighlight = on Tag = Type = text UIContextMenu = [] UserData = [-0.01794] Visible = on I want to save matrix 'Position'. How do I do that?

Expert Answer

Profile picture of John Williams John Williams answered . 2025-11-20

Using
 
get(t(1),'Position')

in your example code returns the 'Position' parameter only.


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!