Error using set - XColor and YColor

When I try to change the X color and Y color of plots using this code:
set(gca,'XColor','none')`
I get the following error:
Error using set Bad property value found. Object Name : axes Property Name : 'XColor'.
The same thing happens with 'YColor', but other properties (such as 'Color') are fine.
I'm using version R2012b.
Thanks in advance for help

Answers (1)

Stephen23
Stephen23 on 2 Nov 2015
Edited: Stephen23 on 3 Nov 2015
Here is the official list of all public axes properties:
Although XColor and YColor are listed in the online documentation, they may not be supported in your MATLAB version. To know what properties are supported by your version, you should open the program help, not the online help as the online help always applies to the most recent version.
This list also tells you what values are permitted, and I do not see 'none' as being a permitted value. If you wish to turn off the axes then use the visibility property.

1 Comment

Hi Stephen,
I went to the program help and found that although XColor is a property in my version, I can only set it to an actual colour value, as opposed to setting it to 'none' to get rid of it. I have now found instead that by setting 'Visible' to 'off' I can get the result I wanted.
Thanks for your help!
AL

Sign in to comment.

Categories

Find more on Graphics Object Properties in Help Center and File Exchange

Asked:

on 2 Nov 2015

Edited:

on 3 Nov 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!