1
$\begingroup$

When I insert the option Automatic or All, why are the ticks on x axis blank?

Plot[x, {x, 0, 5}, Frame -> True, FrameTicks -> {
   {{{1, "a"}, {2, "b"}}, {Automatic}},
   {{Automatic}, {Automatic}}}]

or

Plot[x, {x, 0, 5}, Frame -> True, FrameTicks -> {
   {{{1, "a"}, {2, "b"}}, {Automatic}},
   {{All}, {Automatic}}}]

Which is the right code to hold numbers on x axis (without writing them manually)?

Thank you for your time.

$\endgroup$
1
  • 1
    $\begingroup$ use FrameTicks -> {{{{1, "a"}, {2, "b"}}, Automatic}, {Automatic, Automatic}} (remove the braces around Automatic) $\endgroup$
    – kglr
    Sep 17, 2018 at 9:31

1 Answer 1

1
$\begingroup$

Remove the braces around Automatic:

Plot[x, {x, 0, 5}, Frame -> True, 
 FrameTicks -> {{{{1, "a"}, {2, "b"}}, Automatic}, {Automatic, Automatic}}]

enter image description here

$\endgroup$
3
  • $\begingroup$ ok it works! Very useful reply. Can you tell me what is the meaning of the braces which I removed please? $\endgroup$ Sep 17, 2018 at 9:34
  • 1
    $\begingroup$ @GennaroArguzzi, In FrameTicks -> {{left, right}, {bottom, top}} the elements left, right, bottom and top can only be a list or one of Automatic, None, All, True or False ( not {Automatic}) $\endgroup$
    – kglr
    Sep 17, 2018 at 9:39
  • $\begingroup$ Your explanation are very clear @kglr! $\endgroup$ Sep 17, 2018 at 9:40

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.