function setFigureDefaults % You can insert the definition of the 'defaultfigureposition' % in the files matlabrc.m or startup.m . Then it is applied every % time Matlab is started. I assume you find the wrong definition in % matlabrc and could fix it there also. set(0,'defaultTextInterpreter','latex'); set(0,'defaultAxesTickLabelInterpreter','latex'); set(0,'defaultLegendInterpreter','latex'); set(0,'defaultAxesFontSize',12); % sets all equal set(0,'DefaultTextFontSize', 9) % if having text inside plots set(0, 'DefaultAxesTitleFontSizeMultiplier', 1.1); set(0,'defaultAxesTitleFontWeight','normal') set(0,'defaultLineLineWidth',1.2); set(0,'defaultLineMarkersize',6) %set(0,'units','normalized','defaultfigureposition',[100 200 500 400]') set(0,'DefaultLineMarkerEdgeColor', 'k') set(0,'DefaultLineMarkerFaceColor', 'k') set(0, 'DefaultFigureColor', 'w'); set(0, 'DefaultLegendBox', 'on'); set(0, 'DefaultAxesBox', 'on'); set(0, 'DefaultAxesXGrid', 'on'); set(0, 'DefaultAxesYGrid', 'on'); %set(0,'defaultAxesColor','none'); % simple RGB colors: colormap1 =[ 0 0 1 %blue 1 0 0 % red 0 0 0 %black 0 1 0]; %green % Get nicer RGB colors from e.g. % https://www.rapidtables.com/web/color/RGB_Color.html , divide by 255 to % convert to matlab RGB code: colormap2= [70/255 130/255 180/255 %steel blue 255/255 69/255 0/255 % orange red 46/255 139/255 87/255 %sea green 255/255 215/255 0/255 %gold 0.2 0.2 0.2 ]; % dark gray set(0,'defaultAxesColorOrder',colormap2) %reset(0) % add at end of your code if settings should not remain for all scripts on your PC %reset(gca) %reset(gcf) end