This question maybe a bit like the link below, but this didn't work for me... http://nl.mathworks.com/matlabcentral/answers/102530-how-can-i-change-the-default-settings-for-the-linewidth-property-before-i-plot-a-figure-in-matlab
I'm working on a matlab function that automatically opens your figure in full screen mode and on a second monitor if present. So far, everything works fine. I already achieved to set the fontsize inside the function, so whitout plotting anything and without making xlabel(..) etc.:
% Fontsize used at the figure
if ~exist('fontsize_manual','var')|| isempty(fontsize_manual)
set(gca,'FontSize',16)
else
set(gca,'Fontsize',fontsize_manual)
end
Now is my question: Can I change in a same way the linewidth of the lines that will by plotted in the figure? So also here, predefining the linewidth inside the function and later on in your script plotting some lines etc. I do prefer this works only for the figure you're working on, so that you can change this 'default' for each figure and save them all with different linewidth and fontsizes if needed.
I tried the line below, but that only changed the linewidth of the axis.
set(gca,'LineWidth',2)
Is there anyone who can help me solving this problem?
%------------------------------------------------------------------------------------------------------------------------------ The answer below is nice, but I detected a new problem. The code below in found accidentally by solving the previous problem:
set(gca,'LineWidth',3)
It turned out this changes the width of the axes. But now the problem... Also here this works only on the first figure. (see figure)
If I also put this code in my session after the plotting in the second figure, the width in the second figure changes. Looks like the right handle isn't reached, or something like that, inside the function, when making the second figure. Do you have any idea what could be wrong here?