在 TikZ 中绘制正弦曲线和花括号

在 TikZ 中绘制正弦曲线和花括号

我正在尝试绘制下图的正弦曲线在此处输入图片描述

在我的图表左侧。我编写的代码如下所示

\documentclass{article}
\usepackage{geometry}
\geometry{a4paper,total=. 
{170mm,257mm},left=10mm,right=15mm,top=15mm,bottom=15mm}
\usepackage{tikz}
\usepackage{siunitx}
\begin{tikzpicture}
\draw[,line width=0.5mm,black,dotted](8,1.5) -- (8,6.5);
\draw[,line width=0.5mm,blue,->](0,0) -- (16,0);
\draw[line width=0.5mm,black,-](8,0.2) -- (8,-0.2);
\node at (8,-0.5) {$\frac{1}{2}$};
\draw[line width=0.5mm,black,-](10,0.2) -- (10,-0.2);
\node at (10,-0.5) {1};
\draw[line width=0.5mm,black,-](15.5,0.2) -- (15.5,-0.2);
\node at (15.5,-0.5) {$\infty$};
\node at (16.2,0) {$K$};
% drawing circles in right
\draw [red,fill=purple] (10,5) circle [radius=0.25];
\draw [red,fill=purple] (10.5,5) circle [radius=0.25];
\draw [dashed,thick,blue](10.25,5) ellipse (0.6 cm and 0.4 cm);
\draw [red,fill=purple] (12,5) circle [radius=0.25];
\draw [red,fill=purple] (12.5,5) circle [radius=0.25];
\draw [dashed,thick,blue](12.25,5) ellipse (0.6 cm and 0.4 cm);
\draw[,line width=0.5mm,black,-](9.0,5) -- (15.5,5);
\draw [red,fill=purple] (14,5) circle [radius=0.25];
\draw [red,fill=purple] (14.5,5) circle [radius=0.25];
\draw [dashed,thick,blue](14.25,5) ellipse (0.6 cm and 0.4 cm);
% draw circle in left
\draw [red,fill=purple] (1,5) circle [radius=0.25];
\draw [red,fill=purple] (3,5) circle [radius=0.25];
\draw [red,fill=purple] (5,5) circle [radius=0.25];
\draw [red,fill=purple] (7,5) circle [radius=0.25];
\draw[,line width=0.5mm,black,-](0.5,5) -- (7.5,5);
% draw axis
\draw[,line width=0.5mm,black,->](0,1) -- (0,4);
\draw[,line width=0.5mm,black,->](0,1) -- (7.5,1);
\node at (0,4.2) {$\rho$};
\node at (7.7,1) {$x$};
\end{tikzpicture}
\end{document}

另外,对于以下轴我想在 1/2 和 处的端点之间添加一个水平花括号$\infty$。我不太确定这两件事是否可以做到。我希望有人能帮忙。提前致谢。

答案1

\documentclass[tikz, border=1cm]{standalone}
\usetikzlibrary{decorations.pathreplacing}
\begin{document}
\begin{tikzpicture}
\draw[line width=0.5mm,black,dotted](8,1.5) -- (8,6.5);
\draw[line width=0.5mm,blue,->](0,0) -- (16,0);
\draw[line width=0.5mm,black](8,0.2) -- (8,-0.2);
\node (half) at (8,-0.5) {$\frac{1}{2}$};
\draw[line width=0.5mm,black](10,0.2) -- (10,-0.2);
\node at (10,-0.5) {1};
\draw[line width=0.5mm,black](15.5,0.2) -- (15.5,-0.2);
\node (inf) at (15.5,-0.5) {$\infty$};
\node at (16.2,0) {$K$};
% drawing circles in right
\draw [red,fill=purple] (10,5) circle [radius=0.25];
\draw [red,fill=purple] (10.5,5) circle [radius=0.25];
\draw [dashed,thick,blue](10.25,5) ellipse (0.6 cm and 0.4 cm);
\draw [red,fill=purple] (12,5) circle [radius=0.25];
\draw [red,fill=purple] (12.5,5) circle [radius=0.25];
\draw [dashed,thick,blue](12.25,5) ellipse (0.6 cm and 0.4 cm);
\draw[,line width=0.5mm,black,-](9.0,5) -- (15.5,5);
\draw [red,fill=purple] (14,5) circle [radius=0.25];
\draw [red,fill=purple] (14.5,5) circle [radius=0.25];
\draw [dashed,thick,blue](14.25,5) ellipse (0.6 cm and 0.4 cm);
% draw circle in left
\draw [red,fill=purple] (1,5) circle [radius=0.25];
\draw [red,fill=purple] (3,5) circle [radius=0.25];
\draw [red,fill=purple] (5,5) circle [radius=0.25];
\draw [red,fill=purple] (7,5) circle [radius=0.25];
\draw[line width=0.5mm,black,-](0.5,5) -- (7.5,5);
% draw axis
\draw[line width=0.5mm,black,->](0,1) -- (0,4);
\draw[line width=0.5mm,black,->](0,1) -- (7.5,1);
\node at (0,4.2) {$\rho$};
\node at (7.7,1) {$x$};
\draw[thick] (1,4) cos +(0.5,-1.5) sin +(0.5,-1.5) cos +(0.5,1.5) sin +(0.5,1.5) cos +(0.5,-1.5) sin +(0.5,-1.5) cos +(0.5,1.5) sin +(0.5,1.5) cos +(0.5,-1.5) sin +(0.5,-1.5) cos +(0.5,1.5) sin +(0.5,1.5);
\draw[thick, decoration={brace, mirror, amplitude=10pt, raise=0.6cm}, decorate] (half.center) --node[below=1cm]{A brace} (inf.center);
\end{tikzpicture}
\end{document}

带有线条、正弦曲线和括号的图形

相关内容