拉弦和竖琴

拉弦和竖琴

我想画一幅类似下面手绘的图:

通缉

带有标签$0$,,,,,,,,,,,,,,和。$1$​​​​​​​​​​​$\Psi_{L,S}$$a_1$$\ell_i + 2\varepsilon$$\Psi_{L,H}$$b_1$$-\varepsilon$$1 + \varepsilon$$\Psi_{L,S}$$a_2$$b_N : \mathbb{N}^{*} \setminus \mathbb{N}$$-t$$t + 1$$\Psi_{L,H}$

所有三个虚线图形应该看起来与

想要2

没有数字标签,但有相应的端点标签。

要绘制第二个图形,请参考一篇较旧的帖子:如何绘制衰减值的条形图?

长度为 1/3、1/9、1/9、1/27、1/27、1/27 和 1/27。

任何简洁的代码都将受到最热烈的欢迎。

答案1

一种选择:

\documentclass{article}
\usepackage{amssymb}
\usepackage{tikz}

\newlength\mylen
\setlength\mylen{3pt}

\newcommand\Mdot{%
  \hspace*{2pt}\rule{1pt}{.4pt}\hspace*{2pt}}
\newcommand\Mrule[1]{\rule{#1}{0.4pt}}
\newcommand\MDot{\Mdot\Mrule{\mylen}\Mdot}
\newcommand\MSet{%
  \rule[-4pt]{.4pt}{8pt}%
  \MDot\Mrule{3\mylen}%
  \MDot\Mrule{9\mylen}%
  \MDot\Mrule{27\mylen}%
  \MDot\Mrule{9\mylen}%
  \MDot\Mrule{3\mylen}%
  \MDot%
  \rule[-4pt]{.4pt}{8pt}%
}

\begin{document}

\begin{tikzpicture}
\node[inner sep=0pt,anchor=west] (topset)
  {\MSet};
\node at ([yshift=-10pt]topset.west) {$0$};  
\node at ([yshift=-10pt]topset.east) {$1$};
\node at ([yshift=-25pt]topset.east) {$\Psi_{L,H}$};
\begin{scope}[yshift=-3cm]
\foreach \Pos/\Len in {0/3cm,1/2cm,2/2cm,3/1cm,4/1cm,5/1cm,6/1cm}
  \draw[|-|] (\Pos,0) -- ++(0,-\Len); 
\node at (6.8cm,-0.5cm) {$\dots$};
\end{scope}   
\begin{scope}[yshift=-9cm]
\node[inner sep=0pt,anchor=west] (middleset)
  {\MSet};
\node at ([yshift=-10pt]middleset.west) {$-\varepsilon$};  
\node at ([yshift=-10pt]middleset.east) {$1+\varepsilon$};
\node at ([yshift=-25pt]middleset.east) {$\Psi_{L,H}$};
\end{scope}
\begin{scope}[yshift=-14cm]
\node[inner sep=0pt,anchor=west] (bottomset)
  {\MSet};
\node at ([yshift=-10pt]bottomset.west) {$-t$};  
\node at ([yshift=-10pt]bottomset.east) {$t+1$};
\node at ([yshift=-25pt]bottomset.east) {$\Psi_{L,H}$};
\end{scope}

\draw[->] 
  ([yshift=-1cm]topset.center) -- node[right] {$a_{1}$} ++(0,-1cm);
\node at 
  ([yshift=2.5cm]middleset.center) {$\ell +2\varepsilon$};
\draw[->] 
  ([yshift=2cm]middleset.center) -- node[right] {$b_{1}$} ++(0,-1cm);
\draw[->] 
  ([yshift=-1cm]middleset.center) -- node[right] {$a_{2}$} ++(0,-1cm);
\node[rotate=90] at ([yshift=-2.5cm]middleset.center) {$\dots$};  
\draw[->] 
  ([yshift=-3cm]middleset.center) -- node[right] {$b_{N}:N\in\mathbb{N}\sp{\ast}\setminus\mathbb{N}$} ++(0,-1cm);
\end{tikzpicture}

\end{document}

在此处输入图片描述

答案2

与@Gonzalo 的想法相同,但实现方式略有不同,并且带有标签和省略号。

\documentclass{standalone}

\usepackage{tikz,amssymb}
\usetikzlibrary{calc}

\begin{document}

\begin{tikzpicture}
%% Horizontal sections
% Bottom section
\node (-t) at (0,0) {$-t$};
\node (t1) at (6,0) {$t+1$};
\draw (0,.3)--(0,.8) (6,.3)--(6,.8);
\draw (.1,.55)--(5.9,.55);
\foreach \x in {.15,.55,1.25,1.65}{
  \draw[fill=black,draw=white,line width=2pt] (\x,.55) circle (.05);
  \draw[fill=black,draw=white,line width=2pt] (6-\x,.55) circle (.05);
}
\node at (5,-.5) {$\psi_{L,S}$};
% First middle section
\begin{scope}[shift={(0,4.5)}]
\node (-e) at (0,0) {$-\varepsilon$};
\node (e1) at (6,0) {$\varepsilon+1$};
\draw (0,.3)--(0,.8) (6,.3)--(6,.8);
\draw (.1,.55)--(5.9,.55);
\foreach \x in {.15,.55,1.25,1.65}{
  \draw[fill=black,draw=white,line width=2pt] (\x,.55) circle (.05);
  \draw[fill=black,draw=white,line width=2pt] (6-\x,.55) circle (.05);
}
\node at (5,-.5) {$\psi_{L,S}$};
\end{scope}
% Second middle section
\begin{scope}[shift={(0,10)}]
\draw[|-|] (0,0)--(0,-2.5);
\draw[|-|] (.5,0)--(.5,-1.25);
\draw[|-|] (1,0)--(1,-1.25);
\draw[|-|] (1.5,0)--(1.5,-.625);
\draw[|-|] (2,0)--(2,-.625);
\draw[|-|] (2.5,0)--(2.5,-.625);
\draw[|-|] (3,0)--(3,-.625);
\node at (3.5,-.3125) {$\cdots$};
\node at (5,-1.3) {$\psi_{L,H}$};
\node at (1,-2.5) {$\varphi + 2\varepsilon$};
\coordinate (b0) at (0,0);
\coordinate (b1) at (6,0);
\end{scope}
% Top 
\begin{scope}[shift={(0,12)}]
\node (0) at (0,0) {0};
\node (1) at (6,0) {1};
\draw (0,.3)--(0,.8) (6,.3)--(6,.8);
\draw (.1,.55)--(5.9,.55);
\foreach \x in {.15,.55,1.25,1.65}{
  \draw[fill=black,draw=white,line width=2pt] (\x,.55) circle (.05);
  \draw[fill=black,draw=white,line width=2pt] (6-\x,.55) circle (.05);
}
\node at (5,-.5) {$\psi_{L,S}$};
\end{scope}
%% Arrows
\draw[->,shorten >=.5cm] ($(0)!.5!(1)$) to node[right=5pt,pos=.45] {$a_1$} ($(b0)!.5!(b1)$);
\draw[->,shorten <=3cm,shorten >=1cm] ($(b0)!.5!(b1)$) to node[right=5pt,pos=.7] {$b_1$} ($(-e)!.5!(e1)$);
\draw[->] ($(-e)!.5!(e1)$) to node[right=5pt] {$a_2$} +(270:1.2);
\node at ($($(-e)!.5!(e1)$)!.33!($(-t)!.5!(t1)$)$) {$\vdots$};
\draw[->] ($($(-e)!.5!(e1)$)+(270:2)$) to node[right=5pt] {$b_N; N\in \mathbb N^*\setminus\mathbb N'$} +(270:1.2);
\end{tikzpicture}

\end{document}

看起来像这样:

在此处输入图片描述

快速编辑:将虚线改为省略号,并调整定位。

相关内容