1
$\begingroup$

I am unsure how to keep the minor ticks when I specify the tick values. For instance, consider the MWE

Plot[Sinh[x], {x, -20, 20}, Frame -> True, 
 FrameTicks -> {{Table[{x, 
      ScientificForm[x, NumberPoint -> ""]}, {x, {15.^5, 15.^5/2, 
       0, -15.^5/2, -15.^5}}], None}, {Automatic, None}}]

which produces the plot

enter image description here

How can I keep the minor ticks on the left vertical axis?

$\endgroup$
5
  • $\begingroup$ Out of curiosity, why are you removing the number point? The resulting tick labels are quite misleading. $\endgroup$
    – MarcoB
    Nov 18, 2023 at 1:57
  • $\begingroup$ @MarcoB Apologies, I did not mean to do that here. I have done so for a previous problem (see mathematica.stackexchange.com/questions/291637/…) $\endgroup$
    – Bell
    Nov 18, 2023 at 3:37
  • 1
    $\begingroup$ The {15.^5, 15.^5/2, 0, -15.^5/2, -15.^5} should be {15.*^5, 15.*^5/2, 0, -15.*^5/2, -15.*^5} and remove the , NumberPoint -> "" $\endgroup$
    – Bob Hanlon
    Nov 18, 2023 at 5:25
  • $\begingroup$ @BobHanlon Thanks, but this does not seem to keep the minor ticks on the vertical axis. $\endgroup$
    – Bell
    Nov 18, 2023 at 5:33
  • 2
    $\begingroup$ Yes, but it avoids the nonsensical labels. $\endgroup$
    – Bob Hanlon
    Nov 18, 2023 at 5:40

1 Answer 1

2
$\begingroup$
$Version

(* "13.3.1 for Mac OS X ARM (64-bit) (July 24, 2023)" *)

Clear["Global`*"]

Flavor to taste:

yTicks = Join[{#, "", {0.006, 0.}} & /@ Range[-10^6., 10^6., 10^5.],
   {#, ScientificForm[#], {0.01, 0.}} & /@
    {15.*^5, 15.*^5/2, 0, -15.*^5/2, -15.*^5}];

Plot[Sinh[x], {x, -20, 20},
 Frame -> True,
 FrameTicks ->
  {{yTicks, None}, {Automatic, None}}]

enter image description here

$\endgroup$
2
  • $\begingroup$ Thanks! May I ask what the Range[...] controls? $\endgroup$
    – Bell
    Nov 18, 2023 at 6:07
  • 1
    $\begingroup$ It specifies that the minor ticks (without labels) be placed at intervals of 10^5. $\endgroup$
    – Bob Hanlon
    Nov 18, 2023 at 6:10

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.