- #1

- 319

- 0

Anyone know how to do it...

I have googles it and find no useful things. Kind of frustrated.

You are using an out of date browser. It may not display this or other websites correctly.

You should upgrade or use an alternative browser.

You should upgrade or use an alternative browser.

- Mathematica
- Thread starter hanson
- Start date

- #1

- 319

- 0

Anyone know how to do it...

I have googles it and find no useful things. Kind of frustrated.

- #2

Science Advisor

Homework Helper

- 4,309

- 49

Code:

```
ScientificTicks[plot_Graphics, xSci_: False, ySci_: True] :=
Module[{t},
Show[plot,
Ticks -> {(t = Ticks /. AbsoluteOptions[plot, Ticks])[[1]] /.
If[xSci, {x_, xlab_?NumericQ, r__} -> {x, ScientificForm[x],
r}, {}],
t[[2]] /.
If[ySci, {y_, ylab_?NumericQ, r__} -> {y, ScientificForm[y],
r}, {}]}]
];
```

The first argument is a plot and the next two arguments indicate whether you want scientific notation on the x- and y-axis, respectively. If you leave them out you will get scientific notation on the y-axis only.

Code:

```
(* Normal on x, Scientific on y *)
ScientificTicks[Plot[Exp[x], {x, 0, 100}], False, True]
ScientificTicks[Plot[Exp[x], {x, 0, 100}], False]
ScientificTicks[Plot[Exp[x], {x, 0, 100}]]
(* Scientific on x, Normal on y *)
ScientificTicks[Plot[Exp[x], {x, 0, 100}], True, False]
(* Scientific on both *)
ScientificTicks[Plot[Exp[x], {x, 0, 100}], True, True]
ScientificTicks[Plot[Exp[x], {x, 0, 100}], True]
```

You can edit the defaults in the first line (e.g. change "xSci_:False" to "xSci_:True").

Share:

Mathematica
Mathematica Graph Plotting for Scientific Papers

- Replies
- 3

- Views
- 1K

- Replies
- 6

- Views
- 549

Mathematica
Matrices in Mathematica -- How to calculate eigenvalues, eigenvectors, determinants and inverses?

- Replies
- 3

- Views
- 214

Mathematica
Neural networks in Wolfram Mathematica

- Replies
- 1

- Views
- 181

- Replies
- 6

- Views
- 1K

- Replies
- 4

- Views
- 1K

- Replies
- 1

- Views
- 492

- Replies
- 1

- Views
- 560

- Replies
- 2

- Views
- 658

- Replies
- 1

- Views
- 656