Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I know I can manipulate ticks:

 Plot[PDF[NormalDistribution[0, 1.5], x], {x, -7, 7}, 
   Ticks -> {{
     {-6, "-6σ"}, {-5, "-5σ"}, {-4, "-4σ"}, {-3, "-3σ"}, {-2, "-2σ"}, {-1, "-σ"}, 
     {1, "σ"}, {2, "2σ"}, {3, "3σ"}, {4, "4σ"}, {5, "5σ"}, {6, "6σ"}
 }}]

But the ticks disappear when I add Frame -> True. What am I doing wrong?

share|improve this question

1 Answer 1

up vote 5 down vote accepted

Nothing wrong as such... only for Frame you need the FrameTicks option (to add some spice see another way to get your ticks):

xticks = {#, StringReplace[ToString[# σ], " " -> ""]} & /@Range[-6, 6];

Plot[PDF[NormalDistribution[0, 1.5], x], {x, -7, 7}, 
 FrameTicks -> {{Automatic, None}, {xticks, xticks}}, Frame -> True]

Mathematica graphics

share|improve this answer
1  
Typographic note. I suggest replacing StringReplace[ToString[# σ], " " -> ""] with StringReplace[ToString[# σ], " " -> "\[VeryThinSpace]"]. The difference is subtle, but inserting a very-thin-space really makes the tick labels look better. –  m_goldberg Sep 22 '13 at 8:51
    
@m_goldberg agreed - I just wanted to reproduce the OP´s ticks 1:1. Without that, generating the ticks could be done more straightforward, too. –  Yves Klett Sep 22 '13 at 8:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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