I want to label a tick mark on the x-axis and a tick mark on the y-axis. I put a "%" before the commands in the following code so that the line could be plotted and the tick marks can be drawn. The tick mark on the y-axis is 30,042; I understand that TikZ
interprets this as two numbers. I tried using $30,042$ and also got an error. How do I get 30,042 on the y-axis and 60,084 on the x-axis?
\documentclass[10pt]{amsart}
\usepackage{tikz}
\usepackage{mathtools}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11}
\begin{document}
\begin{tikzpicture}
\begin{axis}[width=5in,axis equal image,
axis lines=middle,
xmin=-5000,xmax=70000,samples=2,
xlabel=$x$,ylabel=$y$,
ymin=-5000,ymax=35000,
restrict y to domain=-5000:35000,
enlargelimits={abs=0.5cm},
axis line style={latex-latex},
ticklabel style={font=\tiny,fill=white},
extra x ticks={60084},
% extra x tick labels={60,084},
extra y ticks={30,042},
% extra y tick labels={$30,042$},
yticklabel style={anchor=east},
xtick={\empty},ytick={\empty},
xlabel style={at={(ticklabel* cs:1)},anchor=north west},
ylabel style={at={(ticklabel* cs:1)},anchor=south west}
]
\addplot[latex-latex,samples=200,domain=-5000:70000,blue] {-0.5*x + 30042} node[above, pos=0.75,font=\footnotesize]{$3x + 6y = 180,252$};
\end{axis}
\end{tikzpicture}
\end{document}
extra y ticks={30,042},
results in a plot with the tick labels that you describe.extra x ticks={60084},extra y ticks={30042}
and removeextra y tick labels={$30042$},
andextra x tick labels={60084}
extra x tick labels={\empty},
and the y-variant to the axis section.