5
$\begingroup$

This code creates a plot with a frame, ticks, and labels, and with axis numbering on both axes. I would like to suppress the numbering on the vertical axis.

Plot[x^2, {x, 0, 5}
 ,PlotRange -> {{0, 5}, {0, 25}}
 ,Frame -> True
 ,PlotStyle -> {{ Thickness -> 0.008, Black}}
 ,FrameStyle -> Thick
 ,LabelStyle -> {Bold, FontFamily -> "Helvetica", FontSize -> 14}
 ,FrameLabel -> {{"  ", " "}, {"T", "  "}}
]
$\endgroup$
2
  • $\begingroup$ FrameTicks -> {{None, None}, {Automatic, None}}]? $\endgroup$
    – N.J.Evans
    Sep 15, 2016 at 15:47
  • 1
    $\begingroup$ FrameTicks removes the numbering as well as the ticks. If you want to remove only the numbers, add FrameTicksStyle -> {{Directive[FontOpacity -> 0, FontSize -> 0], Automatic}, {Automatic, Automatic}}. $\endgroup$
    – corey979
    Sep 15, 2016 at 15:49

1 Answer 1

7
$\begingroup$

FrameTicksStyle is the solution here:

Plot[x^2, {x, 0, 5}, PlotRange -> {{0, 5}, {0, 25}}, Frame -> True, 
 PlotStyle -> {{Thickness -> 0.008, Black}}, FrameStyle -> Thick, 
 LabelStyle -> {Bold, FontFamily -> "Helvetica", FontSize -> 14}, 
 FrameLabel -> {{" ", " "}, {"T", " "}}, 
 FrameTicksStyle -> {{Directive[FontOpacity -> 0, FontSize -> 0], 
    Automatic}, {Automatic, Automatic}}]

enter image description here


Note that FrameTicks -> {{None, Automatic}, {Automatic, Automatic}} removes the numbering as well as the ticks altogether:

enter image description here


ImagePadding -> 1 can be a quick way to remove numbering from all axes leaving the ticks:

enter image description here

but doesn't work well when one wants to get rid of the numbering on only one axis; adding ImagePadding -> {{1, Automatic}, {Automatic, Automatic}} gives (note a cut from the left on the "0")

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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