2

I want to change the position of x and y axis labels.

I want to draw the following graph.

enter image description here

But I am able to draw the graph like this.

enter image description here

MWE

 \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}

0 Answers0