Why do I get the error "Unable to set the 'YAxis' property of class UIAxes because it is read-only" when I programmatically assign a new y-axis ruler in MATLAB R2024a?
Show older comments
I have been programmatically changing the type of axis by assigning a new ruler of the correct type. For example, for the y-axis:
a = uiaxes;
a.YAxis = matlab.graphics.axis.decorator.DurationRuler;
I then get the following error:
Unable to set the 'YAxis' property of class UIAxes because it is read-only.
However, I do not receive any error when I do this with the x-axis.
Is this a bug? Why is the behaviour between programmatically assigning a new ruler different for the y-axis and the x-axis? What are the workarounds for this error?
Accepted Answer
More Answers (0)
Categories
Find more on Graphics Objects in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!