Error when zooming in on figures

1 view (last 30 days)
theak
theak on 19 Sep 2018
I receive the below error when attempting to zoom in (using the magnifying glass) on a figure.
Nothing particularly unique about the code I am using for the figure although I am setting the figure position.
Running windows 10 with MATLAB 2017a. I do not recall having the issue with Windows 7.
set(0,'DefaultAxesFontSize',10); set(0,'DefaultLineMarkerSize',8); set(0,'DefaultLineLineStyle','none'); set(0,'DefaultLineLineWidth',2); set(0,'defaultfigureunits','inches')
figure('position',pos6) ydat=bsfc; ylab='BSFC (g/kWh)'; plot(xdat(cs1),ydat(cs1),'-x','color',a5); hold on plot(xdat(cs2),ydat(cs2),'-o','color',a3); hold off grid on xlabel(xlab); ylabel(ylab);
*****Error message********
Property assignment is not allowed when the object is empty. Use subscripted assignment to create an array element.
Error in zoom>localCreateZoomLines (line 1144) hLines.Edge.Layer = 'front';
Error in zoom>localZoom2DIn (line 1090) hLines = localCreateZoomLines(hAxes);
Error in zoom>localButtonDownFcn2D (line 1069) localZoom2DIn(evd,hMode,hAxesVector);
Error in zoom>localZoom (line 767) localButtonDownFcn2D(evd,hMode,hAxesVector);
Error in zoom>localStartDrag (line 735) localZoom(evd,hMode,hAxesVector);
Error in zoom>localWindowButtonDownFcn (line 710) localStartDrag(hMode,evd);
Error in zoom>@(obj,evd)localWindowButtonDownFcn(obj,evd,hMode) (line 496) set(hMode,'WindowButtonDownFcn',@(obj,evd)localWindowButtonDownFcn(obj,evd,hMode));
Error in hgfeval (line 62) feval(fcn{1},varargin{:},fcn{2:end});
Error in matlab.uitools.internal.uimode/modeWindowButtonDownFcn (line 120) hgfeval(newButtonDownFcn,hFig,evd);
Error in matlab.uitools.internal.uimode/modeControl>localModeWindowButtonDownFcn (line 151) hThis.modeWindowButtonDownFcn(hFig,evd,hThis,newValue);
Error while evaluating Figure WindowButtonDownFcn.

Answers (1)

Pinkesh Narsinghani
Pinkesh Narsinghani on 24 Sep 2018
This type of error comes when 'DefaultLineLineStyle' is set to 'none' or if the zoom box's 'LineStyle' is set to 'none'.
Setting these properties back to their default values of '-' might resolve the error.

Categories

Find more on Graphics Object Properties in Help Center and File Exchange

Products


Release

R2017a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!