Tikz \ path [line]: วาดเส้นทางจากโหนดหนึ่งไปยังอีก 2 โหนดด้านล่างโหนดที่จ้องมองจากจุดเดียวกัน

Prakash 12/24/2017. 2 answers, 161 views
tikz-pgf

ฉันต้องการวาดสองเส้นเริ่มต้นจากต้นกำเนิดเดียวกันกับอีกสองโหนด รหัสให้ฉันสองบรรทัด แต่ต้นกำเนิดของทั้งสองสายจะแตกต่างกัน

\begin{figure}[H]
\centering
%\begin{adjustbox}{width=\textwidth}

\begin{tikzpicture}

\tikzstyle{monolithic}  = [rectangle, thick,draw, fill=white!20,  text width=10em,align=center ,  minimum height=1.5em]
\tikzstyle{decompose} =  = [rectangle, thick,draw, fill=white!20,  text width=5em,align=center ,  minimum height=1.5em]
\tikzstyle{elements} =  = [rectangle, thick,draw, fill=white!20,  text width=5em,align=center ,  minimum height=1.5em]



\tikzstyle{line} = [-stealth, thick, draw]
\tikzstyle{cloud} = [draw, ellipse,fill=green!20, node distance=8cm, minimum height=2em]
\tikzstyle{blank} = [node distance=0cm]
\tikzstyle{arrow} = [thick,->,>=stealth]
 % Place nodes

\node [monolithic] (mono) {Structure-Electric Interaction};
\node [blank, below =of mono] (blank_node) {};
\node [decompose, below =of mono, node distance=2cm, yshift=0.2cm,xshift=-2.50cm] (left) {Structural field};
\node [decompose, below  = of mono,node distance=2cm, yshift=0.2cm,xshift=2.50cm] (right) {Electrical field};


\path [line]  (mono)--(left);
\path [line]  (mono)--(right);


%\path [line]  (blank_node)--(left);
%\path [line]  (blank_node)--(right);
\end{tikzpicture}
%\end{adjustbox}
\caption{Nonlinear dynamic piezoelectric analysis: Approach 1 and Approach 2} \label{field_decomposition}
%\end{figure*}
\end{figure} 

2 Answers


Zarko 12/24/2017.

ปิดหัวข้อ แต่จะมีประโยชน์:

\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{positioning}

\begin{document}

    \begin{tikzpicture}[
    node distance = 12mm and 6mm,
 box/.style = {rectangle, draw, thick, fill=white!20,
               text width=#1,
               align=center,  minimum height=1.5em},
line/.style = {-stealth, thick, draw}
                        ]
 % Place nodes
\node [box=10em] (mono) {Structure-Electric Interaction};
\node [box= 5em, below  left=of mono.south] (left) {Structural field};
\node [box= 5em, below right=of mono.south] (right) {Electrical field};
%
\draw [line]  (mono.south) -- (left);
\path [line]  (mono.south) -- (right);
    \end{tikzpicture}
\end{document} 

อย่างที่เห็น:

  • ใช้ไวยากรณ์ล่าสุดสำหรับการวางตำแหน่งโหนด ( \tikzstyle เลิกใช้)
  • สำหรับตำแหน่งโหนดใช้ node distance ร่วมกัน
  • ถูกลบออกสำหรับรูปภาพนี้คำจำกัดความของรูปแบบที่ไม่จำเป็นทั้งหมด (โดยมีเป้าหมายเพื่อให้ได้ตัวอย่างการทำงานที่น้อยที่สุดเช่น mwe)
  • สำหรับโหนดจะใช้สไตล์ร่วมกับตัวเลือกสำหรับกำหนด text width ของ text width ของโหนด

ใส่คำอธิบายภาพที่นี่


javi_gg1 12/24/2017.

ทำให้ลูกศรเริ่มจากจุดยึด south ของ mono :

\path [line]  (mono.south)--(left);
\path [line]  (mono.south)--(right); 

ใส่คำอธิบายภาพที่นี่

\documentclass{report}

\usepackage{float}
\usepackage{tikz}
\usetikzlibrary{positioning}


\begin{document}
\begin{figure}[H]
    \centering
    %\begin{adjustbox}{width=\textwidth}

    \begin{tikzpicture}[monolithic/.style={rectangle, thick,draw, fill=white!20,  text width=10em,align=center ,  minimum height=1.5em},
        decompose/.style={rectangle, thick,draw, fill=white!20,  text width=5em,align=center ,  minimum height=1.5em},
        elements/.style={rectangle, thick,draw, fill=white!20,  text width=5em,align=center ,  minimum height=1.5em},
        line/.style={-stealth, thick, draw},
        cloud/.style={draw, ellipse,fill=green!20, node distance=8cm, minimum height=2em},
        blank/.style={node distance=0cm},
        arrow/.style={thick,->,>=stealth}]

    % Place nodes

    \node [monolithic] (mono) {Structure-Electric Interaction};
    \node [blank, below =of mono] (blank_node) {};
    \node [decompose, below =of mono, node distance=2cm, yshift=0.2cm,xshift=-2.50cm] (left) {Structural field};
    \node [decompose, below  = of mono,node distance=2cm, yshift=0.2cm,xshift=2.50cm] (right) {Electrical field};


    \path [line]  (mono.south)--(left);
    \path [line]  (mono.south)--(right);


    %\path [line]  (blank_node)--(left);
    %\path [line]  (blank_node)--(right);
    \end{tikzpicture}
    %\end{adjustbox}
    \caption{Nonlinear dynamic piezoelectric analysis: Approach 1 and Approach 2} \label{field_decomposition}
    %\end{figure*}
\end{figure}
\end{document} 

HighResolutionMusic.com - Download Hi-Res Songs

1 Alan Walker

Diamond Heart flac

Alan Walker. 2018. Writer: Alan Walker;Sophia Somajo;Mood Melodies;James Njie;Thomas Troelsen;Kristoffer Haugan;Edvard Normann;Anders Froen;Gunnar Greve;Yann Bargain;Victor Verpillat;Fredrik Borch Olsen.
2 Sia

I'm Still Here flac

Sia. 2018. Writer: Sia.
3 Cardi B

Taki Taki flac

Cardi B. 2018. Writer: Bava;Juan Vasquez;Vicente Saavedra;Jordan Thorpe;DJ Snake;Ozuna;Cardi B;Selena Gomez.
4 Little Mix

Woman Like Me flac

Little Mix. 2018. Writer: Nicki Minaj;Steve Mac;Ed Sheeran;Jess Glynne.
5 Halsey

Without Me flac

Halsey. 2018. Writer: Halsey;Delacey;Louis Bell;Amy Allen;Justin Timberlake;Timbaland;Scott Storch.
6 Lady Gaga

I'll Never Love Again flac

Lady Gaga. 2018. Writer: Benjamin Rice;Lady Gaga.
7 Bradley Cooper

Shallow flac

Bradley Cooper. 2018. Writer: Andrew Wyatt;Anthony Rossomando;Mark Ronson;Lady Gaga.
8 Bradley Cooper

Always Remember Us This Way flac

Bradley Cooper. 2018. Writer: Lady Gaga;Dave Cobb.
9 Kelsea Ballerini

This Feeling flac

Kelsea Ballerini. 2018. Writer: Andrew Taggart;Alex Pall;Emily Warren.
10 Mako

Rise flac

Mako. 2018. Writer: Riot Music Team;Mako;Justin Tranter.
11 Dewain Whitmore

Burn Out flac

Dewain Whitmore. 2018. Writer: Dewain Whitmore;Ilsey Juber;Emilio Behr;Martijn Garritsen.
12 Avril Lavigne

Head Above Water flac

Avril Lavigne. 2018. Writer: Stephan Moccio;Travis Clark;Avril Lavigne.
13 Khalid

Better flac

Khalid. 2018. Writer: Charlie Handsome;Jamil Chammas;Denis Kosiak;Tor Erik Hermansen;Mikkel Stoleer Eriksen;Khalid.
14 Lady Gaga

Look What I Found flac

Lady Gaga. 2018. Writer: DJ White Shadow;Nick Monson;Mark Nilan Jr;Lady Gaga.
15 Deep Chills

Run Free flac

Deep Chills. 2018.
16 Dynoro

In My Mind flac

Dynoro. 2018. Writer: Georgi Kay;Feenixpawl;Ivan Gough.
17 Charli XCX

1999 flac

Charli XCX. 2018. Writer: Charli XCX;Troye Sivan;Leland;Oscar Holter;Noonie Bao.
18 NCT 127

Regular (English Version) flac

NCT 127. 2018.
19 Lukas Graham

Love Someone flac

Lukas Graham. 2018. Writer: Don Stefano;Morten "Rissi" Ristorp;Morten "Pilo" Pilegaard;Jaramye Daniels;James Alan;David LaBrel;Lukas Forchhammer Graham.
20 Rita Ora

Let You Love Me flac

Rita Ora. 2018. Writer: Rita Ora.

Related questions

Hot questions

Language

Popular Tags