Error when zooming in on figures

조회 수: 7 (최근 30일)
theak
theak 2018년 9월 19일
답변: Pinkesh Narsinghani 2018년 9월 24일
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.

답변 (1개)

Pinkesh Narsinghani
Pinkesh Narsinghani 2018년 9월 24일
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.

카테고리

Help CenterFile Exchange에서 Data Exploration에 대해 자세히 알아보기

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by