I want to insert a sub menu called "X axis".
Should it be "X axis", "X-axis" or something else?
Attention to microcopy is very important! (See footnote)
The fragment phrase X axis is two words where axis is the noun and X is the descriptor (or qualifier) that specifies which axis you are talking about.
Meanwhile x-axis is one (albeit hyphenated) noun by which that particular axis is called.
So a valid sentence might be:
In a menu, either might be right depending on your scenario:
This describes the axis for which you want to change the label settings:
While this one says you want to change the visibility of the x-axis:
Subtle but different!
Note: I'm happy to have this answer corrected by someone more versed in the nuances of English and Maths!