我想创建这样的图,其中第三象限有一个半对数负轴。可以吗?
\begin{figure}[h!]
\centering
\begin{tikzpicture}
\begin{axis}[
axis lines = left,
xlabel={Napätie \(U_D [V]\)},
ylabel={Prúd \(I_D [A]\)},
ymin=0, ymax=200,
xmin=0, xmax=3.5,
]
\addplot [
domain=0:0.8,
samples=100,
color=blue,
]
{5.8e-9*(e^((1.602e-19*x)/(1.38e-23*300))-1)};
\addlegendentry{Si 300K}
\end{axis}
\end{tikzpicture}
\caption{Dioda}
\label{fig:my_label}
\end{figure}
我如何向该图添加半对数负轴并将其放置在第三象限?
答案1
这应该可以帮助你入门。
\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xlabel={Napätie \(U_D [V]\)},
ylabel={Prúd \(I_D [A]\)},
ymin=-100, ymax=200,
ytick={0,50,100,150,200},
xmin=-2, xmax=3.5,
]
\addplot [
domain=0:0.8,
samples=100,
color=blue,
]
{5.8e-9*(exp((1.602e-19*x)/(1.38e-23*300)-1)};
\addlegendentry{Si 300K}
\coordinate (zero) at (axis cs: 3.5,0);
\end{axis}%
\path (zero);
\pgfgetlastxy{\xzero}{\yzero}%
\begin{semilogyaxis}[
scale only axis, width=\xzero, height=\yzero,
axis x line=none, axis y line=box,
xmin=-2, xmax=3.5,
y dir=reverse,
ymin=1.0e-50, ymax=1,
ytick={1,1e-10,1e-20,1e-30,1e-40},
]
\addplot[red,nomarks, domain=-2:0] {1.0e25^\x};
\end{semilogxaxis}
\end{tikzpicture}
\end{document}