Seite 1 von 1

Wissenschaftliche Achsenbeschriftung von log-Achse

Verfasst: Di 13. Feb 2024, 16:32
von neuLing2024
Hallo!

Ich habe bei angehängtem Beispiel das Problem, dass die Labels auf meiner y-Achse nicht korrekt angezeigt werden. Alle aufgeführten Labels (2000, 20000,usw) will ich im Format 2*10^3, 2*10^4 etc haben. Mit den angezeigten Werten wie "10^3.3"(=2000) kann ich leider nichts anfangen. Ich bin mir ziemlich sicher, dass das Problem an "ymode = log" liegt, weiß aber nicht zu helfen.

Wie es bei mir momentan angezeigt wird:
test.png
Beispiel:
\documentclass{article}

\usepackage{graphicx}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepackage{tikz}

\begin{document}

\begin{figure}
    \centering
    \begin{tikzpicture}
        \begin{axis}[width=\textwidth,height=0.4\textheight,
                xmajorgrids,
                xmode = log,
                ymode = log,
                %loglogaxis,
                %log ticks with fixed point,
                x tick label style={/pgf/number format/.cd,sci,precision=2},
                y tick label style={/pgf/number format/.cd,sci,precision=2},
                xlabel near ticks,
                ylabel near ticks,
                xlabel = {Beschriftung x},
                ylabel = {Beschriftung y},
                xmin=10, xmax=100000,
                ymin=1000, ymax=2000000,
                ytick={2000, 20000, 100000, 700000, 1000000, 1600000},
                ]
                % Daten
                \addplot+ [mark=none, color=teal] coordinates{(100,1000000) (1000,1000000)};
                \addplot+ [mark=none, color=teal] coordinates{(100,100000) (1000,100000)};
                \addplot+ [mark=none, color=teal] coordinates{(100,100000) (100,1000000)};
                \addplot+ [mark=none, color=teal] coordinates{(1000,100000) (1000,1000000)};
                \node at (axis cs: 300,150000) {Beschreibung Daten};
                \fill[color=teal, ultra nearly transparent](100,100000) rectangle (1000,1000000);
        \end{axis}
    \end{tikzpicture}
    \caption{Bildunterschrift}\label{fig:test}
\end{figure}

\end{document}
test_code.txt
(1.57 KiB) 23-mal heruntergeladen
Liebe Grüße

Re: Wissenschaftliche Achsenbeschriftung von log-Achse

Verfasst: Mi 14. Feb 2024, 17:50
von Berater
Dann setze die Markierungen im festgelegten Bereich mit 'ytick' an der Ordinate auf Werte, die einem ganzzahligen Exponenten entsprechen. Da muss man nicht lange überlegen, um zu sehen, dass das nur Werte mit einer '1' vorne dran sein können.