I'm having trouble customizing the ticks on a 2D plot.

I currently have:

e^(-x/5.2917721067*10^(-11))}, {x,0,15*5.2917721067*10^(-11)}]

I want to customize the ticks such that it shows a tick at every interval of a0 = 5.2917721067*10^(-11) (hence the 0 -> 15*a0).

However, when I try to do:

e^(-x/5.2917721067*10^(-11))}, {x,0,5.2917721067*10^(-11)}, Ticks -> 
{{5.2917721067*10^(-11), a0}, {2*5.2917721067*10^(-11), 2a0}...}]

It fails to even plot the correct graph; it attempts to plot a straight line defined by:

Plot 5.2917721067

Is there something I'm missing?


1 Answer 1


You had a number of syntax mistakes in the function you were plotting. Here's what I'd do in this case:

a0 = QuantityMagnitude[UnitConvert[Quantity[1, "BohrRadius"]]];
Plot[1/8 (4 - 4 x/a0 - (x/a0)^2) Exp[-x/a0], {x, 0, 15 a0}, 
     Ticks -> {Table[{k a0, Style[If[k > 1, Row[{k, Subscript[a, 0]}], Subscript[a, 0]],
                     {k, 0, 15}], Automatic}]


  • $\begingroup$ Thank you very much. I'm new to mathematica and this is a ton of help. $\endgroup$
    – John
    Commented May 20, 2017 at 8:39

Your Answer

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

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