Tag Info

New answers tagged

3

Here are two examples that produce "attached lables", one using transform shape, the other using rotation correction. \documentclass[tikz,border=7mm]{standalone} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \foreach \i in {0,30,..., 330} \draw[red, ->, rotate=\i, transform shape] (0,0) -- +(0:3) node[rotate=-90,above]{fixed}; ...


4

Even with forest which can do a lot of things automatically, a certain amount of manual tweaking is needed. There is just no way for it to know what the content of the node means. However, forest does allow you to integrate the loops into the tree which may be attractive in some cases. For example: \documentclass[tikz,border=5pt]{standalone} ...


0

forest can automatically handle the insertion and placement of ellipses as required. For example: \documentclass[tikz, border=5pt]{standalone} \usepackage{forest} \begin{document} \forestset{ gappy/.style={ before typesetting nodes={ insert after={ [\dots, no edge] } } } } \tikzset{ document element/.style={ rounded ...


2

In my answer I will address both the header concern, and the incorrect column spacing problem separately. General Requirement The first thing to do is to modify the .cls file by adding the following lines at the beginning after the main packages are loaded: \newif\ifafourpaper \afourpaperfalse \DeclareOption{a4paper} {\setlength\paperheight {297mm}% ...


1

Here is a short solution to create this kind of diagrams : \documentclass[tikz,border=7mm]{standalone} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} % draw the grid and the numbers \draw (-1,-1) grid (5,5) foreach \i in {0,...,5}{ (\i-.5,5.5) node{\i} (-1.5,4.5-\i) node{\i}}; % for every line we give first and last index to ...


7

You can use something like: \path [line] (D) -- ++(0,-30pt) -| (T) node[transition,pos=0.83,left] {$p_{repl}$}; The complete code: \documentclass{article} \usepackage{tikz} \usetikzlibrary{positioning} \begin{document} \tikzstyle{status} = [rectangle, draw=black, text centered, anchor=north, text=black, minimum width=2em, minimum height=2em, node ...


2

Try adding anchor=center to the node style, i.e. within nodes={} in m2style. \documentclass[border=3mm]{standalone} \usepackage{tikz} \usetikzlibrary{ fit, positioning, matrix, } \begin{document} \begin{tikzpicture} \tikzset{ status/.style={rectangle, draw=black, text centered, text=black, minimum width=1.5em, minimum height=1.5em, ...


2

Like this? I just neamed the scenario nodes and then used those names to draw the lines: \node[xshift=-7cm ,yshift= 7cm, font=\small] at (a) (sce1) {scenaio 1} ; \node[xshift=-6cm ,yshift= 6cm, font=\small] at (a) (sce2) {scenario 2} ; \node[xshift=-5cm ,yshift= 5cm, font=\small] at (a) (sce3) {scenario 3} ; \draw[densely dotted] ...


0

Actually you can do that with edge instead of \draw: Just add \tikzset{ -|/.style={to path={-| (\tikztotarget)}}, |-/.style={to path={|- (\tikztotarget)}}, } somewhere, then you can use edge[-|] and edge[|-]. (Of course you can replace them with other names like “hv” or “vh” for “horizontal-vertical” etc, if you still want to use the -|/|- arrow ...


1

You can also define a node placed at the middle of the coordinates, and big half the distance of the two coordinates. \node[rounded corners, draw=red, minimum size=10cm] at (15,15) {}; Here are the corners to show it fits: Ouput Code \documentclass[border=10pt]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \coordinate ...


3

If I understood you correctly, you like to determine rectangle with size determined with two coordinates (bottom left, top right). If this is a case, you can obtain this as follows: \documentclass[tikz,border=5mm]{standalone} \usetikzlibrary{fit} \begin{document} \begin{tikzpicture}[ mynode/.style 2 args = { draw, rounded corners, fill=black, ...


2

These are indeed special connections which are not very easy to deal with. Are these connections only to connect circles with straight lines, you can use the intersection cs (or its implicit variant intersection of). Of course, you could also use the intersections library but then you need to name paths and those path have to actually intersect. (Due to a ...


0

Another solution using and a rectangular node (and a quick and dirty fill=white). Alenanno's solution is closer to your original code though, so it is probably more useful. \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{arrows.meta,fadings} \begin{document} \begin{tikzpicture} \coordinate(A) at (1.5,4); \coordinate(B) at (2,0.5); ...


0

I defined a new coordinate F in your example (A + the relative coordinates), because it's easier without using relative coordinates like you did, then you can use the following syntax. (F) -- (F|-C1.north); What it does is: start from F and then go up to C1.north but still perpendicular to F. I coloured the arrow red so you see it. By the way, when ...


2

For a shorter box, try minimum height=3cm or whatever. For text higher within a 4cm box, try \node [anchor=north] (name) at (box.north) or \node [anchor=center] (name) at ([yshift=5mm]box), say.


2

There are two things that are making code give unintuitive result. If we fix the node locations and change the path a bit, it is easier to see, \begin{tikzpicture}[startstop/.style={circle,inner sep=0mm,outer sep=18mm,draw=black,fill=blue!50}] \node[startstop] (A) {A}; \node[startstop] (B) at (2,0) {B}; \node[startstop] (C) at (2,-2) {C}; \draw[line ...


3

You can use the rel axis cs inside the axis to draw the green lines and set named coordinates at the projected points. \draw[green,very thick] (A|-{rel axis cs:0,0})coordinate(Ax)--(A)--({rel axis cs:0,0}|-A)coordinate(Ay); Then you can draw the red nodes and lines outside the axis. \draw[red,very thick] ...



Top 50 recent answers are included