3

I am a newbie in TeX programming. I want to draw objects like on the attached figure.

enter image description here

It does not have to the exact same shapes.

The only thing that I've learned so far is drawing shapes.

\draw[blue] (0,0)rectangle (3,2);
\draw[blue] (5,0)rectangle (8,2);

The question is how I can connect different shapes together. The connections and the arrows are mandatory.

6

Something like this perhaps

enter image description here

\documentclass{article}


\usepackage{tikz}


\begin{document}

\begin{tikzpicture}

\draw (0,0) node 
  [fill=blue!20, shape=rectangle, minimum height=1cm, minimum width=3cm]
 (A){dataset};
\draw (5,0) node 
  [fill=yellow!20, shape=rectangle, minimum height=1cm, minimum width=3cm]
 (B){};
\draw (7,3) node 
  [fill=red!20, shape=circle,  minimum width=30]
 (C){};

\draw[line width=2pt]  (A) -- (B);
\draw [line width=2pt,->] (B) -- (C);

\end{tikzpicture}

\end{document}
2

It is easier to modify code later if relative rather than absolute positioning is used. on grid placement helps to keep things tidy. shapes.geometric supplies a diamond shape and styles are used to keep formatting consistent. arrows.meta supplies enhanced arrow tips and the graphs library makes it a little easier to draw the connections. shadows.blur is for egregious bling.

\documentclass[border=10pt,multi,tikz,dvipsnames,svgnames,rgb]{standalone}
\usetikzlibrary{shapes.geometric,arrows.meta,positioning,graphs,shadows.blur}
\begin{document}

\begin{tikzpicture}
  [
    >=Latex,
    thick,
    base/.style={draw=#1!50, fill=#1!20, font=\sffamily, text opacity=1, on grid, node distance=20mm, blur shadow},
    my diamond/.style={base=green, aspect=7.5, diamond, minimum height=10mm},
    block/.style={base=blue, minimum width=20mm, minimum height=10mm},
    my circle/.style={base=red, circle, minimum size=10mm},
  ]
  \node (ds) [block] {DATASET};
  \node (c1) [my circle, above right=of ds] {};
  \node (dia) [my diamond, above right=of c1] {};
  \node (c2) [my circle, below right=of dia] {};
  \node (blk) [block, below right=of c2] {};
  \graph [use existing nodes] {
    ds -- c1 -> dia -- c2 -> blk
  };
\end{tikzpicture}

\end{document}

Ti*k*Z features for flowcharts with bling

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.