MATLAB: How to access the Axle property in an axis ruler

axisaxlegraphicshg2MATLABstrange behaviorundocumentedvisible

I want to remove the lines on the X and Y axis that border the chart area. After googling around for a while I came across this blog post explaining about the Axle property in the X, Y, and ZAxis properties of the axis. MATLAB has been updated since that post and the NumericRuler is now stored in the XAxis, YAxis, and ZAxis property. The Axle property doesn't show up in the list of all properties but it is possible to access when using the command window using
ax = axes;
ax.XAxis.Axle.Visible = 'off';
If run line by line in the command window, this works and removes the XAxis line. But if it is run in a script, MATLAB does not find the Axle property and believes I am trying to set something that doesn't exist. Can someone explain this behavior? I am running version 2016b.
Thanks

Best Answer

If you want to make the x-axis disappear:
ax.XAxis.Color = 'None';