In this figure two of my x-labels overlap with functions. I would like to either move the labels to the top or perhaps give them a white box? Not sure what looks better.
How can I do that?
\documentclass[letter,11pt,twoside]{article}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\usepackage{stmaryrd}
\usepackage{array,booktabs}
\usepackage{placeins}
\pgfplotsset{
compat=newest,
xlabel near ticks,
ylabel near ticks,
myplot/.style={smooth,tension=0.5,mark=none,very thick}
}
\begin{document}
\begin{figure}[h]
\begin{tikzpicture}[
labelnode/.style={font=\footnotesize, above},%
labelline/.style={stealth-stealth,shorten >=0.1pt, shorten <=0.5pt}%
]%
\begin{axis}[%
width=0.95\textwidth,height=0.4\textheight,%
axis x line=center,%
xmin=0,%
xmax=0.8,%
xtick={0.2,0.22,0.458,0.70},%
xticklabels={{$c_1$},{$c_2$},{$c_{S_2}$},{$w_{S_2}^*$}},%
axis y line=left,%
ymin=-75,%
ymax=85,%
ytick={0},%
yticklabels={{0}},%The ** looks odd there - I know. but otherwise it clashes into c_S_2; I think we can keep it as is. Not an error, but on purpose ;)
ylabel={$\Delta\left(E\left[\pi\right]\right)$},%
xlabel={$c_{S_1}$},%
label style={at={(axis description cs:1,0.46)},anchor=north},
y label style={at={(axis description cs:-0.06,0.95)},rotate=-90,anchor=south},
]%
% Retailer
\addplot+[color=black,myplot, thick]%price
coordinates {%
(0, 70.) (0.34, -45.42384424965933) (0.7000000000000001, 0)
}%
;%
% S1
\addplot+[color=gray,myplot,thick]%
coordinates {%
(0, -70.) (0.31, 25.52000000000001) (0.45, 0)
}
;%
\draw[densely dotted] (0.70, -75) -- (0.70,85);%
\draw[densely dotted] (0.22, -75) -- (0.22,85);%
\draw[densely dotted] (0.2, -75) -- (0.2,85);%
\end{axis}%
\end{tikzpicture}%
{Effect of financial distress on expected profits\label{delta}}
\end{figure}
\end{document}


axis x line=right. They will still overlap with each other, though. What do you want to do about that? – Jan 29 '20 at 16:13