Results 1 to 4 of 4
Like Tree3Thanks
  • 2 Post By emakarov
  • 1 Post By emakarov

Math Help - diagram

  1. #1
    Member vernal's Avatar
    Joined
    Dec 2011
    Posts
    75

    diagram

    Hi, how can I drawing this diagram with latex?

    Thanks
    Attached Thumbnails Attached Thumbnails diagram-new4.png  
    Last edited by vernal; September 30th 2013 at 11:14 AM.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    Joined
    Oct 2009
    Posts
    5,504
    Thanks
    765

    Re: diagram

    See the Graphics section in these TeX FAQs about drawing in LaTeX.

    Here is my attempt in TikZ. I could not quite make out the labels, so they may need to be changed.



    The code is the following.
    Code:
    \begin{tikzpicture}
    \newcommand{\rad}{1.5pt}
    \newcommand{\crcl}[2]{circle (\rad) node[#1] {$H_{#2}$}}
    \newcommand{\row}[3]{\filldraw (#1,#2) \crcl{#3}{1} \foreach \i in {2, ..., 4} { -- ++(2,0) \crcl{#3}{\i} };}
    \begin{scope}[rotate=-30]
    \row{0}{0}{above=2pt}
    \row{2}{-1.5}{below=2pt}
    \foreach \x in {2,4,6} \draw (\x,0) -- (\x,-1.5);
    \end{scope}
    \end{tikzpicture}
    It may not be the simplest way of doing this. I wanted to practice by making the code shorter.
    Thanks from vernal and topsquark
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Member vernal's Avatar
    Joined
    Dec 2011
    Posts
    75

    Re: diagram

    Quote Originally Posted by emakarov View Post
    See the Graphics section in these TeX FAQs about drawing in LaTeX.

    Here is my attempt in TikZ. I could not quite make out the labels, so they may need to be changed.



    The code is the following.
    Code:
    \begin{tikzpicture}
    \newcommand{\rad}{1.5pt}
    \newcommand{\crcl}[2]{circle (\rad) node[#1] {$H_{#2}$}}
    \newcommand{\row}[3]{\filldraw (#1,#2) \crcl{#3}{1} \foreach \i in {2, ..., 4} { -- ++(2,0) \crcl{#3}{\i} };}
    \begin{scope}[rotate=-30]
    \row{0}{0}{above=2pt}
    \row{2}{-1.5}{below=2pt}
    \foreach \x in {2,4,6} \draw (\x,0) -- (\x,-1.5);
    \end{scope}
    \end{tikzpicture}
    It may not be the simplest way of doing this. I wanted to practice by making the code shorter.
    Ok. Thanks a lot. I practice more, but I have one question. how can I writ any thing instaed H1, H2,....? for example I write A, K, M, B ineasted H1, H2,H3 and H4, and on the underneath I write for example j, i , l , o
    Follow Math Help Forum on Facebook and Google+

  4. #4
    MHF Contributor
    Joined
    Oct 2009
    Posts
    5,504
    Thanks
    765

    Re: diagram

    You could do the following.

    Code:
    \begin{tikzpicture}
    \newcommand{\rad}{1.5pt}
    \newcommand{\crcl}[2]{circle (\rad) node[#1] {$#2$}}
    \newcommand{\row}[5]{\filldraw (#1,#2) \crcl{#3}{#4} \foreach \i in {#5} { -- ++(2,0) \crcl{#3}{\i} };}
    \begin{scope}[rotate=-30]
    \row{0}{0}{above=2pt}{A}{B, C, D}
    \row{2}{-1.5}{below=2pt}{E}{F, G, H}
    \foreach \x in {2,4,6} \draw (\x,0) -- (\x,-1.5);
    \end{scope}
    \end{tikzpicture}
    Here is another variant.

    Code:
    \begin{tikzpicture}
    \newcommand{\rad}{1.5pt}
    \newcommand{\crcl}[2]{circle (\rad)  coordinate (#1) node[#2] {$#1$}}
    \newcommand{\row}[2]{\foreach \lbl in {#1} {++(2,0) \crcl{\lbl}{#2}};}
    \begin{scope}[rotate=-30]
    \fill (0,0) \row{A, K, M, B}{above=2pt}
    \fill (2,-1.5) \row{j, i, l, o}{below=2pt}
    \draw (A) -- (K) -- (M) -- (B) (j) -- (i) -- (l) -- (o) (K) -- (j) (M) -- (i) (B) -- (l);
    \end{scope}
    \end{tikzpicture}
    Thanks from vernal
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. diagram
    Posted in the LaTeX Help Forum
    Replies: 5
    Last Post: May 24th 2012, 04:41 AM
  2. diagram 3D
    Posted in the Trigonometry Forum
    Replies: 1
    Last Post: December 16th 2011, 06:40 PM
  3. Help with diagram
    Posted in the Algebra Forum
    Replies: 1
    Last Post: April 25th 2010, 12:21 PM
  4. Dc and diagram
    Posted in the Geometry Forum
    Replies: 1
    Last Post: January 25th 2008, 04:23 AM
  5. Diagram
    Posted in the Geometry Forum
    Replies: 1
    Last Post: May 8th 2007, 01:46 PM

Search Tags


/mathhelpforum @mathhelpforum