1

I am trying to draw a circular node at the origin,while keeping the y-axis to the left and the x-axis to the bottom. The node results to be a quarter of a circle. How can I keep it full circle while preserving the axis?

Below is the code I am using.

\begin{tikzpicture}[baseline]
\begin{axis}[
    axis y line = left,
    axis x line=bottom,
    xlabel = t,
    xtick = {\empty},
    ytick =  {\empty},
]
\addplot [
    domain=-6:6, 
    samples=100, 
    color=gray,
    line width = 0.55mm,
    ]
    {1/(1+exp(-\x))};
   \draw[fill] (0,0) circle[radius=3pt];  
    \end{axis} ;

\end{tikzpicture}
}

Thank you!

1
  • You can draw it outside the axis environment, if you first create a named coordinate at (axis cs: 0,0). Oct 11, 2016 at 22:55

2 Answers 2

1

One possibility is

after end axis/.code={\draw[fill] (current axis.origin) circle[radius=3pt];}

to avoid that the node is clipped at the border of the axis. Instead (current axis.origin) you could also use (axis cs:0,0) in the code above.

enter image description here

\documentclass[margin=5pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}[baseline]
\begin{axis}[
    axis y line = left,
    axis x line=bottom,
    xlabel = t,
    xtick = {\empty},
    ytick =  {\empty},
    after end axis/.code={\draw[fill] (current axis.origin) circle[radius=3pt];}
]
\addplot [
    domain=-6:6, 
    samples=100, 
    color=gray,
    line width = 0.55mm
    ]
    {1/(1+exp(-\x))};
    \end{axis}
\end{tikzpicture}
\end{document}
0

I'd use

\addplot[color=black,only marks,mark=*] (-6,0);

which gives

screenshot

here's a complete MWE:

% arara: pdflatex
\documentclass{standalone}
\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}
\begin{axis}[
    axis y line = left,
    axis x line=bottom,
    xlabel = t,
    xtick = {\empty},
    ytick =  {\empty},
]
\addplot [
    domain=-6:6, 
    samples=100, 
    color=gray,
    line width = 0.55mm,
    ]
    {1/(1+exp(-\x))};
   \addplot[color=black,only marks,mark=*] (-6,0);
    \end{axis} 

\end{tikzpicture}


\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.