Syntax for modifying 'LineWidth' in graph?
5 views (last 30 days)
Hello, my apologies because I expect this is a very simple issue, but I am having difficulty modifying the 'LineWidth' attribute for a figure from the command line, my use of the 'ax.LineWidth' is obviously not correct (below).
I am using version 2017a, so I don't need to use the set/get functions, is that correct?
dpb on 3 May 2017
Not enough context to tell for certain but looks like from variable name that ax is probably an axes handle...if so, the 'LineWidth' property is associated not with the axes but the line handle (typically returned by plot)
'box' is a property of an axes but only has values of 'off','on', though so the arguments to the function box are wrong (unless you've aliased it with something of your own definition which is strongly recommended to not do.
Matthew Eicholtz on 3 May 2017
If you have a figure,
% something plotted here...
ax = gca; %axes handle
Then to change the line width of the axes, simply use:
ax.LineWidth = 2; %or whatever number you like