1

I want to draw a circle between the x and y-axis. I also want to write a word over the radius. The arrow in the radius is not showing, how to improve it?

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{center}
\begin{tikzpicture}[scale=0.6]
\filldraw[color=black!60, fill=white!5, very thick](-1,0) circle (2.5);
\filldraw [red] (-1,0) circle (3pt) node[above right] (n1) {$h$};

\draw (-1,0) [thick] edge[->] (-2.2,-2.2);


\end{tikzpicture}
\end{center}
\end{document}

2 Answers 2

8

Like this?

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{decorations.text}
\begin{document}
\begin{center}
\begin{tikzpicture}[scale=0.6]
\filldraw[color=black!60, fill=white!5, very thick](-1,0) circle (2.5);
\draw[postaction={decorate,
    decoration={raise=4pt, text along path, 
    text align=center, reverse path,
    text={a word}}}, thick, -Stealth] (-1,0) -- (-2.2,-2.2);
\filldraw [red] (-1,0) circle (3pt) node[above right] (n1) {$h$};
\draw[-Stealth] (-4,-3) -- (4,-3) node[below left] {$x$};
\draw[-Stealth] (-4,-3) -- (-4,4) node[below left] {$y$};
\end{tikzpicture}
\end{center}
\end{document}

enter image description here

6
  • Yes but positive x and positive y axis are missing.
    – Shi
    Commented May 31, 2022 at 5:29
  • 2
    @Shi Should the axes be positioned from (0,0) or from the center of your circle or where?
    – CarLaTeX
    Commented May 31, 2022 at 5:37
  • position of circle is completely inside the xy axis
    – Shi
    Commented May 31, 2022 at 5:47
  • 1
    @Shi Look my renewed answer.
    – CarLaTeX
    Commented May 31, 2022 at 6:04
  • 2
    +1, however regarding axis: if centers of circles are at (-1,0) than I conclude, that x-axis cross circles centers and y-axis is for one unit to right of them. If this is not so, then is unclear what OP like to tell with selected coordinates of circle.
    – Zarko
    Commented May 31, 2022 at 6:23
3

As I understand the OP question and comments, the MWE's code should be something like this:

\documentclass[margin=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
                quotes}

\begin{document}
    \begin{tikzpicture}[
                > = Stealth,
every edge quotes/.style = {auto, font=\footnotesize, sloped},
              dot/.style = {circle, fill=red, inner sep=0pt,
                            minimum size=6pt, label=#1}
                        ]
% axis
\draw[->] (-0.5,0) -- (6,0) node[below left] {$x$};
\draw[->] (0,-0.5) -- (0,6) node[below left] {$y$};
% circles
\path[draw=black!60, very thick] (3,3) coordinate (n1) % that circles are in positive quater of plane 
                                circle[radius=25mm];
\node (n1) [dot=above right:$h$]  at (n1) {};
% vector with text
\draw[->]   (n1)    to ["a word"] ++ (210:2.5);
    \end{tikzpicture}
\end{document}

enter image description here

Edit: However, from code also follows, that image may be something like this:

enter image description here

This time is considered scale=0.6 picture option as is in OP code fragment, consequently are adopted coordinates of axis arrows:

\documentclass[margin=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
                quotes}

\begin{document}
    \begin{tikzpicture}[scale=0.6, 
                       > = Stealth,
every edge quotes/.style = {auto, font=\footnotesize, sloped},
              dot/.style = {circle, fill=red, inner sep=0pt,
                            minimum size=6pt, label=#1}
label=#1}
                        ]
% axis
\draw[->] (-4,0) -- (3,0) node[below left] {$x$};
\draw[->] (0,-3) -- (0,4) node[below left] {$y$};
% cirxkws
\path[draw=black!60, very thick] (-1,0) coordinate (n1)
                                circle[radius=25mm];
\node (n1) [dot=above right:$h$]  at (n1) {};
% vector with text
\draw[->]   (n1)    to ["a word"] ++ (210:2.5);
    \end{tikzpicture}
\end{document}

Remark: To me the question is a bit unclear. If the whole circle must be in the positive quarter of the plane, then the origin of the circle must be at least the size of the circle radius away from the coordinate axes (as is done in the first example). This remark may seem picky to some, but it is necessary (in my opinion) to be aware of the basics of geometry.

1
  • @Shi, see edited answer!
    – Zarko
    Commented May 31, 2022 at 7:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .