Is there a trivial or extremely easy way to get this?
1 Answer
$\begingroup$ $\endgroup$
5 One quick way could be
Plot[21000 x, {x, 42, 49}, Ticks -> {Automatic, Range[900000, 10^6, 50000]}] 
But it losses the minor ticks for some reason and I do not know now why. If I find, will update.
Update
Thanks to J.M.'s suggestion in the comment below. It is possible to create the ticks directly. Hence using his suggestion you could do
ClearAll[x]; divs = FindDivisions[21000 {42, 49}, {5, 5}]; yTicks = Flatten[Riffle[Transpose[{{divs[[1]], divs[[1]]}}, {2, 3, 1}], Map[Function[t, {t, "", {0.005, 0.}, {AbsoluteThickness[0.1]}}], divs[[2]], {2}]], 1]; Plot[21000 x, {x, 42, 49}, Ticks -> {Automatic, yTicks}] 
J.M.'s method has the advantage that minor ticks are not lost which is better.
- 1$\begingroup$ Here's something you can put in for the vertical ticks:
Flatten[Riffle[Transpose[{{#1, #1}}, {2, 3, 1}], Map[Function[t, {t, "", {0.005, 0.}, {AbsoluteThickness[0.1]}}], #2, {2}]], 1] & @@ FindDivisions[{882000, 1029000}, {5, 5}]. $\endgroup$J. M.'s missing motivation– J. M.'s missing motivation2020-05-10 01:10:56 +00:00Commented May 10, 2020 at 1:10 - $\begingroup$ @J.M. that is very nice. I was trying this, but could not make it work:
p1 = Plot[21000 x, {x, 42, 49}] oldTicks = AbsoluteOptions[pl, Ticks][[1, 2, 2]]This gives the original ticks. But could find how to replace the labels. I was trying to useAccountingForm, then doShow[p1, Ticks -> {Automatic, newTicks}]wherenewTicksis the old ones, but changed the labels. This did not work. Your method seems to make everything from scratch. Please feel free to post this as answer. $\endgroup$Nasser– Nasser2020-05-10 01:15:56 +00:00Commented May 10, 2020 at 1:15 - $\begingroup$
AbsoluteOptions[]has been broken for a while, unfortunately. Also, I'd prefer you just edit your answer (I have upvoted already) to include that minor fix. $\endgroup$J. M.'s missing motivation– J. M.'s missing motivation2020-05-10 01:17:17 +00:00Commented May 10, 2020 at 1:17 - $\begingroup$ Thanks for the answers, Wow, that escalated quickly! The Range[900000, 10^6, 50000] solution does not have generality. I was hoping to see something like AxisNumberForm -> Decimal. I guess that this is one point in favor of Excel, which is almost unbelievable. $\endgroup$bowzee– bowzee2020-05-11 01:59:33 +00:00Commented May 11, 2020 at 1:59
- $\begingroup$ @bowzee can you elaborate? How does this solution not “generalize”? $\endgroup$CA Trevillian– CA Trevillian2020-05-18 22:03:18 +00:00Commented May 18, 2020 at 22:03
