0

I have this plot, with a very large scale for both x and y axes:

\documentclass[border=2mm,tikz]{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{arrows.meta}

\pgfplotsset{ /pgfplots/layers/altorder/.define layer set={ axis background,axis grid,main,axis ticks,axis lines,axis tick labels, axis descriptions,axis foreground }{/pgfplots/layers/standard}, }

\begin{document}

\begin{tikzpicture} \begin{axis}[width=\textwidth, xmin=-1e12, xmax=2e12, ymin=-5e23, ymax=2e24, axis line style = thin, axis lines=middle, axis line style={-{Stealth[length=2.5mm]}}, thick, y tick label style={/pgf/number format/sci}, x tick label style={/pgf/number format/sci, rotate=45, anchor=east}, grid=major, grid style={dashed,gray!30}, set layers=altorder]

\addplot[draw=blue,thick,restrict y to domain={-5e23:2e24}] {x};

\end{axis} \end{tikzpicture}

\end{document}

I tried using label style={/pgf/number format/sci} but the result is not exactly what I was expecting:

enter image description here

Instead of being respectively in the upper left and the lower right, I would like that 10^24 and 10^12 were along the axes (respectively y and x), besides each tick, instead of 10^0 and 10^{-1}, which do not make sense.

How to accomplish this requirement?


As requested, the code has been updated: now it is a MWE. It tries to plot x, but it actually doesn't show anything. It anyway shows the issue about the tick labels. The suggestion in the linked answer has already been applied to obtain oblique tick labels.

BowPark
  • 1,213
  • Could you make an example that doesn't rely on files we don't have (test.tex), and which includes all the necessary libraries? Preferably a complete example, that can be copied and compiled without any modifications. – Torbjørn T. Dec 07 '20 at 18:16
  • 2
    That said, scaled ticks=false (e.g. https://tex.stackexchange.com/questions/9803) and https://tex.stackexchange.com/a/183411/ perhaps for 2. – Torbjørn T. Dec 07 '20 at 18:24
  • @TorbjørnT. I updated my question, providing a working example. Thank you. With scaled ticks=false it works. If you want, you can write an answer. – BowPark Dec 07 '20 at 19:11

0 Answers0