3

I know how to create flow charts in the tikz environment. The question now is, how can I create a coordinate system in one specific node?

I know how to draw an input signal (e.g. two impulses) in a coordinate system. But how can I assign this coordinate system to an input node?

Thanks in advance!

Edit: Here is my code as an example.

[block]

is a predefined rectangle with content

{Here should be a coordinate system}

This text should be replaced by a coordinate system, like in the appended picture. If x(t) is the input, then I would like to plot the rectangular function there. The same for the output y(t), a triangular function.

    \documentclass{article}
    \usepackage{tikz}

    \usetikzlibrary{shapes,shapes.geometric,arrows,circuits,trees,spy,decorations,calc}

    \tikzset{%
        block/.style    = {draw, thick, rectangle, minimum height = 3em, minimum width = 3em},
        ring/.style     = {draw, thick, circle, minimum size = 3em},
        elipse/.style   = {draw, thick, ellipse, minimum height = 2em},
        sum/.style      = {draw, circle, node distance = 2cm}, % Adder
        input/.style    = {coordinate}, % Input
        output/.style   = {coordinate} % Output
    }
    \tikzstyle{startstop} = [rectangle, rounded corners, minimum width = 3cm, minimum height = 0.7cm, text centered, text width = 3cm, draw = black, fill = red!30]
    \tikzstyle{io} = [trapezium, trapezium left angle=70, trapezium right angle=110, minimum width=0pt, minimum height=0.7cm, text centered, text width = 3cm, draw=black, fill=blue!30]
    \tikzstyle{process} = [rectangle, minimum width = 3cm, minimum height = 0.7cm, text centered, text width = 3cm, draw = black, fill = orange!30]
    \tikzstyle{decision} = [diamond, minimum width = 2cm, minimum height = 0.3cm, text centered, text width = 2cm, draw = black, fill = green!30]
    \tikzstyle{arrow} = [thick, ->, > = stealth]

    \begin{document}
    \begin{tikzpicture}[auto, node distance=2cm, >=triangle 45]
    \draw
    % Block setzen
    node at (0.0,0.0)(input){Here should be a coordinate system}
    node at (2.0,0.0)[block] (block1){some block}
    node at (4.0,0.0)(output){Here should be a coordinate system};

    % Blcok verbinden
    \draw[->](input) -- node {}(block1);
    \draw[->](block1) -- node {}(output);
    \end{tikzpicture}
    \end{document}

enter image description here

4
  • 1
    You can name nodes. For your case, please provide small complete document, which can serve as base for answer. Welcome to TeX.SE
    – Zarko
    Nov 23, 2016 at 18:46
  • Soory, but your code is not complete. Please help us to help you. Complete document, for which I ask in comment above, start with \documentclass{...}, in preamble load all necessary packages and libraries and end with end{document}. Such document we can copy to our computers and test it.
    – Zarko
    Nov 23, 2016 at 19:59
  • What you mean with coordinate system? To draw axes in node? Please clarify with (hand drawn) sketch what is the problem.
    – Zarko
    Nov 23, 2016 at 20:05
  • Sorry, it is the first problem that I upload here. Is it clear now?
    – P.S.
    Nov 23, 2016 at 20:49

1 Answer 1

2

enter image description here

For diagrams I use small pictures \pic.

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

\begin{document}
    \begin{tikzpicture}[
auto,  >=triangle 45,
node distance = 22mm,
 block/.style = {draw, thick, minimum size = 3em},
diagram1/.pic = {    
    % axes
    \draw[->]   (-0.1, 0) -- ++ (33mm,0) node[below left] {$t$};
    \draw[->]   ( 0,-0.1) -- ++ (0,22mm) node[below left] {$x(t)$};
    \draw       (0.1,1.2) -- ++ (-2mm,0) node[left] {$1$};
    % pulse
    \draw[red,thick,text=black]
                (1,0) node[below] {$t_0$}   |- (2,1.2) --
                (2,0) node[below] {$t_0+T$};
                 },
diagram2/.pic = {
    % axes
    \draw[->]   (-0.1, 0) -- ++ (33mm,0) node[below left] {$t$};
    \draw[->]   ( 0,-0.1) -- ++ (0,22mm) node[below left] {$y(t)$};
    \draw       (0.1,1.2) -- ++ (-2mm,0) node[left] {$1$};
    % pulse
    \draw[red,thick,text=black]
                (1,0) node[below] {$t_1$}   -- (1.5,1.2) --
                (2,0) node[below] {$t_1+T$};
                 },     
                        ]
\coordinate[label=left :$x(t)$]     (in);
\node (block)   [block,right=of in] {block 1};
\coordinate[label=right:$y(t)$,
            right=of block.east]    (out);
\draw[->]   (in) edge (block)   (block) to (out);
% diagrams
\pic [below left=24mm and 11mm of in ] {diagram1};%
\pic [below left=24mm and 11mm of out] {diagram2};%
\end{tikzpicture}
\end{document}
2
  • Thank you, it is exactly what I need. So, if I understand it right, you define diagram1 and diagram2 at first as \pic, and afterwards you place it. What is the difference between coordinate and node?
    – P.S.
    Nov 23, 2016 at 22:17
  • \coordinate is \node with zero size, so the have only one anchor. Let me noted: use of pic can be tricky (it is buggy) and in ts placement you can not directly use habits from nodes. \pic is not a node.
    – Zarko
    Nov 23, 2016 at 22:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .