2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-19 11:38:05 +02:00

Make axis be on top

This commit is contained in:
Martin Thoma 2016-03-06 10:43:54 +01:00
parent 04f9fc5612
commit ad739ff3c2
2 changed files with 19 additions and 2 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Before After
Before After

View file

@ -41,13 +41,30 @@
\draw[fill=black!25] (axis cs:-1.5,0.5) rectangle (axis cs:-1.0,1.7) node[pos=.5] {B}; \draw[fill=black!25] (axis cs:-1.5,0.5) rectangle (axis cs:-1.0,1.7) node[pos=.5] {B};
\draw[fill=white] (axis cs:-1.5,-.7) rectangle (axis cs:-1.0,0.5) node[pos=.5] {D}; \draw[fill=white] (axis cs:-1.5,-.7) rectangle (axis cs:-1.0,0.5) node[pos=.5] {D};
\draw[red,thick] (axis cs:-0.5,-.5) rectangle (axis cs:1,1.5) node[pos=.5] {D}; \end{axis}
\begin{axis}[
axis x line=middle,
axis y line=middle,
grid = major,
grid style={dashed, gray!30},
xmin=-1.25, % start the diagram at this x-coordinate
xmax= 1.25, % end the diagram at this x-coordinate
ymin=-0.75, % start the diagram at this y-coordinate
ymax= 1.75, % end the diagram at this y-coordinate
xlabel=$s$,
ylabel=$t$,
%xticklabels={-2,-1.6,...,7},
%yticklabels={-8,-7,...,8},
tick align=outside,
minor tick num=-3,
enlargelimits=true,
tension=0.08]
\draw[red,thick] (axis cs:-0.5,-.5) rectangle (axis cs:1,1.5) node[pos=.5] {};
\node[label={180:{1}},circle,fill,inner sep=2pt] at (axis cs:-0.5,-0.5) {}; \node[label={180:{1}},circle,fill,inner sep=2pt] at (axis cs:-0.5,-0.5) {};
\node[label={180:{2}},circle,fill,inner sep=2pt] at (axis cs:1,-0.5) {}; \node[label={180:{2}},circle,fill,inner sep=2pt] at (axis cs:1,-0.5) {};
\node[label={180:{3}},circle,fill,inner sep=2pt] at (axis cs:1,1.5) {}; \node[label={180:{3}},circle,fill,inner sep=2pt] at (axis cs:1,1.5) {};
\node[label={180:{4}},circle,fill,inner sep=2pt] at (axis cs:-0.5,1.5) {}; \node[label={180:{4}},circle,fill,inner sep=2pt] at (axis cs:-0.5,1.5) {};
\end{axis} \end{axis}
\end{tikzpicture} \end{tikzpicture}
\end{document} \end{document}