使用括号并排绘制弯曲物体

使用括号并排绘制弯曲物体

我正在尝试重新创建以下两个图表,但不知道如何将烧杯移到右侧。我尝试了 hspace,但没有任何效果。此外,我该如何在 tikz 中用文本制作左侧的括号?请告诉我。

在此处输入图片描述

在此处输入图片描述

\documentclass[tikz,border=3mm]{standalone} 
\usepackage{tikz}
\usetikzlibrary{arrows.meta,calc,positioning}
\begin{document}
\begin{tikzpicture}[bullet/.style={circle,inner
    sep=1.5pt,fill=black},wullet/.style={circle,inner
    sep=1.2pt,fill=white},font=\sffamily,
    pics/container/.style={code={
            \tikzset{container/.cd,#1}%
            \def\pv##1{\pgfkeysvalueof{/tikz/container/##1}}%
            \begin{scope}[shift={(-\pv{w}/2,-\pv{h}/2)},x=\pv{w},y=\pv{h}]
            \fill[gray!40] (0,0) rectangle (1,\pv{p});
            \draw[densely dotted] (0,\pv{l}) -- (1,\pv{l});
            \draw[very thick] (0,0) 
            rectangle (1,1);
            \path (0.5,1) node[below]{\pv{text}};
            \pgfkeys{/tikz/container/extra}
            \end{scope}
}},container/.cd,w/.initial=7em,h/.initial=14em,p/.initial=0,l/.initial=0.12,
text/.initial={},extra/.code={}]
\pic{container={p=0,text=TLC Plate,extra/.code={%change p= value to fill with gray
    \path (1/4,\pv{l}) node[bullet=black](b1){} (2/4,\pv{l}) node[bullet=black](b2){} (3/4,\pv{l}) node[bullet](b3){}; 
    }}};
\hspace{2em}
\draw[very thick] (-1,1.2) ..controls +(350:1) and +(180:1).. (0,-2)
                 (1.75,-2) ..controls + (0:1) and +(190:1).. (2.75,1.2);
\draw[very thick] (0,-2)--(1.75,-2);
\end{tikzpicture}
\end{document}

答案1

你可以pic自由移动

\path (<coordinate>) pic{...};

因此你可能想做这样的事情:

\documentclass[tikz,border=3mm]{standalone} 
%\usetikzlibrary{arrows.meta,calc,positioning}
\usetikzlibrary{decorations.pathreplacing,calligraphy}
\begin{document}
\begin{tikzpicture}[bullet/.style={circle,inner
    sep=1.5pt,fill=black},wullet/.style={circle,inner
    sep=1.2pt,fill=white},font=\sffamily,
    pics/container/.style={code={
            \tikzset{container/.cd,#1}%
            \def\pv##1{\pgfkeysvalueof{/tikz/container/##1}}%
            \begin{scope}[shift={(-\pv{w}/2,-\pv{h}/2)},x=\pv{w},y=\pv{h}]
            \fill[gray!40] (0,0) rectangle (1,\pv{p});
            \draw[densely dotted] (0,\pv{l}) -- (1,\pv{l});
            \draw[very thick] (0,0) 
            rectangle (1,1);
            \path (0.5,1) node[below]{\pv{text}};
            \pgfkeys{/tikz/container/extra}
            \end{scope}
}},container/.cd,w/.initial=7em,h/.initial=14em,p/.initial=0,l/.initial=0.12,
text/.initial={},extra/.code={}]
\path   (0.875-4,1) pic{container={p=0,text=TLC Plate,extra/.code={%change p= value to fill with gray
    \path (1/4,\pv{l}) node[bullet=black](b1){} (2/4,\pv{l}) node[bullet=black](b2){} (3/4,\pv{l}) node[bullet](b3){}; 
    }}}
(1.1,1) pic[xslant=0.1]{container={p=0,text=TLC Plate,extra/.code={%change p= value to fill with gray
    \path (1/4,\pv{l}) node[bullet=black](b1){} (2/4,\pv{l}) node[bullet=black](b2){} (3/4,\pv{l}) node[bullet](b3){}; 
    }}};
\draw[very thick,xscale=1.2] (-1,1.2) ..controls +(350:1) and +(180:1).. (0,-2)
                -- (1.75,-2) ..controls + (0:1) and +(190:1).. (2.75,1.2);
\path (0,-5) pic{container={l=0.1,p=0.8,extra/.code={
        \path (0,\pv{l}) coordinate (l') (0,\pv{p}) coordinate (p')
         (1,\pv{l}) coordinate (l) (1,\pv{p}) coordinate (p)
        (0.5,0.7) node[bullet,label=right:$A$](A){}
        (0.5,0.5) node[bullet,fill=gray,label=right:$B$](B){}
        (0.5,0.3) node[wullet,label=right:$C$](C){};
    }}};                
\draw (p') -- ++ (-3em,0) node[left] {Solvent}
 (l') -- ++ (-3em,0) node[left] {Origin};
\draw[thick,decorate,
    decoration={calligraphic brace,amplitude=3pt,raise=0.2ex}]
      ([xshift=2em]B.center) -- ([xshift=2em]B.center|-l)
      coordinate[midway,right=0.6em](aux);
\draw (aux) -- ++ (5em,0) node[right,node font=\small,align=left]{some\\ text};   
\draw[thick,decorate,
    decoration={calligraphic brace,amplitude=3pt,raise=0.2ex}] (p) -- (l)
    node[midway,node font=\small,align=left,right=0.6em]{Distance traveled\\ by solvent};       
\end{tikzpicture}
\end{document}

在此处输入图片描述

如你所见,你也可以变换pics,这里xslant=0.1用的是。括号可以画在偷偷带入 的坐标之间pic

相关内容