I want to re-create this image  with tikz.  Currently I'm at this point, but I don't know how to improve my code to make it smoother:  \documentclass{article} \usepackage{xcolor} \usepackage{listings}              \usepackage{float} \usepackage{tikz}  \usepackage{siunitx} \usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,positioning,fit,petri}  \definecolor{mycolor}{RGB}{31,22,70} \definecolor{mycolor2}{RGB}{21,126,251} \begin{document}          \begin{figure}[H]         \centering         \begin{tikzpicture}[             scale=0.8,             transform shape,             show background rectangle,             background rectangle/.style={fill=gray!10},             box/.style={draw, font=\itshape}             ]             \coordinate (b) at (current page.center);             \node[rounded corners=3mm, label=center:{Onboard}, fill=mycolor2!20] (onboard)at (b) [draw,minimum width=2.5cm,minimum height=2.4cm] {};              \node[below right = of onboard, rounded corners=3mm, label=center:{Deploy}, fill=mycolor2!20] (deploy) [draw,minimum width=2.5cm,minimum height=2.4cm] {};              \node[below right = of deploy,rounded corners=3mm, label=center:{Monitor}, fill=mycolor2!20] (monitor) [draw,minimum width=2.5cm,minimum height=2.4cm] {};              \node[below left = of monitor, rounded corners=3mm, label=center:{Scale}, fill=mycolor2!20] (scale) [draw,minimum width=2.5cm,minimum height=2.4cm] {};              \node[left =of scale, rounded corners=3mm, label=center:{healing/fault-recovery}, fill=mycolor2!20] (healing) [draw,minimum width=4cm,minimum height=2.4cm] {};              \node[above left = of healing, rounded corners=3mm, label=center:{Update}, fill=mycolor2!20] (update)[draw,minimum width=2.5cm,minimum height=2.4cm] {};              \node[above =of update, rounded corners=3mm, label=center:{Undeploy}, fill=mycolor2!20] (undeploy) [draw,minimum width=2.5cm,minimum height=2.4cm] {};             \draw[thick, mycolor](onboard)--(deploy);             \draw[thick, mycolor](deploy)--(monitor);             \draw[thick, mycolor](monitor)--(scale);             \draw[thick, mycolor](scale)--(healing);             \draw[thick, mycolor](healing)--(update);             \draw[thick, mycolor](update)--(undeploy);             \draw[thick, mycolor,-&gt;](undeploy)--(onboard);            \end{tikzpicture}         \caption{xxx}     \end{figure}  \end{document}         And here is the output:
122859
I have 3 nodes placed on a circle.  These nodes are differently shaped.  I want to connect them and want the arrows to look like a circle, because it is a repeating process.  I can connect them with bend left, but that is not circle enough for me.  I could mess around with in=... and out=..., but that is not a smart solution, because I would have to mess around every time I want such a picture.  Here an example code:  \documentclass{article}  \usepackage{tikz}   \begin{document}     \begin{tikzpicture}      % three differently shaped nodes on a circle     \node [rectangle, draw, text width=3cm] (a) at (180:3cm) {Hello World! Hello World!};     \node [rectangle, draw, text width=2cm] (b) at (60:3cm) {Hello World!};     \node [rectangle, draw, text width=2cm] (c) at (300:3cm) {Hello World!};      % connectors between the nodes     \draw[-&gt;] (a) to [bend left] (b);     \draw[-&gt;] (b) to [bend left] (c);     \draw[-&gt;] (c) to [bend left] (a);      % the circle I wish the connectors to be placed on     \draw[dashed,red] circle [radius=3cm];      \end{tikzpicture} \end{document}   I would like the connectors to be placed directly on the red dashed circle.  Has anyone a smarter solution than try and error with in and out?
111968
I want to fill the limits of the two curves (as shown). This is my code  \documentclass[10pt]{article} \usepackage{pgf,tikz} \usetikzlibrary{arrows} \pagestyle{empty} \begin{document} \definecolor{ttqqcc}{rgb}{0.2,0,0.8} \definecolor{ffqqtt}{rgb}{1,0,0.2} \definecolor{ttqqff}{rgb}{0.2,0,1} \definecolor{uququq}{rgb}{0.25,0.25,0.25} \begin{tikzpicture}[line cap=round,line join=round,&gt;=triangle 45,x=1.0cm,y=1.0cm] \draw[-&gt;,color=black] (-3.63,0) -- (3.67,0); \foreach \x in {-3,-2,-1,1,2,3} \draw[shift={(\x,0)},color=black] (0pt,2pt) -- (0pt,-2pt) node[below] {\footnotesize $\x$}; \draw[color=black] (3.48,0.07) node [anchor=south west] { $x$}; \draw[-&gt;,color=black] (0,-1.93) -- (0,5.57); \foreach \y in {-1,1,2,3,4,5} \draw[shift={(0,\y)},color=black] (2pt,0pt) -- (-2pt,0pt) node[left] {\footnotesize $\y$}; \draw[color=black] (0.06,5.19) node [anchor=west] { $y$}; \draw[color=black] (0pt,-10pt) node[right] {\footnotesize $0$}; \clip(-3.63,-1.93) rectangle (3.67,5.57); \draw[color=ttqqff,fill=ttqqff,fill opacity=0.1, smooth,samples=50,domain=-1.7320508075688772:-1.0] plot(\x,{\x^4-4*\x^2+3}) -- (-1,0) -- (-1.73,0) -- cycle; \draw[color=ffqqtt,fill=ffqqtt,fill opacity=0.1, smooth,samples=50,domain=-1.0:1.0] plot(\x,{\x^4-4*\x^2+3}) -- (1,0) -- (-1,0) -- cycle; \draw[color=ttqqcc,fill=ttqqcc,fill opacity=0.1, smooth,samples=50,domain=1.0:1.7320508075688772] plot(\x,{\x^4-4*\x^2+3}) -- (1.73,0) -- (1,0) -- cycle; \draw[smooth,samples=100,domain=-3.6342419080068153:3.665758091993186] plot(\x,{(\x)^4-4*(\x)^2+3}); \begin{scriptsize} \fill [color=uququq] (-1.73,0) circle (1.5pt); %\draw[color=uququq] (-1.87,-0.33) node {$A$}; \fill [color=uququq] (-1,0) circle (1.5pt); %\draw[color=uququq] (-0.85,-0.35) node {$B$}; \fill [color=uququq] (1,0) circle (1.5pt); %\draw[color=uququq] (1.1,0.25) node {$C$}; \fill [color=uququq] (1.73,0) circle (1.5pt); %\draw[color=uququq] (1.84,0.25) node {$D$}; \end{scriptsize} \end{tikzpicture} \end{document}     I want the fill has the form  Please help me.
106425
After reading , I was playing around to make a command to create a TikZ command with two inputs like this:  \documentclass[10pt,a4paper]{article}  \usepackage{tikz} \usetikzlibrary{calc}  \begin{document} \centering  \newcommand{\mitsubishi}[2]{ % #1 = radius % #2 = position x,y \pgfmathparse{2.966/7} \pgfmathparse{#1*\pgfmathresult}  \filldraw (#2) circle(#1 cm); % plate  \foreach \angle in {0,120,240}{ \filldraw[white,rotate=\angle] (#2)--++(60:\pgfmathresult)--++(120:\pgfmathresult)--++(-120:\pgfmathresult)--cycle; } }  \begin{tikzpicture} \mitsubishi{2}{0,0} \end{tikzpicture} \end{document}   but I have problems with the command \pgfmathresult inside the \filldraw command.  Why?
93167
I am looking into using TikZ to represent pitch patterns over a phrase or sentence (intonation).  I've got it to produce some useful results, already, as in the attached MWE (although in 1.1 the baselines don't seem to level up).  %!TEX TS-program = xelatex %!TEX encoding = UTF-8 Unicode \documentclass[a4paper,12pt, oneside]{article}  \usepackage{fontspec} \defaultfontfeatures{Mapping=tex-text, Scale=MatchLowercase} \setmainfont{Charis SIL}  \usepackage{tikz}  \begin{document}  \section{Marking intonation using TikZ}  \subsection{Setting words on different levels}  \begin{table}[hbtp] \begin{tabular}{ll} \cline{1-1} \noalign{\smallskip} \tikz[x=1mm,y=1mm,baseline=12] \draw (0,10) node {\underline{Where}} (10,2) node {are} (20,2) node {you} (30,6) node {\underline{go}} (40,0) node{ing?}; &amp; \textit{neutral/default - stress represented by underlining}\\ \cline{1-1} \noalign{\smallskip} \tikz[x=1mm,y=1mm,baseline=12] \draw (0,0) node {Where} (10,10) node {\underline{are}} (20,5) node {you} (30,2) node {go} (40,0) node{ing?}; &amp; \textit{ e.g. in response to ``I'm not going to the shops after all.''}\\ \cline{1-1} \end{tabular} \end{table}  Why do ``are'' and ``you'' in the first example appear on slightly different levels, even though they are both set to 1mm on the y axis?  Likewise for ``where'' and ``ing'' in the second example.  I'm not sure I'm using ``baseline'' properly here!  \subsection{As above, but boxed}  \begin{tikzpicture} \node[draw] at (0,1) {\underline{Where}}; \node[draw] at (1,0.1) {are}; \node[draw] at (2,0.1) {you}; \node[draw] at (3,0.6) {\underline{go}}; \node[draw] at (4,0) {ing?}; \end{tikzpicture}\ Still have to figure out the difference between ``\textbackslash draw node'' and ``\textbackslash node[draw]''!  \subsection{Graphical contour}  \begin{table}[hbtp] \begin{tabular}{l} \tikz[x=1mm,y=1mm,rounded corners=2mm] \draw[very thick, gray](0,10)--(10,2)--(20,2){[red]--(30,6)--(40,0)}; \\ Where are you~~~going? \end{tabular} \end{table}  \begin{table}[hbtp] \begin{tabular}{l} \tikz[x=1mm,y=1mm,rounded corners=2mm] \draw[very thick, gray](0,10)--(12,2)--(23,2){[red]--(26,6)--(35,0)}; \\ Where are you going? \end{tabular} \end{table}  This is preferable to setting the individual words on different levels, but requires trial and error in (i) matching the length of the whole contour to the utterance, and (ii) spreading the parts of the contour to match the words of the utterance, either by spacing the words (first example) or adjusting the contour points (second example).  \end{document}   However, my main query is whether anyone has a method for dealing with the issue in 1.3.  This involves trial-and-error in fitting the contour to the words, and I was wondering if there is any way to somehow anchor particular contour coordinates to particular syllables.  I know that lines can be attached to nodes, but I haven't been able to find a way of getting the lines to "float" above the nodes.  Any suggestions for allowing a line of text to be marked with anchor points as it is typed, with the contour then being drawn between these?
41863
Questions:   Why are the top corners of this number line missing? Why aren't the bottom corners or any other corners of this number line missing? How do I ensure the corners are always there?     \documentclass{article}  \usepackage[left=1.5cm,right=1.5cm,top=2cm,bottom=2cm]{geometry} \usepackage{tikz}   \begin{document}  \begin{tikzpicture}[line width=0.08cm]  \draw (0,0)--(5,0); \draw (0,0.3)--(5,0.3);  \foreach \x in {0,...,5}  {  \node at (\x,-0.55) {\x};  \draw (\x,-0.3)--(\x,0.3);  }  \foreach \x in {0,...,5}  \draw (\x,0)--(\x,0.3);  \end{tikzpicture}  \end{document}   That code yields this:
114006
I want to draw a small rectangle within a tikz picture, then zoom it out somewhere. I skim through the PGF manual but I couldn't find a way to put the logic together. So far I've just drawn the automaton diagram, I had to hack the blue rectangle with "paint" though :(. Anyone could help me out with this? Thank you.    Minimal Working Example  \documentclass[10pt,letterpaper]{article} \usepackage[left=1in,right=1in,top=1in,bottom=1in]{geometry}  \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsthm}  \usepackage[version=0.96]{pgf} \usepackage{tikz} \usetikzlibrary{arrows,shapes,automata,backgrounds,petri,positioning} \usetikzlibrary{decorations.pathmorphing} \usetikzlibrary{decorations.shapes} \usetikzlibrary{decorations.text} \usetikzlibrary{decorations.fractals} \usetikzlibrary{decorations.footprints} \usetikzlibrary{shadows}  \begin{document}     \begin{center}         \begin{tikzpicture}[shorten &gt;=1pt, node distance=3cm, auto, on grid, initial text=,font=\small,&gt;=stealth',             every state/.style={minimum size=7mm,draw=black!50,very thick,fill=red!50}]         \node[state,initial]        (S)                 {S};         \node[state]                (A) [right=of S]    {A};         \node[state]                (B) [below=of S]    {B};         \node[state,accepting]      (C) [right=of B]    {C};         \path[-&gt;]         (S) edge[bend right]    node{a} (A)         (S) edge[bend right]    node[xshift=-4mm]{$\lambda$} (B)         (A) edge[bend right]    node[yshift=5mm]{a,b} (S)         (A) edge[]              node{$\lambda$} (C)         (A) edge[]              node[yshift=7mm]{b} (B)         (B) edge[bend left]     node{b, $\lambda$} (C)         (B) edge[bend right]    node[xshift=4mm]{a} (S)         (C) edge[bend left]     node{a,b} (B)          ;          \end{tikzpicture}     \end{center} \end{document}
70957
I have the following TikZ code which draws a grid and shows the coordinates.  To display the coordinates I am using the loop foreach.  \documentclass[12pt]{article} \usepackage{tikz}  \begin{document} \begin{tikzpicture} \draw[help lines,step=.2] (-2,-2) grid (7,4); \draw[help lines,line width=.6pt,step=1] (-2,-2) grid (7,4); \foreach \x in {-2,-1,0,1,2,3,4,5,6,7}  \node[anchor=north] at (\x,-2) {\x}; \foreach \y in {-2,-1,0,1,2,3,4}  \node[anchor=east] at (-2,\y) {\y}; \end{tikzpicture} \end{document}   Is there a way do simplify the code in this way that I have a key like show coordinates (maybe step coordinates/.initial=step ):  \draw[help lines,step=.2,show coordinates=true] (-2,-2) grid (7,4);   Or a modification of the command grid like  \draw[help lines,step=.5] (-2,-2) gridwithcoordinates (7,4);     By using pstricks it is very simple with the command \psgrid  \documentclass[12pt]{article} \usepackage{pstricks}  \begin{document} \begin{pspicture}(-2,-2)(7,4) \psgrid \end{pspicture} \end{document}   Bonus: How can I set a larger line width for the help lines at the integer coordinates (see picture above)?  (I don't know the correct words ;-) )
73947
I am trying to create a process flow diagram of my rig using LaTex but I am stuck at trying to figure out how to create a semicircular jump at the intersection of two independent lines in the drawing. My current code and output are as follows.  \documentclass[11pt]{standalone} \usepackage{lmodern} \renewcommand*{\familydefault}{\sfdefault} \usepackage{sfmath} \usepackage[version=4]{mhchem} \usepackage{tikz}  \usetikzlibrary{arrows.meta,fit,positioning,intersections,shapes.geometric, decorations,patterns,decorations.markings} \tikzset{ every path/.style={thick}, every node/.style={     font={\normalsize},     align=center,     transform shape     }, } \begin{document} \begin{tikzpicture}[node distance=0.75cm]     \tikzset{         sv/.pic={             \def \x {0.43}             \node[draw,isosceles triangle,fill=none] (a) at (-\x,0) {};             \node[draw,isosceles triangle,shape border rotate=180,fill=none] at (\x,0){};             \draw[fill=none] (0,0) circle (0.22);            },%shutoff valve         lifwv/.pic={             \def \x {1pt}             \node[draw,circle,minimum size=0.6cm] (a) at (0,0){};             \node[circle,minimum size=0.4cm] (b) at (0.1,0){};             \fill (b.90) circle (\x) (b.0) circle (\x) (b.180) circle (\x) (b.270) circle (\x);             \draw[-&gt;] (a.90) -- ++(0,0.5) -- ++(0.5,0) node[right,ellipse,draw,inner sep=0.5pt](mv){M.V.};             \draw[-&gt;] (a.270) --  ++(0,-0.5) -- node[pos=0.5,nosep] (evap){} ++(1,0) -- ++(0,0.815) -- (a.0);             \node[below right = of evap,draw,yshift=0.25cm] (syp){Pump};             \draw[-&gt;] (syp) -|(evap);                    },%liquid injection right 4-way valve         pt/.pic={             \draw (0,0) -- ++(0.25,0) node[right,draw,circle,minimum size=0.5cm,font=\small,inner sep=0pt](a){P};         },%pressure transducer         jump/.pic={             \filldraw[draw=black,fill=white] (0.15,0) arc (0:180:0.15);             \draw[red,dashed] (0,0) circle (0.5);         },         mfc/.style={             draw,minimum width=1.75cm,minimum height=0.9cm,             text height=1.5ex         },         nosep/.style={             inner sep=0pt,             outer sep=0pt,           },%meeting-point     }     \node[mfc] (mfc1) {a};     \node[below = of mfc1,mfc] (mfc2) {\ce{b}};     \node[below = of mfc2,mfc] (mfc3) {\ce{c}};     \node[below = of mfc3,mfc] (mfc4) {\ce{d}};     \node[below = of mfc4,mfc] (mfc5) {\ce{e}};     \node[below = of mfc5,mfc] (mfc6) {\ce{f}};     \foreach \y in {1,2,...,6}{         \draw[-&gt;] (mfc\y.east) --++(0.5,0) node[right=12pt] (svmfcc\y){} node[right=24pt](svmfcr\y){};         \pic at (svmfcc\y){sv};      };     %line-1     \draw[-&gt;] (svmfcr1) -- node[pos=0.45,nosep](mpl1){} ++(1.5,0) -- pic[pos=0.4,-]{pt}++(0,0.75) -- ++(2,0) pic[right]{lifwv} node[right](l1){};     \foreach \y in {3,5,6} {         \draw[-&gt;] (svmfcr\y) -- ++(0.75,0);      };     \draw[-&gt;] (svmfcr6) ++(0.75,0) -- (mpl1);     %line-2     \draw[-&gt;] (svmfcr2) -- node[pos=0.75,nosep] (mpl2){} ++(1.5,0) -- pic[-,pos=0.4]{pt}++(0,-0.75) -- ++(2,0) pic[right]{lifwv} node[right](l2){};     \draw[-&gt;] (svmfcr4) -- ++(1.16,0) -- (mpl2); \draw[-&gt;] (svmfcr4) -- pic[pos=0.6,-]{jump} ++(1.16,0) -- (mpl2); \end{tikzpicture}    \end{document}      I know one way is to define a semicircular pic with a white fill and overlay it at the intersection (as implemented in the current code and highlighted with a red dashed circle). But ideally, I would like to implement a jump with no fill and define it as a marking decoration on the line, just like an arrow decoration that can be defined using decorations.markings library. Is there a way to implement this?
18722
I already have a code that draws a regular hexagon the following way   \begin{tikzpicture}[every node/.style={draw,shape=circle,fill=blue}] \path (0,0) node (p0) {} (-1.5,-1) node (p1) {} (-1.5,-2.5) node (p2) {} (1.5,-2.5) node (p3) {} (1.5,-1) node (p4) {} (0,-3.5) node (p5) { }; \draw (p0) -- (p1) (p0) -- (p1) (p0) -- (p2) (p0) -- (p3) (p0) -- (p4) (p0) -- (p5) (p1) -- (p2) (p1) -- (p3) (p1) -- (p4) (p1) -- (p5) (p2) -- (p3) (p2) -- (p4) (p2) -- (p5) (p3) -- (p4) (p3) -- (p5) (p4) -- (p5); \end{tikzpicture}   But Now I need to remove one of the points and to draw a regular pentagon the same way. So I need to remove (P5) and to recalibrate all other points (change their coordinates) But I don't need to change the code much.  Is there a way to do it by just slightly changing my code here. ?
81212
I am quite puzzled when drawing the connection of nodes.  \usepackage{xcolor} \definecolor{darkblue}{HTML}{1F4E79} \definecolor{salmon}{HTML}{FF9C6B} \tikzstyle{cell} = [rectangle, minimum width=1cm, minimum height=0.5cm,text centered, draw=black, fill=salmon] \tikzstyle{state} = [rectangle, minimum width=1cm, minimum height=0.5cm,text centered, draw=black, fill=darkblue] \tikzstyle{arrow} = [thick,-&gt;,&gt;=stealth]  \begin{tikzpicture}[thick,scale=0.8, every node/.style={scale=0.8},node distance=1.5cm]     \node (0) [state] {\textcolor{white}{feature extraction}};     \node (1) [cell, below of=0] {invertBotConE2\_f48\_k1\_b4\_noskip};     \node (2) [cell, below of=1] {invertBotConE2\_f16\_k3\_b4\_noskip};     \draw [arrow] (0) -- (1);     \draw [arrow] (1) -- (2);     \draw  (0.east)  [arrow]  edge [out=0, in=0, out looseness=4, in looseness=4]  (2.north); \end{tikzpicture}   0,2 are my nodes. When east is specified, it creates an arrow on node 0. If removed, it disappears. What if I would like to put 0.south as the start of the edge?
63424
I'm trying to reproduce the following diagram in TikZ and pgfplots.   My MWE with regenerated graph is below:  \documentclass{standalone} \usepackage{pgfplots}  \begin{document}  \pgfmathdeclarefunction{gauss}{2}{%   \pgfmathparse{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}% }  \begin{tikzpicture} \begin{axis}[   no markers,    domain=0:6,    samples=100,   axis lines*=left,    xlabel=$x$,   every axis y label/.style={at=(current axis.above origin),anchor=south},   every axis x label/.style={at=(current axis.right of origin),anchor=west},   height=5cm,    width=12cm,   xtick=\empty,    ytick=\empty,   enlargelimits=false,    clip=false,    axis on top,   grid = major   ]   \addplot [very thick,cyan!50!black] {gauss(3, 1)}; \draw [yshift=1.4cm, latex-latex](axis cs:2, 0) -- node [fill=white] {$0.683$} (axis cs:4, 0); \draw [yshift=0.3cm, latex-latex](axis cs:1, 0) -- node [fill=white] {$0.954$} (axis cs:5, 0);   \end{axis}  \node[below] at (1, 0)  {$\mu - 2\sigma$};  \node[below] at (2, 0)  {$\mu - \sigma$};  \node[below] at (3, 0)  {$\mu$};    \end{tikzpicture}  \end{document}     Issues   Nodes are not properly placed. How to remove y-axis? How to draw vertical dotted line?   Any help will be highly appreciated. Thanks
73957
I want to make a wall with a image repeating across it like wallpaper.  I tried it in the node editor but the image is taking up the entire plane. I just want it to be small and for the image to repeat across the entire plane.  How do I do that?
63680
I am interested in outputting  this graph in  latex using tikz:    So far I got this:    and my tikz code is   \begin{tikzpicture}     \node[shape=circle,draw=black] (A) at (0,0) {A};     \node[shape=circle,draw=black] (B) at (0,3) {B};     \node[shape=circle,draw=black] (C) at (2.5,4) {C};     \node[shape=circle,draw=black] (D) at (2.5,1) {D};     \node[shape=circle,draw=black] (E) at (2.5,-3) {E};     \node[shape=circle,draw=black] (F) at (5,3) {F} ;      \path [-&gt;] (A) edge node[left] {$5$} (B);     \path [-&gt;](B) edge node[left] {$3$} (C);     \path [-&gt;](A) edge node[left] {$4$} (D);     \path [-&gt;](D) edge node[left] {$3$} (C);     \path [-&gt;](A) edge node[right] {$3$} (E);     \path [-&gt;](D) edge node[left] {$3$} (E);     \path [-&gt;](D) edge node[top] {$3$} (F);     \path [-&gt;](C) edge node[top] {$5$} (F);     \path [-&gt;](E) edge node[right] {$8$} (F);    \end{tikzpicture}   I want to know how to draw the arc between nodes B and E and also thicker  arcs with their lengths in center. Any help is appreciated
2960
I have been searching for hours now on how to fix these small problems, and I am finally admitting defeat and humbly ask for help. Lately I have been going over some of my badly drawn figures, trying to clean the up and whatnot.       \documentclass[10pt,a4paper]{article}  \usepackage{tikz,tkz-euclide,pgfplots} \usetkzobj{all} \begin{document}  \begin{tikzpicture}[x=0.02cm,y=0.02cm,scale=0.8]   \tkzInit[ymin=-40,ymax=390,xmin=-40,xmax=540]   \tkzClip \draw[help lines,ultra thin,dashed,gray!50!white] (-50,-50) grid (550,400); \coordinate [label=below right:{50}] (x_1) at (50,0); \coordinate [label=below right:{}] (B) at (0,390); \coordinate [label=above right:{\large $y$}] (U) at (0,350); \coordinate [label=above left:{\large $x$}] (A) at (540,0); \coordinate [label=below right:{50}] (x_1) at (50,0); \coordinate [label=below right:{100}] (x_2) at (100,0); \coordinate [label=below right:{150}] (x_3) at (150,0); \coordinate [label=below right:{200}] (x_4) at (200,0); \coordinate [label=below right:{250}] (x_5) at (250,0); \coordinate [label=below right:{300}] (x_6) at (300,0); \coordinate [label=below right:{350}] (x_7) at (350,0); \coordinate [label=below right:{400}] (x_8) at (400,0); \coordinate [label=below right:{450}] (x_9) at (450,0); \coordinate [label=below right:{500}] (x_10) at (500,0); \coordinate [label=below right:{0}] (O) at (0,0); \coordinate [label=above left:{50}] (y_1) at (0,50); \coordinate [label=above left:{100}] (y_2) at (0,100); \coordinate [label=above left:{150}] (y_3) at (0,150); \coordinate [label=above left:{200}] (y_4) at (0,200); \coordinate [label=above left:{250}] (y_5) at (0,250); \coordinate [label=above left:{300}] (y_6) at (0,300); \coordinate [label=above left:{350}] (y_7) at (0,350); \coordinate [label=above left:{\bf Kostnader per m{\aa}ned (kroner)}] (R) at (400,350); \coordinate [label=above left:{\bf Ringetid (minutter)}] (K) at (540,20); \tkzDefPoint(0,-50){C}  \tkzDefPoint(-50,0){D} \tkzDefPoint(0,87.50){S} \tkzDefPoint(500,337.50){T} \tkzDrawSegment[thick,-stealth](D,A) \tkzDrawSegment[thick,-stealth](C,B) \tkzDrawSegment[ultra thick,red](S,T) \end{tikzpicture}  \vspace*{2ex}  \begin{tikzpicture} \begin{axis}[     scale only axis,     grid=major,     grid style={dashed, gray!40},     axis lines=middle,     inner axis line style={-stealth},     xlabel={\begin{tabular}{@{}r@{}}\bf Ringetid (minutter)\\ \large $x$\end{tabular}},     ylabel={\large $y$ \ \ \normalsize \bf Kostnader per m{\aa}ned (kroner)},     ytick={0,50,...,350},     xtick={0,50,...,500},     x tick label style={below right},     y tick label style={above left,},     ymin=-50,     ymax=380,     xmin=-50,     xmax=550, ] \addplot[color=red,very thick] coordinates { (0, 75) (500, 340)}; \end{axis} \end{tikzpicture}  \end{document}   The first image as a rather messy code, but the output is exactly as I want it. I tried cleaning up the code, but ran into heaps of problems.  My main issue how to keep the ratio between the x- and y-axis, is there any way to do this?  (Now I also had some problems with the x and y labels, and the thickness of the axis, but I guess that can wait for another answer...). Any other hints on improvements would be great.  =)
76362
I created following figure with a script as pasted below:    \documentclass[tikz,border=2mm]{standalone} \usepackage{tikz} \usetikzlibrary{positioning, shapes.multipart, arrows, shadows, backgrounds, fit}  \tikzset{   bluebox/.style={     draw,     rectangle,     minimum height=4.5cm,     fill=blue!50!white,     align=center,     inner sep=2ex   },   whitebox/.style={     draw,     rectangle,     minimum height=4.5cm,     fill=white,     align=center,     inner sep=2ex   },   item/.style={     draw,     inner sep=1ex,     fill=white    },   matrix/.style={     draw,     fill=white,     text centered,     minimum height=1em,     drop shadow   } }  \begin{document}  \begin{tikzpicture}[font=\sffamily]      % Stage 1     \node[whitebox, label={Labela}] (Stage1) {\rotatebox{90}{Something}};      % Stage 2     \node[whitebox, right=of Stage1, label=Labelpgq] (Stage2) {\rotatebox{90}{\footnotesize{Something}}};      % Stage 3     \node[draw, shape=rectangle split, rectangle split parts=2, fill=white, right=of Stage2, label=Options A] (OptionsA) {         \nodepart{one} A         \nodepart{two} B};      \node[draw, shape=rectangle split, rectangle split parts=2, fill=white, below=of OptionsA, label=Options B] (OptionsB) {         \nodepart{one} A         \nodepart{two} B};      \begin{scope}[on background layer]         \node[bluebox, fit=(OptionsA) (OptionsB), label=Labelg] (Stage3) {};     \end{scope}      \draw[dashed] (Stage1) -- (Stage2);     \draw[dashed] (Stage2) -- (Stage3); \end{tikzpicture}  \end{document}   Here are the issues I want to solve:   When labels contain a "p", "g" or "q", the text has a larger distance. It looks like the padding is given by the lowest pixel (bug?). For some reason, the blue box is shifted. It should be on level with the others. I experimented by applying "right=of Stage2" to the blue box, but without success.   I'm thankful for help here.
119693
I'm trying to create a fine flowchart that is a bit complicated. Therefore I need a block for a predefined process and a connector block as well as a data block. Can someone help me? In comment is what I'd like to see in my code to keep my code nicely arranged. The rest of the code is a simple example for the Tikz site.  \documentclass{article}  \usepackage[latin1]{inputenc} \usepackage{tikz} \usetikzlibrary{shapes,arrows} \begin{document} \pagestyle{empty}   % Define block styles \tikzstyle{decision} = [diamond, draw, fill=blue!20,      text width=4.5em, text badly centered, node distance=3cm, inner sep=0pt] \tikzstyle{block} = [rectangle, draw, fill=blue!20,      text width=5em, text centered, rounded corners, minimum height=4em] \tikzstyle{line} = [draw, -latex'] \tikzstyle{cloud} = [draw, ellipse,fill=red!20, node distance=3cm,     minimum height=2em]  %\tikzstyle{subroutine} = [draw,rectangle split, rectangle split         horizontal,rectangle split parts=3,minimum height=1cm]  %\tikzstyle{connector} = [draw,circle,...] %\tikzstyle{data} = [draw, trapezium, ...]  \begin{tikzpicture}[node distance = 2cm, auto]     % Place nodes     \node [block] (init) {initialize model};     \node [cloud, left of=init] (expert) {expert};     \node [cloud, right of=init] (system) {system};     \node [block, below of=init] (identify) {identify candidate models};     \node [block, below of=identify] (evaluate) {evaluate candidate models};     \node [block, left of=evaluate, node distance=3cm] (update) {update     model};     \node [decision, below of=evaluate] (decide) {is best candidate     better?};     \node [block, below of=decide, node distance=3cm] (stop) {stop};     % Draw edges     \path [line] (init) -- (identify);     \path [line] (identify) -- (evaluate);     \path [line] (evaluate) -- (decide);     \path [line] (decide) -| node [near start] {yes} (update);     \path [line] (update) |- (identify);     \path [line] (decide) -- node {no}(stop);     \path [line,dashed] (expert) -- (init);     \path [line,dashed] (system) -- (init);     \path [line,dashed] (system) |- (evaluate); \end{tikzpicture}   \end{document}
53874
I would like to draw this picture by tikz:  This is what I could achieve for now: \documentclass{standalone} \usepackage{tikz} \pagecolor{yellow}  \begin{document}  \color{orange!80!red}  \begin{tikzpicture}     \clip (-0.5,-0.5) rectangle (.5,.5);          \begin{scope}[xshift=4,yshift=12.4]         \fill (0,0) circle (0.05);     \end{scope}          \begin{scope}[xshift=10.5,yshift=-8.5]         \fill (0,0) circle (0.05);     \end{scope}          \begin{scope}[xshift=-11.5,yshift=-5.5]         \fill (0,0) circle (0.05);     \end{scope}          \clip[xshift=4,yshift=12.4] (0,0) circle (0.06) [insert path ={(-2,-2) rectangle (2,2)}];     \clip[xshift=10.5,yshift=-8.5] (0,0) circle (0.06) [insert path ={(-2,-2) rectangle (2,2)}];     \clip[xshift=-11.5,yshift=-5.5] (0,0) circle (0.06) [insert path ={(-2,-2) rectangle (2,2)}];          \begin{scope}[rotate=-70]         \clip (-0.015,0.005) ellipse (0.17 and 0.46) [insert path ={(-0.5,-0.5) rectangle (.5,.5)}];         \fill (0,0) ellipse (0.2 and 0.5);     \end{scope}          \begin{scope}[rotate=50]         \clip (-0.015,0.005) ellipse (0.17 and 0.46) [insert path ={(-2,-2) rectangle (2,2)}];         \fill (0,0) ellipse (0.2 and 0.5);     \end{scope}          \begin{scope}[rotate=-10]         \clip (-0.015,0.005) ellipse (0.17 and 0.46) [insert path ={(-2,-2) rectangle (2,2)}];         \fill (0,0) ellipse (0.2 and 0.5);     \end{scope}          \begin{scope}[xshift=-0.33,yshift=0.05]         \fill (0,0) circle (0.08);     \end{scope}  \end{tikzpicture}  \end{document}  I don't know how to draw the crossing of each ellipse. Note that the background color is not determined and may NOT be white, so one can't just draw a wider ellipse of background color behind each ellipse. I believe this can be achieved by multiple use of \clip, just like the three circle I've drown here, but for the ellipses it seems more tricky and I have no idea with it. Do you have any suggestions?