I am trying to draw my manual defined markers (several stripes) but i seem unable to crop the plot (to [-.5,.5] in both dimensions). I can't even understand the effects of pgfplots here.
My (n)MWE is
\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{filecontents}{pgfplots-plot-limits.dat}
X Y color
0 0 1
-0.5 0 0
\end{filecontents}
\begin{document}
\begin{tikzpicture}
\pgfdeclareplotmark{thiscube}{\draw[ultra thin, fill] (0.23438,-0.5) -- (0.26562,-0.5) -- (-0.23438,0.5) -- (-0.26562,0.5);}
\begin{axis}[colormap/hot,
xmin=-0.5, xmax=0.5, ymin=-0.5, ymax=0.5,
axis equal,clip=true,xtick=\empty, ytick=\empty,hide axis
]
\pgfplotsextra{\clip (axis cs:-0.5,-0.5) rectangle (axis cs:0.5,0.5);}
\addplot+[scatter,scatter src=explicit,mark=thiscube,only marks]
table [x=X,y=Y,meta=color] {pgfplots-plot-limits.dat};
\draw[thick,blue] (axis cs:-0.5,-0.5) rectangle (axis cs:0.5,0.5);
\end{axis}
\end{tikzpicture}
\end{document}
An I start off by removing the second data item -0.5 0 1 just for simplicity. Then the marker (a small parallelotope spanning the ymin-ymax range) should be drawn at 0 0 in however the result is (the last line in the axis is just a little helper indicating the original x and y range):

However, if I remove (comment out) the line xmin=-0.5, xmax=0.5, ymin=-0.5, ymax=0.5, the result looks fine (however the physical dimensions seem to change drastically):
However, i am unable to crop these. Adding the second data item (same parallelotope shifted to these; together with the axis and the second data item I obtain
As before i am wondering, about the following (it just gets clearer here):
- Why does my pgfplotsextra not clip as expected?
- Why are my markers shifted? The red one (which is in the this picture the
0,0data item is not centered at(0,0)(what I would expect of the marker) but at(.5,.5) - If the positioning would work right,
clip marker paths=trueshould work - like mentioned here; how can I position them correctly?
And yes, after clipping there should only be a very small portion left of the second data item, that's expected.


