自定义对数刻度的网格线

自定义对数刻度的网格线

在下面的示例中,一些ExtremeValue数据在线性与对数对数图上显示为线性。是否可以通过应用自定义轴缩放来生成如以下代码左图所示的网格线?据我所知,没有xmode=loglog或有这样的事情,

\documentclass{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\pgfplotsset{compat=1.16}
\begin{filecontents*}{ExtremeValue.dat}
0 0.331154277152909
11.1111111111111 0.69502009750662
22.2222222222222 0.887128720985134
33.3333333333333 0.961341225207159
44.4444444444444 0.987105143707509
55.5555555555556 0.995736611644397
66.6666666666667 0.998594510759846
77.7777777777778 0.999537104517995
88.8888888888889 0.999847594388806
100 0.999949826576672
\end{filecontents*}

\begin{document}
\begin{tikzpicture}
\begin{axis}[xmode=log, ymode=log, axis lines=left, grid=both, grid style={draw=black!10},]
        \addplot[domain=1:100, samples=100] {x};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[ axis lines=left, grid=both, grid style={draw=black!10},]
        \addplot[solid] table[x index={0}, y expr=-ln(-ln(\thisrowno{1}))] {ExtremeValue.dat};
\end{axis}
\end{tikzpicture}
\end{document}

答案1

您可以安装更多或更少的任意坐标变换。这将在章节中描述4.21 符号坐标和用户变换pgfplots 手册 v1.17。以下是类型的示例loglog

\documentclass{standalone}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\pgfplotsset{compat=1.16}
\begin{filecontents*}{ExtremeValue.dat}
0 0.331154277152909
11.1111111111111 0.69502009750662
22.2222222222222 0.887128720985134
33.3333333333333 0.961341225207159
44.4444444444444 0.987105143707509
55.5555555555556 0.995736611644397
66.6666666666667 0.998594510759846
77.7777777777778 0.999537104517995
88.8888888888889 0.999847594388806
100 0.999949826576672
\end{filecontents*}

\begin{document}
\begin{tikzpicture}
\begin{axis}[xmode=log, ymode=log, axis lines=left, grid=both, grid style={draw=black!10},]
        \addplot[domain=1:100, samples=100] {x};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[ axis lines=left, grid=both, grid style={draw=black!10},
    y coord trafo/.code={\pgfmathparse{-ln(-ln(#1))}},
    y coord inv trafo/.code={\pgfmathparse{exp(-exp(-#1))}},
    ytick={0.37,0.57,...,1}
    ]
        \addplot[solid] table[x index={0}, y expr=\thisrowno{1}] {ExtremeValue.dat};
\end{axis}
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容