1

I want to plot the following figure with, e.g., tikz package, but I don't know how to get the colored circular shape. (I am new to this page so apologies if my question is too primitive.) enter image description here

7
  • 1
    Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation, and find out what the issue is, when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – Fran
    Dec 28, 2019 at 7:46
  • Hi, welcome. Can you reduce your image to its useful part?
    – AndréC
    Dec 28, 2019 at 8:03
  • 1
    The easiest way I see is with hobby, see for example: Draw a closed liquid-droped shaped curve with TikZ Dec 28, 2019 at 8:06
  • 1
    @Teodorism Is this curve defined by an equation, or is it sufficient to draw a curve that approximately resembles it?
    – AndréC
    Dec 28, 2019 at 8:15
  • 1
    @AndréC It's sufficient to draw a curve that approximately resembles it.
    – Teodorism
    Dec 28, 2019 at 8:38

1 Answer 1

3

screenshot

Explanations via comments written in the source code.

\documentclass[border=5mm]{standalone}

\usepackage{tikz}% this package is used to build figures
\usetikzlibrary{angles}% this library allows you to easily draw angles and add text to them. It requires these angles to be defined by 3 points with the operations \node or \coordinate. It is not possible to use coordinates such as (0,0). Thus, I defined 4 points named (a), (b), (o) and (d) when building the first path.
\usetikzlibrary{patterns}% this library allows you to fill the path with a repetitive pattern like a mosaic. I used the pattern `north east lines`.

\usepackage{siunitx}% this package defines the macro \ang{} which allows to correctly display angles in degrees.

\begin{document}

\begin{tikzpicture}      
\draw (60:3cm)coordinate(a)--(0,0)coordinate(o)--(-60:3cm)coordinate(b);  
% The curve is drawn using 2 bezier curves symmetrical to the horizontal axis. The first starts at `(0,0)` and ends at `(4,0)`. The two points `+(60:2)` and `+(90:2)` are the control points of this Béziers curve. The first control point is `+(60:2)`. The + sign means that its placement is relative to the starting point `(0,0)`. It is placed 2 cm from the starting point at an angle of 60°. The second control point `+(90:2)` is placed relative to the end of the bezier curve `(4,0)`. 
\draw[pattern color=red,pattern=north east lines] (0,0)..controls +(60:2) and +(90:2) .. (4,0)coordinate(d)..controls +(-90:2) and +(-60:2)..(0,0); 
\draw[->] (0,0)--(3,0);
\draw[dashed] (3,0)--(4.5,0);
\pic [draw,pic text=\ang{60},angle radius=5mm,angle eccentricity=1.6]{angle=d--o--a};
\pic [draw,pic text=\ang{60},angle radius=6mm,angle eccentricity=1.6]{angle=b--o--d};
\end{tikzpicture}


\end{document}
3
  • 1
    @Teodorism Explanations added via comments written in the source code.
    – AndréC
    Dec 28, 2019 at 11:09
  • The '2' in $+(60:2)$, does it mean it's 2 cm away from the starting point (0,0)?
    – Teodorism
    Jan 19, 2020 at 1:46
  • 1
    @Teodorism Yes, that's right. More precisely, at 2 cm at a 60° angle from point (0.0).
    – AndréC
    Jan 19, 2020 at 6:08

You must log in to answer this question.

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