loglog_with_datatable

../_images/sphx_glr_loglog_with_datatable.svg
\documentclass[]{standalone}

\usepackage[]{graphicx}

\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.17}
\tikzset{>=latex}
\usetikzlibrary{arrows,arrows.meta}
\usepackage{steinmetz}
\newcommand*{\equal}{=}

\usepackage{tikz-3dplot}
\usetikzlibrary{decorations.markings}

\tikzset{->-/.style={decoration={
  markings,
  mark=at position #1 with {\arrow{>}}},postaction={decorate}}}

\begin{document}
  \pgfplotstableread{
    I     V       P
    0.1   0.21    0.021
    0.5   1.07    0.54
    1.0   2.30    2.3
    1.6   3.20    5.14
    2.0   3.73    7.46
    3.0   6.22   18.66
    5.0  10.02   50.10
    8.0  16.04  128.32
    10.0  20.0  200.00
  }\datatable
\begin{tikzpicture}
\begin{axis}[
xmode=log, ymode=log,
xmin=1e-1, xmax=1e2,
ymin=1e-1, ymax=1e4,
grid=both,
width=\textwidth,
major grid style = {line width = 0.5pt, draw = black!},
minor grid style = {line width = 0.2pt, draw = gray!},  
minor x tick num = {8},
minor y tick num = {8},
xlabel={$I$[mA]},
ylabel={$P$[mW]},
]
\addplot[mark=triangle,only marks,legend] table[x={I},y={P}] {\datatable};
\addplot[samples=100,domain=3e-1:2e1] {2*x^2};
\end{axis}
\end{tikzpicture}

\end{document}