I am creating a calculus sign diagram by creating a number line and labeling each side of it - the right side with an x and the left side with a y'. Above appropriate intervals I want to add plus and minus signs.
In the example below I want the x label to be on the right side of the arrowhead vertically centered with the line instead of above the line. On the left-hand side I'd like to add a y' vertically centered the same way. How can I accomplish this? By adding a node?
Above the interval [-3,0] I'd like to center a plus sign over it to show that the derivative is positive there. How can I add the plus sign like this?
I run pdflatex.
\documentclass{article}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{pgfplots}
\pgfplotsset{compat = newest}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis x line=middle,
axis y line=none,
xmin=-4.75, xmax=3.75, xlabel = $x$, xtick={-3,0,2},
width = 10cm]
\addplot[
domain=-3:2,
samples=800,
smooth,
thick,
blue,
] {0};
\addplot[
domain=-4.75:-3,
samples=800,
smooth,
thick,
yellow,
] {0};
\addplot[
domain=2:3.75,
samples=800,
smooth,
thick,
yellow,
] {0};
\end{axis}
\end{tikzpicture}
\end{document}

;-)Math rendering is deactivated on the site. See https://tex.meta.stackexchange.com/q/1272/82917 – campa Nov 08 '21 at 14:58