Graphics, Figures & TablesMissing Boxes and wrong Text Placement in Flowchart

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Rico
Posts: 1
Joined: Thu Jan 30, 2014 4:50 pm

Missing Boxes and wrong Text Placement in Flowchart

Post by Rico »

Hello,

I try to create a large flow chart, but even the first bit of it, which i tried to create, does not work, neither are the boxes shown, nor are they in a correct relative position to each other.

Code: Select all

\usepackage{tikz}
\usetikzlibrary{shapes.geometric,arrows}

\tikzstyle{Experiment} = [rectangle, draw=black, fill=blue!20, minimum width=5cm, text centered, minimum height=4cm, text width=4cm]
\tikzstyle{Method} = [rectangle, draw=black, fill=red!20, text width=4cm, text centered, minimum height=4cm, minimum width=4cm]
\tikzstyle{arrow} = [thick, ->, >=stealth]

\begin{tikzpicture}[node distance = 4cm, auto]
  \node(Exp1)[Experiment]{Soaking of samples at $25$ $°C$ and $50$ $\%$ $r.H.$, $65$ $\%$ $r.H.$, $75$ $\%$ $r.H.$, $85$ $\%$ $r.H.$ and $95$ $\%$ $r.H.$};
  \node(Exp2)[Experiment, right of=Exp1]{WVTR at $25$ $°C$, $35$ $°C$, $45$ $°C$ and $50$ $°C$ and $100$ $\%$ $r.H.$ across the encapsulant};
  \node(Exp3)[Experiment, right of=Exp2]{Soaking at $85$ $°C$ and $5$, $10$, $15$, $20$, $35$, $40$, $45$, $50$, $55$, $60$, $80$, $85$, $90$ and $95$ $\%$ $r.H.$};
  \node(Meas1)[Method, below of=Exp1]{Measurement every $20$ $min$ at each $r.H.$ for first $6$ $h$, afterwards once a $d$ for $3$ $d$};
  \node(Meas3)[Method, below of=Exp3]{Measurement at each $r.H.$ after $3$ $d$};

  \path[line](Exp1) -- (Meas1);
  \path[line](Exp3) -- (Meas3);
Here is my code, I hope somebody may be capable to help me.


Thx ahead already for any help!!!
Last edited by localghost on Thu Jan 30, 2014 5:17 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Missing Boxes and wrong Text Placement in Flowchart

Post by Johannes_B »

Extending you code to a minimal working example gives me the following

Code: Select all

\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}

\usepackage{tikz}
\usepackage{siunitx}
\usetikzlibrary{shapes.geometric,arrows}
\DeclareSIUnit{\rh}{\percent~r.\,H.}
\begin{document}

\tikzstyle{Experiment} = [rectangle, draw=black, fill=blue!20, minimum width=5cm, text centered, minimum height=4cm, text width=4cm]
\tikzstyle{Method} = [rectangle, draw=black, fill=red!20, text width=4cm, text centered, minimum height=4cm, minimum width=4cm]
\tikzstyle{arrow} = [thick, ->, >=stealth]

\begin{tikzpicture}[node distance = 6cm, auto]
%\node(Exp1)[Experiment]{};
  \node(Exp1)[Experiment]{Soaking of samples at \SI{25}{\celsius} and \SIlist{50;65;75;85;95}{\rh},}  ; 
  % i am only guessing, that r. H. belongs to the unit
  \node(Exp2)[Experiment, right of=Exp1]{WVTR at $25$ $°C$, $35$ $°C$, $45$ $°C$ and $50$ $°C$ and $100$ $\%$ $r.H.$ across the encapsulant};
  \node(Exp3)[Experiment, right of=Exp2]{Soaking at $85$ $°C$ and $5$, $10$, $15$, $20$, $35$, $40$, $45$, $50$, $55$, $60$, $80$, $85$, $90$ and $95$ $\%$ $r.H.$};
  \node(Meas1)[Method, below of=Exp1]{Measurement every $20$ $min$ at each $r.H.$ for first $6$ $h$, afterwards once a $d$ for $3$ $d$};
  \node(Meas3)[Method, below of=Exp3]{Measurement at each $r.H.$ after $3$ $d$};

  \path[draw] (Exp1) -- (Meas1);
  \draw(Exp3) -- (Meas3);
  \end{tikzpicture}
\end{document}
I enhanced the node distance to 6, have a look at node Exp1 where i used siunitx. You should do the same, it is more robust.
You can click on open in writelatex to see the output.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply