I have created a Gantt chart using pgfgantt. Here's the complete code :  \documentclass{article} %\usepackage[pdftex,active,tightpage]{preview} %\setlength\PreviewBorder{2mm} \usepackage[frenchb]{translator} \usepackage[frenchb]{babel} \usepackage{pgfgantt} \usetikzlibrary{shadows} \usepackage{lscape} \definecolor{barblue}{RGB}{153,204,254} \definecolor{groupblue}{RGB}{51,102,254} \definecolor{linkred}{RGB}{165,0,33} \sffamily  \setganttlinklabel{s-s}{Début \`a d\'ebut (DD)} \setganttlinklabel{f-s}{Fin \`a d\'ebut (FD)}  \begin{document} \begin{landscape} \begin{tikzpicture} % optional    \begin{ganttchart}[x unit=1.8mm,                        y unit chart=0.87cm,                        time slot format=isodate,                        %compress calendar,                       vgrid=*{5}{dotted},                       today=2014-04-27,                       today label=aujourd'hui,                       today label font=\scshape,                       newline shortcut=true,                       title/.append style={fill=blue!20, drop shadow},                       title label font=\sffamily\bfseries\color{white},                       title label node/.append style={below=-1.6ex},                       title left shift=.05,                       title right shift=-.05,                       title height=1,                       bar/.append style={draw=none, fill=black!63},                       bar label node/.append style={align=center, font=\tiny},                       bar incomplete/.append style={fill=barblue},                       bar height=.4,                       bar label font=\normalsize\color{black!50},                       link/.style={-latex, draw=red, fill=red},                       progress label text = {\pgfmathprintnumber[precision=0, verbatim]{#1}\% fait},                      ]                       {2014-04-14}{2014-07-11}    \gantttitlecalendar{month=name} \\       \ganttbar[progress=100]{Mise en place\ganttalignnewline de environnement\ganttalignnewline du travail}{2014-04-14}{2014-04-15} \\      \ganttbar[progress=100]{Spécifications}{2014-04-15}{2014-04-17} \\      \ganttbar[progress=70]{Comprendre et\ganttalignnewline analyser le\ganttalignnewline code existant}{2014-04-18}{2014-05-03} \\      \ganttbar[progress=60]{Analyse des \ganttalignnewline besoins de la\ganttalignnewline plate-forme MEANS}{2014-04-18}{2014-05-07} \\      \ganttbar[progress=30]{Conception des \ganttalignnewline services web}{2014-04-21}{2014-05-24} \\      \ganttbar[progress=80]{Conception de \ganttalignnewline l'API Java}{2014-04-25}{2014-05-07} \\      \ganttbar[progress=0]{Implémentation des\ganttalignnewline services web}{2014-05-26}{2014-06-15} \\      \ganttbar[progress=0]{Tests des\ganttalignnewline services web}{2014-05-26}{2014-06-17} \\      \ganttbar[progress=0]{Implémentation de\ganttalignnewline l'API Java}{2014-06-03}{2014-06-20}\\      \ganttbar[progress=0]{Tests de\ganttalignnewline l'API Java}{2014-06-03}{2014-06-21} \\      \ganttbar[progress=0]{Rédaction de\ganttalignnewline la documentation}{2014-06-22}{2014-06-25} \\      %\ganttbar[]{Maintenance}{2014-06-26}{2014-07-11}      \ganttlink[link type=f-s]{elem4}{elem6}     \ganttlink[link type=f-s]{elem1}{elem2}      \ganttlink[link type=s-s]{elem6}{elem7}       \ganttlink[link type=s-s]{elem8}{elem9}      \end{ganttchart} \end{tikzpicture} \end{landscape}  \end{document}   What I want now to draw vertical lines I can custimze (color, size ...etc.) like the one for today. For example I want to draw a red line on 2014-05-17 and put validation as label.   My question is like , but in my case I use isodate as slot time format and I don't know how to add a label text. Someone has an idea on how to do it?
38509
I want to add a command to pgfgantt package that draw vertical line at a specified date (like the one for the today line). Here's what' I want to get (green line) :    So I looked to pgfgantt.sty to see how the today line was drawn and I came with this code that I added into pgfgantt.sty file :  \newcommand\drawverticalline[1]{%  \begingroup%   \begin{pgfinterruptboundingbox}%    \begin{scope}     \gtt@tsstojulian{#2}{\gtt@today@slot}     \gtt@juliantotimeslot{\gtt@today@slot}{\gtt@today@slot}%      \pgfmathsetmacro\x@mid{%        (\gtt@today@slot - 1 + \ganttvalueof{today offset})%                   * \ganttvalueof{x unit}%      }%      \draw [/pgfgantt/today rule]                 (\x@mid pt, \y@upper pt) -- (\x@mid pt, \y@lower pt)                 node [/pgfgantt/today label node] {\ganttvalueof{today label}};%      \end{scope}     \end{pgfinterruptboundingbox}%     \endgroup% }     Now normally I could use the command like this : \drawverticalline{2014-05-07} but when I do this I got this error :  ! Package PGF Math Error: Unknown function `pt' (in 'pt').   The error came from this code :  \pgfmathsetmacro\x@mid{%        (\gtt@today@slot - 1 + \ganttvalueof{today offset})%                   * \ganttvalueof{x unit}%      }%   that doesn't have pt on it. So I decided to comment it and replace \x@mid by a constant (5) but now I get this error :  ! Undefined control sequence.   Why I get this error? the command is defined!  Here's the code from pgfgantt that draw the today line :  \def\@tempa{none}% \edef\@tempb{\ganttvalueof{today}}% \ifx\@tempa\@tempb\else%   \pgfmathsetmacro\x@mid{%     (\gtt@today@slot - 1 + \ganttvalueof{today offset})%     * \ganttvalueof{x unit}%   }%   \draw [/pgfgantt/today rule]     (\x@mid pt, \y@upper pt) -- (\x@mid pt, \y@lower pt)     node [/pgfgantt/today label node] {\ganttvalueof{today label}};% \fi%     MWE  \documentclass{article} \usepackage[frenchb]{babel}   \usepackage{pgfgantt} \usetikzlibrary{shadows}  \begin{document} \begin{tikzpicture} % optional    \begin{ganttchart}[x unit=1.8mm,                    y unit chart=0.87cm,                    time slot format=isodate,                    vgrid=*{5}{dotted},                  ]                   {2014-04-14}{2014-07-11}        \gantttitlecalendar{month=name} \\          \ganttbar[progress=100]{title1}{2014-04-14}{2014-04-15} \\         \ganttbar[progress=100]{title2}{2014-04-15}{2014-04-17} \\         \drawverticalline{2014-05-07}    \end{ganttchart} \end{tikzpicture} \end{document}
109958
I need some help with this diagram:   I would like to combine two entries in the “meta=” section. It should contain the {y*100}–value and the Label-value. Is it possible to add them somehow? In the end there should be the value in percentages and a star above each bar. I would like to change the color of the stars and error bars to black. Is it possible to extend the y-axis a tiny bit so it doesn’t end with a horizontal markline?   .  \documentclass{article}  \usepackage[libertine]{newtxmath} \usepackage{pgfplots} %\pgfplotsset{compat=1.11} \usepackage{filecontents}  \usepackage{tikz}  \usepackage{pgfplotstable} \usetikzlibrary{positioning} \usetikzlibrary{decorations.pathmorphing} \usetikzlibrary{arrows} \usetikzlibrary{patterns}  \begin{document}    \begin{filecontents}{data1.dat}     X Y Y_error Label     a 1 0 \\     b .155 .038 $\star$     c 0.80 0.019 $\star$     d 0.54 0.027 \\   \end{filecontents}      \begin{figure}     \begin{tikzpicture}        \begin{axis}[  bar width=1cm, % Width of the bar     x=2cm, % Distance between the centers of the bars     enlarge x limits={abs=1cm}, % The distance between the center of the first bar and the left edge     enlarge y limits=false,         symbolic x coords={a,b,c,d},             ymin=0,         xtick=data,         ybar,             axis x line*=bottom,     axis y line=left,     clip=false,   %  point meta={y*100}, %y-Werte mal 100 für Prozent      point meta=explicit symbolic,    yticklabel={\pgfmathparse{\tick*100}\pgfmathprintnumber{\pgfmathresult}\%} ,         nodes near coords,         nodes near coords align={vertical},         visualization depends on=abs(y)/y*(0.1+\thisrow{Y_error}) \as \myshift,         every node near coord/.append style={           anchor=center,shift={(0,transformdirectiony(\myshift))},         }]         \addplot+[draw=black, fill=white, error bars/.cd, y dir=both, y explicit, ]                   table[x=X, y=Y, y error=Y_error, meta=Label,] {data1.dat};                         \end{axis}       \end{tikzpicture}   \end{figure}   \end{document}
51164
I'm trying to write the following matrices.    I used the following code (given by )  \documentclass{article} % Load TikZ \usepackage{tikz} \usetikzlibrary{matrix,decorations.pathreplacing,calc} % Set various styles for the matrices and braces. It might pay off to fiddle around     with the values a little bit  \pgfkeys{tikz/mymatrixenv/.style={decoration=brace,every left delimiter/.style=    {xshift=3pt},every right delimiter/.style={xshift=-3pt}}}  \pgfkeys{tikz/mymatrix/.style={matrix of math nodes,left delimiter=[,right delimiter=    {]},inner sep=2pt,column sep=1em,row sep=0.5em,nodes={inner sep=0pt}}}  \pgfkeys{tikz/mymatrixbrace/.style={decorate,thick}}  \newcommand\mymatrixbraceoffseth{0.5em}  \newcommand\mymatrixbraceoffsetv{0.2em}  % Now the commands to produce the braces. (I'll explain below how to use them.) \newcommand*\mymatrixbraceright[4][m]{ \draw[mymatrixbrace] ($(#1.north west)!(#1-#3-1.south west)!(#1.south west)-    (\mymatrixbraceoffseth,0)$)     -- node[left=2pt] {#4}      ($(#1.north west)!(#1-#2-1.north west)!(#1.south west)-(\mymatrixbraceoffseth,0)$); }  \newcommand*\mymatrixbraceleft[4][m]{  \draw[mymatrixbrace] ($(#1.north east)!(#1-#2-1.north east)!(#1.south east)+    (\mymatrixbraceoffseth,0)$)     -- node[right=2pt] {#4}       ($(#1.north east)!(#1-#3-1.south east)!(#1.south east)+    (\mymatrixbraceoffseth,0)$); } \newcommand*\mymatrixbracetop[4][m]{ \draw[mymatrixbrace] ($(#1.north west)!(#1-1-#2.north west)!(#1.north east)+(0,\mymatrixbraceoffsetv)$)     -- node[above=2pt] {#4}      ($(#1.north west)!(#1-1-#3.north east)!(#1.north east)+(0,\mymatrixbraceoffsetv)$); } \newcommand*\mymatrixbracebottom[4][m]{ \draw[mymatrixbrace] ($(#1.south west)!(#1-1-#3.south east)!(#1.south east)-(0,\mymatrixbraceoffsetv)$)     -- node[below=2pt] {#4}      ($(#1.south west)!(#1-1-#2.south west)!(#1.south east)-(0,\mymatrixbraceoffsetv)$); }  \usepackage{tikz} \usetikzlibrary{matrix,decorations.pathreplacing}  \begin{document}    \[  \begin{tikzpicture}[mymatrixenv]  \matrix[mymatrix] (m)  {     a &amp; b &amp; c &amp; d &amp; e &amp; f \\     g &amp; h &amp; i &amp; j &amp; k &amp; l\\     l &amp; m &amp; n &amp; o &amp; p &amp; o \\     \hline \\     q &amp; r &amp; s &amp; t &amp; u &amp; v \\     w &amp; x &amp; y &amp; z &amp; a &amp; b \\     c &amp; d &amp; e &amp; f &amp; g &amp; h \\   };   \mymatrixbraceright{1}{3}{$E_1$}   \mymatrixbraceright{5}{7}{$E_2$}   \mymatrixbracetop{1}{3}{$E_1$}   \mymatrixbracetop{4}{6}{$E_2$} \end{tikzpicture} \]  \end{document}     It's really nice but still it doesn't serve my purpose. Any help in this regard will be highly appreciated. Thanks
107917
The following code I got from:     \documentclass{article}   \usepackage{pgfplots}  \usetikzlibrary{patterns}  \makeatletter \newcommand{\pgfplotsdrawaxis}{\pgfplots@draw@axis} \makeatother \pgfplotsset{only axis on top/.style={axis on top=false, after end axis/.code={              \pgfplotsset{axis line style=opaque, ticklabel style=opaque, tick style=opaque,                           grid=none}\pgfplotsdrawaxis}}}  \newcommand{\drawge}{-- (rel axis cs:1,0) -- (rel axis cs:1,1) -- (rel axis cs:0,1) \closedcycle} \newcommand{\drawle}{-- (rel axis cs:1,1) -- (rel axis cs:1,0) -- (rel axis cs:0,0) \closedcycle}  \begin{document}    \begin{figure}[htpb]      \centering      \label{fig:p3:c1}      \begin{tikzpicture}        \begin{axis}[only axis on top,         axis line style=very thick,          axis x line=middle,          axis y line=middle,           ymin=-1,ymax=5.99,xmin=-1,xmax=5.99,           xlabel=$x$, ylabel=$y$,grid=major        ]          \addplot [draw=none, pattern=north west lines, pattern color=blue!40, domain=-10:12]                  {3-3/2*x} \drawge;         \addplot[very thick, domain=-1:2.5,&lt;-&gt;] {3-3/2*x};        \end{axis}      \end{tikzpicture}      \caption{Problem 4, Part A}    \end{figure}   \end{document}   The question here is how can I get it to work with a setting like the following:    \documentclass[dvipsnames]{article} \usepackage{amsmath,pgfplots,tikz} \usetikzlibrary{arrows,calc} \begin{document}      \begin{tikzpicture}[transform shape,scale=0.6]     \draw[step=1cm,gray,very thin] (-4,-3) grid (4,5);     \draw [-latex,thick](-4,0) -- (4,0) node[right] {$x$} coordinate(x axis);     \foreach \x in {-3,-2,-1,1,2,3}              \draw (\x,0.1) -- (\x,-0.1) node [fill=white,below] {$\x$};     \foreach \y in {-2,-1,1,2,3,4}              \draw (0.1,\y) -- (-0.1,\y) node [fill=white,left] {$\y$};     \draw [-latex,thick](0,-3) -- (0,5) node[above] {$y$} coordinate(y axis);     \node at (-0.25,-0.3375) {0};     \draw[color=Cerulean,latex-latex,domain=-1.3:4] plot (\x,-3/2*\x+3);     \filldraw[OrangeRed] (0,3) circle (1.5pt) node[inner sep=2pt,right,fill=white,shift={(0.25,0)}] {$(0,3)$};     \filldraw[OrangeRed] (2,0) circle (1.5pt) node[inner sep=2pt,right,fill=white,shift={(0.25,0.35)}] {$(2,0)$};     \end{tikzpicture} \end{document}   That is, I would like to represent the solution set of the inequality in a similar manner as is done using pgfplots in my last example above. Is this possible?
91057
I want to create a bar plot using pgfplots. In this plot the bars should be represent categorys. So that one color suggest the category.  The categorys are:   0-8 None 9-13 Minimal 14-19 Slightly 20-28 Medium heavy 29-63 Heavy   Subsequent an example, but there are all bar in the same color:  \documentclass[11pt]{standalone} \usepackage[T1]{fontenc} \usepackage{fixltx2e} \usepackage{pgfplots}  \pgfplotsset{compat=1.8}  \begin{document} \begin{tikzpicture}   \begin{axis}[     xbar,     width=12cm,     height=8cm,     xmajorgrids=true,     yticklabel={\#\ifnum\ticknum&lt;9 0\fi\pgfmathprintnumber\tick},     ytick={1,2,...,10},     xmin=0,     xmax=36,     xtick={5,10,...,30},     xlabel={Sum},     ylabel={Participants},     %nodes near coords,     ymin=0.25,     ymax=10.75,   ]     \addplot coordinates       {(4,1) (16,2) (16,3) (33,4) (5,5) (10,6) (20,7) (8,8) (15,9) (5,10)};   \end{axis} \end{tikzpicture} \end{document}   Afterwards it should looks like the attached picture. I'm not sure if it is possible. The order of participants (#01 - #10) should be remain continuously.
55849
I am trying to build a custom calendar using some features of TikZ. My starting point was a piece of code available in a comment of texample.net.   I would like to know if it is possible to mark some days with symbols different than circles. If you compile the code below, you will see that circles can be easily inserted in the calendar. Now I would like to know if someone could show me how to insert diamonds or triangles or squares and if possible filled with some color.  Thank you in advance for your help.  \documentclass[12pt]{article} \usepackage{lscape,tikz} \usepackage[brazil]{babel} \usepackage[latin1]{inputenc} \usepackage[margin=1in, paperwidth=15.8in, paperheight=8.5in]{geometry} \usepackage{geometry} \usepackage{amsmath,color,graphicx} \usepackage{amsfonts} \usepackage{amssymb} \definecolor{Red}{cmyk}{0,1,1,0} \def\red{\color{Red}} \definecolor{Blue}{cmyk}{1,1,0,0} \def\blue{\color{Blue}}  %%in preamble: % \Huge \usetikzlibrary{arrows,shapes} \usetikzlibrary{positioning,calendar,er} \usetikzlibrary{decorations.markings} \usetikzlibrary{shapes.geometric}  \newcommand{\calrow}[1]{\node[anchor=base east](seg){S}; \node[base right=of seg](ter){T}; \node[base right=of ter](qua){Q}; \node[base right=of qua](qui){Q}; \node[base right=of qui](sex){\ \!S}; \node[base right=of sex](sab){\ \!S}; \node[base right=of sab](dom){D}; \node[black,above=of qui]{\textbf{#1}};} \newcommand{\calperiod}[1]{\calendar[dates=\the\year-#1-01 to \the\year-#1-last] if(Sunday) [red] \holidays;} \newcommand{\holidays}{% holidays in Italy if (equals=01-15) {\draw (-0.348,0.135) circle (9.0pt);}% if (equals=01-06) [black!50]% if (equals=04-04) [black!50]% if (equals=04-05) [black!50]% if (equals=04-25) [black!50]% if (equals=05-01) [black!50]% if (equals=05-01) [black!50]% if (equals=06-02) {\draw (-0.25,0.135) circle (9.0pt);}% if (equals=08-15) [black!50]% if (equals=11-01) [black!50]% if (equals=12-08) [black!50]% if (equals=12-25) [black!50]% if (equals=12-26) [black!50]% } \colorlet{darkgreen}{green!50!black}   \begin{document}  \begin{tikzpicture} [every calendar/.style={week list}] %\node[star,draw,minimum size=.4cm,star point ratio=1.0,thick] at (calendar-\the\year-08-29){}; \sffamily \matrix[% row 1/.style={black,node distance=.3ex},% row 3/.style={black,node distance=.3ex}, column sep=1ex,% draw=black,thick,rounded corners=30pt,% postaction={decorate,decoration={markings,mark=at position 0.51 with {\node[fill=white,text=black,font={\bfseries\Large}] (year) {\the\year};}}} % year on frame: decorations.markings library ]{% % first row: week day and month \calrow{Janeiro} &amp; \calrow{Fevereiro} &amp; \calrow{Março} &amp; \calrow{Abril} &amp; \calrow{Maio} &amp; \calrow{Junho} \\ % second row: calendar \calperiod{01} &amp; \calperiod{02} &amp; \calperiod{03} &amp; \calperiod{04} &amp; \calperiod{05} &amp; \calperiod{06} \\[0.4cm] % third row: week day and month \calrow{Julho} &amp; \calrow{Agosto} &amp; \calrow{Setembro} &amp; \calrow{Outubro} &amp; \calrow{Novembro} &amp; \calrow{Dezembro} \\ % forth row: calendar \calperiod{07} &amp; \calperiod{08} &amp; \calperiod{09} &amp; \calperiod{10} &amp; \calperiod{11} &amp; \calperiod{12} \\ }; \end{tikzpicture} \end{document}    Edition.  To clean up the code, I remove the repetitions  pointed out by Ulrike Fischer as well some useless comments.
78488
\documentclass{article} \usepackage{tikz} \usepackage{color} \usepackage[active,pdftex,tightpage]{preview} \usepackage{pgfplots} \usepackage{pgfplotstable}  \begin{document}  \begin{tikzpicture} \begin{axis}[ xlabel=Weight (kg), % label x axis ylabel=Height (cm), % label y axis axis lines=left, %set the position of the axes xmin=40, xmax=105, % set the min and max values of the x-axis ymin=150, ymax=200, % set the min and max values of the y-axis ] % add main points \pgfmathsetseed{1138} % set the random seed \addplot[only marks, samples=30, domain=42:100] % show marks, set no. of samples and set the domain of the points {(0.6*x+130)+5*rand}; % equation of the points  \end{axis}  \end{tikzpicture} \end{document}
74588
I want to plot this graph, but I don't know how to code the words in the nodes.     Here is my code:  \documentclass{article} \usepackage{amsmath} \usepackage{titletoc} \usepackage{tikz} \usetikzlibrary{trees,positioning,fit}  \begin{document}{\allowdisplaybreaks[4]}  \tikzstyle{bag} = [text width=2em, text centered] \tikzstyle{end} = []  \begin{center} \begin{tikzpicture}[sloped] \node (a) at ( 0,0) [bag] {$\ln r_0$}; \node (b1) at ( 3,1.5) [bag] {$\ln r_{10} + \sigma_1\sqrt{\Delta t_1}$}; \node (b2) at ( 3,-1.5) [bag] {$\ln r_{10}$}; \node (c1) at ( 6,3) [bag] {$\ln r_{20} + 2\sigma_2\sqrt{\Delta t_2}$}; \node (c2) at ( 6,1.5) [bag] {$\textrm{Mean} = \ln r_{20} + \dfrac{3}{2}\sigma_2\sqrt{\Delta t_2}$\\$\textrm{Mean Change} = \mu_{11}\Delta t_2 = \ln\dfrac{r_{20}}{r_{10}} + \dfrac{3}{2}\sigma_2\sqrt{\Delta t_2} - \sigma_1\sqrt{\Delta t_1}$}; \node (c3) at ( 6,0) [bag] {$\ln r_{20} + \sigma_2\sqrt{\Delta t_2}$}; \node (c4) at ( 6,-1.5) [bag] {$\textrm{Mean} = \ln r_{20} + \dfrac{3}{2}\sigma_2\sqrt{\Delta t_2}$\\$\textrm{Mean Change} = \mu_{11}\Delta t_2 = \ln\dfrac{r_{20}}{r_{10}} + \dfrac{3}{2}\sigma_2\sqrt{\Delta t_2} - \sigma_1\sqrt{\Delta t_1}$}; \node (c5) at ( 6,-3) [bag] {$\ln r_{20}$}; \draw [-&gt;] (a) to node [below] {} (b1); \draw [-&gt;] (a) to node [above] {} (b2); \draw [-&gt;] (b1) to node [below] {} (c1); \draw [-&gt;] (b1) to node [below] {} (c2); \draw [-&gt;] (b1) to node [below] {} (c3); \draw [-&gt;] (b2) to node [below] {} (c3); \draw [-&gt;] (b2) to node [below] {} (c4); \draw [-&gt;] (b2) to node [below] {} (c5); \end{tikzpicture} \end{center}  \end{document}       Update code use  \draw [-&gt;] (a) to node [below] {} (b1.south east); \draw [-&gt;] (a) to node [above] {} (b2.north east); \draw [-&gt;] (b1.south east) to node [below] {} (c1.west); \draw [-&gt;] (b1.south east) to node [below] {} (c2.west); \draw [-&gt;] (b1.south east) to node [below] {} (c3.west); \draw [-&gt;] (b2.north east) to node [below] {} (c3.west); \draw [-&gt;] (b2.north east) to node [below] {} (c4.west); \draw [-&gt;] (b2.north east) to node [below] {} (c5.west);
112494
I am new to TeX and I am trying to create a document which has regular text, paragraphs etc and also a timing diagram somewhere in between. I am using the TikZ timing package.  Here is an example of what I am trying to do.  Create a section. Write some text. Add a timing diagram. End section and on to the next section.  Here is the code sample I tried.  \documentclass{article} \usepackage{tikz-timing}[2009/12/09] \usepackage[active,tightpage]{preview} \PreviewEnvironment{tikzpicture} \setlength{\PreviewBorder}{1mm} \pagestyle{empty}  \begin{document} % % Defining foreground (fg) and background (bg) colors \definecolor{bgblue}{rgb}{0.41961,0.80784,0.80784}% \definecolor{bgred}{rgb}{1,0.61569,0.61569}% \definecolor{fgblue}{rgb}{0,0,0.6}% \definecolor{fgred}{rgb}{0.6,0,0}% %   \begin{section}  1.  Timing diagram of SR Flip Flop     Here is the timing diagram of SR flip flop.     \begin{tikztimingtable}[     timing/slope=0,         % no slope     timing/coldist=2pt,     % column distance     xscale=2.05,yscale=1.1, % scale diagrams     semithick               % set line width   ]   \scriptsize clock     &amp; 7{C}                              \\   S                     &amp; [fgblue] .75L h 2.25L H LLl       \\   R                     &amp; [fgblue]  1.8L .8H 2.2L 1.4H 0.8L \\   Q                     &amp;          L .8H 1.7L 1.5H LL       \\   $\overline{\mbox{Q}}$ &amp;          H .8L 1.7H 1.5L HH       \\   Q                     &amp; [fgred]  HLHHHLL                  \\   $\overline{\mbox{Q}}$ &amp; [fgred]  LHLLLHH                  \\ \extracode  \makeatletter  \begin{pgfonlayer}{background}   % Draw shaded backgrounds   \shade [right color=bgblue,left color=white]      (7,-8.45) rectangle (-2,-4.6);   \shade [right color=bgred,left color=white]      (7,-12.8) rectangle (-2,-8.6);   % Add background grid lines   \begin{scope}[gray,semitransparent,semithick]     \horlines{}     \foreach \x in {1,...,6}       \draw (\x,1) -- (\x,-12.8);     % similar: \vertlines{1,...,6}   \end{scope}   % Add labels   \node [anchor=south east,inner sep=0pt]     at (7,-8.45) {\tiny clocked};   \node [anchor=south east,inner sep=0pt,fgred]     at (7,-12.8) {\tiny positive edge triggered};  \end{pgfonlayer} \end{tikztimingtable}% % \end{section}  \end{document}   I am expecting the pdf to show the text first and then the timing diagram, but only the timing diagram is being generated.  Can somebody please help me?  Thanks
63423
I created this style that shifts the labels and put them on the bottom of the ybars.  However, I have a problem with the bars that have too short length (for example, see the 8.7 and 5.1 in the example below). I want to check if the values are less than some threshold, or the length of the bar is shorter than the label (number) then change its color.  How can I overlay another label on top of the one in white when the bar is shorter? or maybe change the color of the label to a gradient color? or just overlay the part that is outside of the bar?    \documentclass{standalone}  \usepackage{tikz} \usepackage{pgfplots} \usepackage{pgfplotstable} \usetikzlibrary{calc}  \begin{document} \makeatletter \begin{tikzpicture} \begin{axis}[ ybar, every node near coord/.style={   check for zero/.code={ % If meta=0, make the node a coordinate (which doesn't have text)     \pgfmathfloatifflags{\pgfplotspointmeta}{0}{         \pgfkeys{/tikz/coordinate}     }{}   },   check for zero, color=white, text opacity=1, font=\footnotesize, inner ysep=0.5pt, },% % Bottom nodes  calculate full offset/.code={     \pgfkeys{/pgf/fpu=true,/pgf/fpu/output format=fixed}     \pgfmathsetmacro\testmacro{((\pgfplotspointmeta-\pgfkeysvalueof{/pgfplots/ymin})*10^\pgfplots@data@scale@trafo@EXPONENT@y)*\pgfplots@y@veclength}     \pgfkeys{/pgf/fpu=false} },% nodes near coords bottom/.style={     every node near coord/.append style={         /pgfplots/calculate full offset,         yshift=-\testmacro,         rotate=90, anchor=west,%I need the rotate text here and not in the          %general style, as the ybar redefines the style     } },% ymin=0, nodes near coords={\pgfmathprintnumber[fixed zerofill,precision=1]{\pgfplotspointmeta}}, nodes near coords bottom, ] \pgfplotstableread{ % set real imag mag 1 8.7 2 5.1 3 91.8367  }\mydata \addplot table[x index=0,y index=1,header=false] {\mydata}; \end{axis} \end{tikzpicture} \makeatother \end{document}   * EDIT *  I need to create some special gradient on each label that is below the bar height. For example, I need to adapt something like  to each label that is not showing. However, I cannot find a way to put the macro in the style section of the codes. Or is there any equivalent solution?
17228
I'm trying to plot arctan(x) with pgfplots but I don't get a good output. Here is my code:   \begin{cfigur}\begin{axis}[      width=160pt,compat=1.5.1,grid style={ultra thin},every axis plot post/.append style={thick},      x tick label style={font=\tiny},y tick label style={font=\tiny},      scale only axis,grid=major,axis lines=middle,      xlabel={$x$},      ylabel={$y$},      xmin=-200,      xmax=200,      domain=-200:210,      ymin=-5.5,      ymax=5.5,      xtick={-150,-100,...,150},      ytick={-5, -4,...,5},      restrict y to domain=-20:20,      legend style={at={(0.5,-0.05)},anchor=north,nodes={right}},  ]  \addplot[mark=none,color=blue, samples=500]{atan(x)};  \addlegendentry{$y = \tan^{-1}x $};  \end{axis}\end{cfigur}
37681
This code works correctly:  \documentclass{article} \usepackage{tikz} \usetikzlibrary{positioning,calc} \begin{document}  \begin{tikzpicture}   \tikzset{     every picture/.prefix style={       execute at begin picture=\shorthandoff{;}     }   }   \def\names{{"1", "2"}}   \foreach \i in {0,1} {%     \ifnum\i=0\relax       \node (\i) [draw] {\pgfmathparse{\names[\i]}\pgfmathresult};     \else       \pgfmathparse{int(\i-1)}       \node (\i) [draw,right= 1cm of \pgfmathresult]             {\pgfmathparse{\names[\i]}\pgfmathresult};       \draw[dotted] ($(\pgfmathresult.south east) !.5! (\i.south west)$)             -- +(0,1cm);   \fi } \end{tikzpicture} \end{document}   But when I add  \usepackage[utf8]{inputenc} \usepackage[german]{babel}   to the preamble, it starts giving an error:  ! Argument of \language@active@arg" has an extra }. &lt;inserted text&gt;                  \par  l.25 }   the same for russian. It is somehow related to the quotes in the array:   \def\names{{"1", "2"}}   I tried the tricks, shown here for the french, but they don't work.
43936
I am using LaTeX, TikZ and PGFplot in order to automatically generate several series of diagrams, one of which is comprised of bar charts. Each bar in each bar chart may have a unique label and height -- I have used PGFplot before and I know that I can read in coordinates from files, but would it be possible for me to create labels for each bar using textual data stored in a tab-separated file? If so, how would I do this? A simplified example of a file I might use is shown below.  # foo.dat # Label | X-Position | Height  A    1    15 B    2    20 C    3    12 D    4    24   Thanks for your help!
50460
Am trying to align this in group of 3's but a bar in the AAAAAAAA group keeps going off alignment.   Note: I have checked  ,  and   and they don't answer my question - our data input format is different.  MWE:    \definecolor{bblue}{HTML}{82B1FF} \definecolor{rred}{HTML}{FF8A80}  \begin{filecontents}{testdata.csv} ALB,VAL,ERR,COR AA,20.61,0.32,bblue AA,20.88,0.55,bblue AA,20.41,0.29,bblue AAA,26.22,0.94,bblue AAA,26.43,0.45,bblue AAA,26.86,0.61,bblue AAAA,29.91,0.76,bblue AAAA,30.39,0.11,bblue AAAA,30.11,0.49,bblue AAAAA,34.71,0.43,rred AAAAA,34.87,0.99,rred AAAAA,34.81,0.26,rred AAAAAA,40.33,0.64,rred AAAAAA,40.18,0.03,rred AAAAAA,40.4,0.83,rred AAAAAAA,45.77,0.47,rred AAAAAAA,45.93,0.95,rred AAAAAAA,45.35,0.3,rred AAAAAAAA,50.35,0.13,rred AAAAAAAA,50.34,0.85,rred AAAAAAAA,50.66,0.55,rred \end{filecontents} \pgfplotstableread[col sep=comma]{testdata.csv}\datatable \makeatletter \pgfplotsset{     /pgfplots/flexible yticklabels from table/.code n args={3}{%         \pgfplotstableread[#3]{#1}\coordinate@table         \pgfplotstablegetcolumn{#2}\of{\coordinate@table}\to\pgfplots@yticklabels         \let\pgfplots@yticklabel=\pgfplots@user@ticklabel@list@y     } } \makeatother \begin{figure}  \begin{tikzpicture} \begin{axis}[     ylabel=A labels,  y label style={at={(-0.1,0.5)}},      y = -0.3cm,     ybar, %=2*\pgflinewidth,     draw opacity=0.5,     bar width=6pt,     enlarge y limits={abs=7pt},     xbar,      width=.36\textwidth,     xlabel= unit,     %flexible xticklabels from table={testdata.csv}{ALB}{col sep=comma},      flexible yticklabels from table={testdata.csv}{ALB}{col sep=comma},     yticklabel style={font=\small,xshift=0.5ex,  anchor=east},       %xtick=data     ytick=data,     xmajorgrids ] %\pgfplotsinvokeforeach {0}{     \addplot     %style={color=cyan,fill=bblue,mark=none};     plot [error bars/.cd, x dir=both,x explicit ]          table[y expr={(\coordindex) - mod(\coordindex,3)/8},x=VAL, x error=ERR ] {\datatable};  \end{axis}  \end{tikzpicture}  \end{figure}
38556
I am trying to draw a bar chart in which each independent variable has multiple bars showing its performance in different areas. The problem I am having here is that the bars for the third variable is not showing up. The code I am using is shown below  \begin{center} \begin{tikzpicture} \begin{axis}[ x tick label style={ /pgf/number format/1000 sep=}, ylabel=Passenger Count, enlargelimits=0.05, legend style={at={(0.5,-0.15)}, anchor=north,legend columns=-1}, ybar interval=0.5, symbolic x coords={1st Class, 2nd Class, 3rd Class}, grid=major ] \addplot coordinates {(1st Class,6) (2nd Class,6) (3rd Class,324)}; \addplot coordinates {(1st Class,0) (2nd Class,98) (3rd Class,81)}; \addplot coordinates {(1st Class,41) (2nd Class,56) (3rd Class,45)}; \addplot coordinates {(1st Class,169) (2nd Class,24) (3rd Class,41)}; \legend{0-10,10-20,20-30,$&gt;30$} \end{axis} \end{tikzpicture} \end{center}
105905
After reading a question on "",  I have a code like this that refers to the inequalities    \documentclass{article} \usepackage{mathtools} \usepackage{amssymb} \usepackage{MnSymbol} \usepackage{tikz} \usepackage{pgfplots} \usetikzlibrary{intersections} \usetikzlibrary{patterns}  \makeatletter \newcommand{\pgfplotsdrawaxis}{\pgfplots@draw@axis} \makeatother \pgfplotsset{only axis on top/.style={axis on top=false, after end axis/.code={              \pgfplotsset{axis line style=opaque, ticklabel style=opaque, tick style=opaque,                           grid=none}\pgfplotsdrawaxis}}}  \newcommand{\drawge}{-- (rel axis cs:1,0) -- (rel axis cs:1,1) -- (rel axis cs:0,1) \closedcycle} \newcommand{\drawle}{-- (rel axis cs:1,1) -- (rel axis cs:1,0) -- (rel axis cs:0,0) \closedcycle}  \begin{document} \begin{figure}[ht] \centering \begin{tikzpicture} \begin{axis}[axis line style=thin, axis x line=center, axis y line=center, ymin=-7, ymax=7, xmin=-7, xmax=7, xlabel=\(x\), ylabel=\(y\), grid=minor] \addplot[name path global=line1, pattern=north west lines, color=blue!50, thick, domain=-7:7]{3*x-5}; \addplot[name path global=line2, pattern=north west lines, color=blue!50, thick, domain=-7:7]{6-2*x}; \addplot [draw=none, pattern=northeast lines, pattern color=blue!40, domain=-7:7]{3*x-5} \drawle; \addplot [draw=none, pattern=northeast lines, pattern color=blue!40, domain=-7:7]{6-2*x} \drawge; \end{axis} \end{tikzpicture} \end{figure}   \end{document}   which looks like    I want it to look like   , where the graph is filled only where all the inequalities hold true. NOTE the two graphs are entirely different problems. I only want the style, not the question.  However, the code for the latter image uses intersections:  \begin{figure}[ht] \centering \begin{tikzpicture}     \begin{axis}[axis line style=thin,     axis x line=center,     axis y line=center,     ymin=-6, ymax=7, xmin=-6, xmax=11, xlabel=\(x\), ylabel=\(y\), grid=minor]     \addplot[name path global=line1, color=blue!50, thick, domain=-5:10]{5/3-x/3};     \addplot[name path global=line2, color=blue!50, thick, domain=-5:10]{x/5-10/7};     \addplot[name path global=line3, color=blue!50, thick, domain=-5:10]{6*x+10};     \fill[name intersections={of=line1 and line2,by=point1}, name intersections={of=line1 and line3,by=point2}, name intersections={of=line2 and line3,by=point3}][very thick, pattern=northeast lines, draw=blue!60, pattern color=blue!30!cyan](point1)--(point2)--(point3)--(point1);     \end{axis} \end{tikzpicture} \end{figure}   The first image has only one intersecting point, hence I cannot use this method. I also don't want other areas shaded- only the final areas where the lines intersect. Is there a way around it without to find the points in which the lines intersect the border of the grid, meaning I have to manually compute the points?  EDIT: added the inequalities for the graph.
94925
I have two questions regarding the pgfplots package. I have attached the source code I worked on. There are two features I am not able to realize:   I would like to put the total value (sum of the whole stacked bar) on top of the bar, rotated by 90°. For me, it was only possible yet to get the value of each part of the stacked bar by using the nodes near coords command. Additionally, the percentage of each part of the stacked bar as relative to the whole stacked bar should be displayed in the bar, also rotated by 90° (addition equals 100%)   If it is somehow possible, percentages should have only one significant digit, and those below 5% should not be displayed in the bar. I know this is a pretty complex example, but maybe there is one who can solve it.  \documentclass{article}  \usepackage{pgfplots,pgfplotstable}   \usetikzlibrary{pgfplots.groupplots}    \pgfplotsset{compat=1.8}   \pgfplotstableread{  Criterion  ddd     ccc     vvv   (0)    700         750         750   (a)    700         750         750   (b)        1200        750         750       (c)    33      345     345  (d)    34      333     345  (e)    234     344     344   }\Rob   \pgfplotstableread{  Criterion  ddd     ccc     vvv   0      70          75          75    a      70          75          75    b          120         75      75        c      3       34      34  d      3       33      34  e      23      34      34  }\Gab   \begin{document}  \begin{tikzpicture} \begin{groupplot}[group style= {     columns=2,xlabels at=edge bottom,     ylabels at=edge left,     horizontal sep=1cm,group name=plots, }, ymin=0, enlarge x limits={abs=.5}, enlarge y limits={upper,value=0.4},  ylabel=Mon, ylabel style={text height=0.02\textwidth,inner ysep=0pt},  ybar,ybar stacked, major x tick style = transparent,  /pgf/bar shift=0pt, /pgf/bar width=9pt, x tick label style={text height=2ex},    xlabel style={yshift=-2ex},  xticklabels from table={\Rob}{Criterion},  xtick=data,legend columns=-1, legend style={draw=none, /tikz/every even column/.append   style={column sep=5pt}}]  \nextgroupplot[xlabel=Rob, xlabel shift = -7.5cm, legend to name=grouplegend] \pgfplotstableforeachcolumn\Rob\as\col{     \ifnum\pgfplotstablecol=0      \else       \edef\tmp{         \noexpand\addplot table [x expr=\noexpand\coordindex,y=\col] {\noexpand\Rob};         \noexpand\addlegendentry {\col}     }     \tmp     \fi }  \nextgroupplot[xlabel=Gab, xlabel shift = -7.5cm] \pgfplotstableforeachcolumn\Gab\as\col{     \ifnum\pgfplotstablecol=0      \else     \edef\tmp{         \noexpand\addplot table [x expr=\noexpand\coordindex,y=\col] {\noexpand\Gab};     }     \tmp     \fi   }   \end{groupplot}  \draw[dashed] (plots c1r1.south west) -- ++(0,-1.5);   \draw[dashed] (plots c1r1.south east) -- ++(0,-1.5);  \draw[dashed] (plots c2r1.south west) -- ++(0,-1.5);  \draw[dashed] (plots c2r1.south east) -- ++(0,-1.5);  \node at (plots c1r1.south) [inner sep=0pt,anchor=north, yshift=-12ex]     {\ref{grouplegend}};  \end{tikzpicture}  \end{document}