Starting in R2014b, colorbars and legends are no longer axes objects. They are new types of objects that have their own sets of supported properties. In previous releases, they are axes objects that you can modify using axes properties. However, many axes properties are not relevant to colorbars and legends.
You should not perform operations that assume or require colorbars and legends to be axes objects.
For example, to reverse the direction of the color scale along a colorbar use the new
for the colorbar instead of setting the
c = colorbar; c.Direction = 'reverse';
Do not pass a colorbar object or a legend object to a function that expects an axes object as an input argument.
For example, passing a legend object to the
to make it the current axes returns an error message:
plot(1:10) l = legend('line plot'); axes(l)
Error using axes Handles of type Legend cannot be made the current Axes.
Similarly, passing a colorbar object to the
returns an error message:
c = colorbar; axes(c)
Error using axes Handles of type ColorBar cannot be made the current Axes.
Labelproperty of the colorbar instead.
c = colorbar; c.Label.String = 'Colorbar Label';
Colorbars and legends no longer have a
'axes'. Do not use
find objects with a
Type property of
expect it to return colorbars and legends.
To find legends, search for objects with a
To find colorbars, search for objects with a
Colorbars and legends no longer contain handles to underlying
objects in their
Children property. Their
contain an empty graphics placeholder array. For a legend, access
these underlying objects using the output arguments from the
legend function instead.