我想改变 x 和 y 轴标签的位置。
我想要绘制下面的图形。
但我能够绘制这样的图形。
平均能量损失
\documentclass{article}
\usepackage{pgfplots}
\usepackage{amsmath}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xmin=-1.5,
xmax=1.5,
ymin=-1.5,
ymax=1.5,
xtick distance=1, %puts number at a unit distance
ytick distance=1, %puts number at a unit distance
xlabel=$x$,
ylabel={$V(x)$},
% domain=-10:10,
% domain=-2:2,
samples=100,
axis lines=middle,
% code for additional points
extra x ticks={2/3},
extra x tick labels={$\dfrac{2}{3}$},
% ytick={0, 1},
% yticklabels={$0$, $1$},
% xtick={0.66666},
% xticklabels={$2/3$},
% enlarge x limits=0.05,
% enlarge y limits=0.1,
% xtick={0, 1, 2, 3},
% xticklabels={$0$, $1$, $2$, $3$},
% ytick={0, 2, 4, -2},
% yticklabels={$0$, $2$, $4$, $-2$},
% ytick={0, 1},
% yticklabels={$0$, $1$},
]
\addplot [thick, smooth] {x^2 - x^3};
% \addplot [draw = blue, thick, smooth, , domain=0.1:4.1] {x + (1/x)};
% \addplot [draw = blue, thick, smooth, , domain=-4.1:-0.1] {x + (1/x)};
%
% restrict y to domain=-3.2:3.2,
\end{axis}
\end{tikzpicture}