How can I draw a half filled circle on my axis. I would like the marker to be at the origin and be filled on the left half of the circle.
\documentclass[12pt,]{article}
\usepackage{graphicx}
\usepackage{pgfplots}
\begin{document}
%what i want my marker to look like
\begin{tikzpicture}
\draw (0,0) circle (1cm);
\clip (0,0) circle (1cm);
\fill[black] (0cm,1cm) rectangle (-1cm,-1cm);
\end{tikzpicture}
%what the graph looks like and the marker looks like
\begin{tikzpicture}
\begin{axis}[
minor tick num=1,
axis x line = center,
axis y line = middle,
xlabel={$x$},
ylabel={$\dot{x}$},
ymin=-5, ymax=5
]
%\draw[thin] (axis cs:1,0) circle [radius=3pt] node[above left] {$(1,0)$};
\draw[fill] (axis cs:0,0) circle [radius=3pt] node[below right] {$(0,0)$};
\addplot [smooth,blue, mark=none,
domain=-5:5] {x^2};
\end{axis}
\end{tikzpicture}
\end{document}
Best Answer
As per @percusse's comment you can use
mark=halfcircle*
and apply a rotation as shown at(0,0)
below.Alternatively, you could adapt your version and define a custom macro to place this as desired (as shown at
(1,1)
). This has the advantage that there is nofill
applied to the white portion. Furthermore, you can use this technique to create any other marker type that you want to highlight special points.Code: