Hot answers tagged

90 votes

How is arc defined in TikZ?

\draw (x,y) arc (start:stop:radius); draws an arc with radius radius starts from (x,y) with center (x-r*cos(start), y-r*sin(start)) and ends at (x-r*cos(start)+r*cos(stop), y-r*sin(start)+r*sin(stop))...
user avatar
76 votes

Draw a rectangle with rounded ends in TikZ

If people come to this question via Google (like me) and want to get only a rectangle with rounded corners: \draw[rounded corners] (0, 0) rectangle (4, 1) {}; This is an empty rectangle with rounded ...
user avatar
  • 17.2k
45 votes

Drawing a TikZ arc specifying the center

Now as TikZ 3.0 is here we can use pic. \documentclass[tikz,border=5]{standalone} \tikzset{ pics/carc/.style args={#1:#2:#3}{ code={ \draw[pic actions] (#1:#3) arc(#1:#2:#3); } } } \...
user avatar
  • 22.3k
34 votes

How is arc defined in TikZ?

For visualisation, here is a diagram: where theta_i is the start angle, theta_f is the end angle, R is the radius, O is the centre of rotation (not the origin), A is the starting point, B is the end ...
user avatar
  • 56.3k
29 votes
Accepted

Draw a rectangle with rounded ends in TikZ

This shows how to adjust the angles in your original commands (I've scaled the rectangle down just so the labels show up better) and then demonstrates the use of rounded rectangle from the shapes.misc ...
user avatar
  • 183k
26 votes

Draw a rectangle with rounded ends in TikZ

Why not using rounded corners locally/globally on the path? \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw (0,0) {[rounded corners=15pt] -- ++(2,0) -- +...
user avatar
23 votes

TikZ - Recursive Arc Drawing

Without numbers: \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture} \draw [ultra thick] (-8,0) -- (8,0); \draw [ultra thick] (0,0) circle (8); \foreach \...
user avatar
  • 981
21 votes
Accepted

TikZ - Recursive Arc Drawing

It is not any different than the examples given by other languages. Only a few places where expansion needs to be taken care of. I didn't really go for the code golf but it seems working. And it gets ...
user avatar
  • 154k
17 votes
Accepted

tikz: Applying rounded corners to arcs

The problem is not really about the arc command. It is about how TikZ shortens any curved path. Using arc or controls or to[in= , out=] all produce the same problem. Consider the image: which is ...
user avatar
  • 19.8k
16 votes
Accepted

How can I improve the look of an arrowhead at the end of a small-radius arc?

TikZ 3.0.0 provides a bending library for arrow tips placed on non-straight paths (see 16.3.8 Bending and Flexing on pgfmanual). Loading the library makes flex=1 the default choice, but sometimes it ...
16 votes

TikZ - Recursive Arc Drawing

I was wondering the same thing yesterday in the comments of this answer on a close subject. For recursive drawings as this one are (relatively!) easy to do with languages closely related to (La)TeX, ...
user avatar
14 votes
Accepted

TikZ arc with extreme angle

You can add looseness to the draw command: \draw[->] (6,4.5) to[bend left=80, looseness=2.7] (5.9,8);
user avatar
  • 19.8k
13 votes
Accepted

How to automatically obtain the center of the circle used to draw the arc in TikZ?

Only part of what was required. But it also shows how a key with the required syntax could be programmed: \documentclass[tikz,border=5]{standalone} \tikzset{% insert arc/.style args={#1:#2:#3and#4 ...
user avatar
  • 68.9k
13 votes
Accepted

How to indicate letters conjoined across words?

There is a standard Unicode character tie: ⁀ Unicode: U+2040. Used with an appropriate font and XeLaTeX or LuaLaTeX you can just put it directly into your source or make a macro. (Since it's ...
user avatar
  • 201k
13 votes
Accepted

Drawing circular sector regions

Like this? \documentclass[border=10pt,multi,tikz]{standalone} \begin{document} \begin{tikzpicture} \foreach \m in {0,1,2}{ % draws shaded regions \draw [fill=gray!50!white, rounded corners] ...
user avatar
  • 250k
12 votes

How can I draw edge bundles with TikZ?

You can "stack" actions, so have a post action in a post action in a post action ... and so on. For some reason unknown to me, a double line as postaction to a double line produces not the desired ...
user avatar
  • 38.9k
12 votes

How to maintain a circular arc with a large arrow?

You can avoid this by adding the bending library. \documentclass[border=2mm]{standalone} \usepackage{tikz} \usetikzlibrary{calc, arrows.meta, bending} \begin{document} \begin{tikzpicture}[ ...
user avatar
  • 44.7k
10 votes

How to draw an arc in Tikz that has gaps specifically placed in it

According to the pgfmanual section 15.3.2 Graphic Parameters: Dash Pattern, you have several possibilities: \documentclass[tikz,border=10pt]{standalone} \begin{document} \begin{tikzpicture}[very ...
user avatar
10 votes
Accepted

Drawing a spinner

This would have been a lot easier using tikz3d. \documentclass[a4paper]{article} \usepackage{amsmath} \usepackage{amssymb} \usepackage{tikz} \usepackage{graphicx} \usetikzlibrary{intersections,...
user avatar
  • 69.4k
10 votes

tikz: Applying rounded corners to arcs

Sandy G has provided an excellent analysis of the issue and a good solution. This is an alternative solution that results in a single path at the end, which is therefore more suited to situations in ...
user avatar
9 votes

TikZ - Recursive Arc Drawing

This is cheating. Utterly, utterly cheating. It’s a Python script which generates the TikZ necessary to draw a Farey diagram. I use the definition from the Wikipedia page on Farey numbers to generate ...
user avatar
  • 5,107
9 votes

How can I draw this circle with different colour?

This is not very elegant, but I think it gives the result you are after: \documentclass{standalone} \usepackage{xcolor} \usepackage{tikz} \begin{document} \begin{tikzpicture} \newcommand\rad{2} % ...
user avatar
  • 1,257
9 votes
Accepted

Shading the area between arcs with a rainbow

Since you only require relatively short arc segments, I would suggest cheating and using a linear shading instead of trying to be correct. You could look up the definition of the color wheel shading ...
user avatar
  • 3,659
9 votes
Accepted

Drawing an arc for given two endpoints, center and radius of the arc

You can use the angles-library of tikz. Add angles to your \usetikzlibrary \usetikzlibrary{intersections, calc, angles} Add at the end of your code: \coordinate (o) at (3,4); \pic [draw, angle ...
user avatar
  • 4,346
9 votes

Drawing a diagram with arc and angle

A pstricks solution, based od the pst-eucl module: \documentclass{article} \usepackage{pst-eucl} % \usepackage{auto-pst-pdf} for use with pdflatex --enablewrite18 (MiKTeX) % or pdflatex --shell-...
user avatar
  • 259k

Only top scored, non community-wiki answers of a minimum length are eligible