Graphics, Figures & Tablesradius of coloured circle with text inside

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
paulosousa
Posts: 90
Joined: Sun Jun 24, 2012 8:48 pm

radius of coloured circle with text inside

Post by paulosousa »

Hello,

I am trying this code

Code: Select all

\tikz \node[circle,radius=0.5cm,color=white, fill=blue]{text}; 
to get a blue circle wit text inside.
But the option radius is not working... Could anyone please help me?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

radius of coloured circle with text inside

Post by Stefan Kottwitz »

A radius option doesn't work for a node. It works with a normal circle shape:

Code: Select all

\begin{tikzpicture}
  \draw[fill=blue] (0,0) circle [radius=0.5cm];
  \node[color=white] {text};
\end{tikzpicture}
If you would really like to use a node, you can set inner sep to 0 and a minimum size, such as

Code: Select all

\begin{tikzpicture}
  \node[circle, inner sep=0pt, minimum size=1cm, color=white, fill=blue]{text}; 
\end{tikzpicture}

Stefan
LaTeX.org admin
paulosousa
Posts: 90
Joined: Sun Jun 24, 2012 8:48 pm

radius of coloured circle with text inside

Post by paulosousa »

Thanks a lot Stefan

Yesterday I tried

Code: Select all

\tikz \node[circle,scale=0.75,color=white, fill=blue]{text};
and worked fine!
Post Reply