1

I have the following code for a plot.

\documentclass[]{article}
\usepackage{tikz, pgfplots}
\begin{document}
\begin{figure}[h]
\centering
\begin{tikzpicture}
\begin{axis}[
xlabel=$w_{jk}^*$,
ylabel={$\frac{\partial U_i^*}{\partial l_i}$},
xtick={0,0.1,0.2},
domain=0:.2,
samples=20,
xmin=0.02,
xmax=0.23,
ymin=-43,
ymax=-39
]
\addplot {-300*x^3-40};
\end{axis}
\end{tikzpicture}
    \end{figure}

\end{document}

I need to convert this to the following figure. That is, I need to have an (0,0) near the origin in lieu of the xaxis and yaxis numbers. The dots on the figure may or may not remain. enter image description here

  • 4
    Hi and Welcome to TeX.SX! Why have you set the axis limits to these values? A node at (0,0) will be outside of the current plot window due to the axis limits. That being said, you can use something like \node [below left] at (axis cs:0,0) {(0,0)}; to add a node at the axis coordinates (0,0) – Grimler Oct 10 '17 at 13:47
  • Off-Topic: You always should set option compat asap after loading pgfplots. See the pgfplots manual for more information. – Schweinebacke Oct 10 '17 at 14:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.