[Tex/LaTex] Half filled circle marker

pgfplotstikz-pgf

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 no fill applied to the white portion. Furthermore, you can use this technique to create any other marker type that you want to highlight special points.

enter image description here

Code:

\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}
%  
\newcommand{\MyHalfCircle}[3][0.4ex]{%
    % #1 = size
    % #2 = x coordinate
    % #3 = y coordinate
  \begin{scope}
   \draw (axis cs:#2,#3) circle (#1);
   \clip (axis cs:#2,#3) circle (#1);
   \fill[red, opacity=0.75] (axis cs:#2,#1) rectangle (axis cs:-#1,-#1);
  \end{scope}
}

%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
    ] 

     \addplot [smooth,blue, mark=none,thick,  domain=-5:5] {x^2}; 
     \addplot [mark=halfcircle*, mark options={rotate=90}] coordinates {(0,0)}; 
     \MyHalfCircle{1}{1};
   \end{axis}
  \end{tikzpicture}
\end{document}