0
$\begingroup$

I want to modify the style of just one axis, but I'm stuck with something like

Plot[x^2, {x, 0, 3}, LabelStyle -> Red]

which of course modifies both axes. How do I solve this problem?

$\endgroup$
1
  • $\begingroup$ Look up AxesStyle and TickStyle $\endgroup$ Jul 30 '13 at 23:10
4
$\begingroup$

I suspect this must be a duplicate but depending on what features you want to alter (just label, label and ticks etc) you might have to use combinations of AxesStyle and TickStyle and so on but here is a quick example:

Plot[x x, {x, 0, 3}, 
 AxesStyle -> {Black, Directive[Black, FontColor -> Red]}]

enter image description here

$\endgroup$
3
$\begingroup$

Just as a small addition to the answer of Mike Honeyhurch, if you need to not only change the color, but also some other ticks properties, try this:

Plot[x^2, {x, 0, 3}, 
 TicksStyle -> {Black, Directive[Red, FontSize -> 14, Italic]}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.