New answers tagged

2

This should give you a starting point. If you have any questions, consult the pdfplots user guide. \begin{filecontents*}{data.dat} Date, Ford, GM, Uber 2010 Q4 3, 60000, 50000, 1 2010 Q4 4, 70000, 57000, 1 2010 Q4 5, 60000, 55000, 1 2011 Q2 1, 55000, 47000, 1 2011 Q2 2, 56000, 45000, 1 2011 Q2 3, 58000, 45500, 1 2011 Q2 4, 56000, 44500, 1 2011 Q2 ...


1

The problem comes from text height and text depth defined in tikzpicture options. In this way, they apply to all nodes, and right hand text is a node, so its vertical size is defined by these values. If you doesn't use text height and text depth, all other nodes won't be aligned, so it's not convenient to suppress them. As I don't know how to forget ...


11

shorten < and shorten > are not directly described in the manual as far as I can see, but it looks like they are interfaces to \pgfsetshortenstart and \pgfsetshortenend respectively, which are documented in the end of section 99.3 Arrow Tips on a Path (manual for version 3.0.1a, dated 29 August 2015). shorten <= <length> reduces the length ...


2

Here's an attempt in Metapost. It's a bit less structured perhaps than PGFplots+Tikz, and maybe this gives you more artistic freedom, for this sort of semi-numerical diagram. I would recommend Asymptote for anything more demanding in 3D than these cyclinders. In this example, I've used luamplib to make it easier to typeset using Palatino as in the OP, so ...


3

Metapost would give better results, but if you wish to use TikZ, decorations.text offers a variety of options. For example: \documentclass[tikz,border=10pt,multi]{standalone} \usetikzlibrary{decorations.text} \begin{document} \begin{tikzpicture} \draw [thick] (0,0) circle (3cm); \foreach \i/\j/\k in ...


2

The rework of cfr's graphs solution with scope to place the two graphs side-by-side, originating from our discussion with Alan. \begin{tikzpicture} \graph [grow right, nodes={draw, circle}, /tikz/every label/.append style={label distance=5pt}] { a/"1" -> 1[label=above:$S_1$] <-> 2[label=below:(b) $x_1+x_1x_2+x_2x_3$] -> ...


5

You can do this neatly in Metapost too. \documentclass[border=5mm]{standalone} \usepackage{luamplib} \begin{document} \mplibtextextlabel{enable} \begin{mplibcode} beginfig(1); % unit length u = 1cm; % axes path xx, yy; xx = (1/2 left -- 5 right) scaled u; yy = xx rotated 90; % the pseudo-random function (with a flat spot) path tt; tt = ( (0,0) { dir ...


9

This is my approach with the fillbetween library. The result and the used code are nowhere near perfect, especially because I use the function (x-2)^3-2 and no bezier curves as in the question. \documentclass[10pt]{article} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{pgfplots} \pgfplotsset{compat=newest} ...


3

Please remember that very nearly almost all questions should include a minimal working example setting up the problem. This answer will be less useful because I've no idea what the problem is or what you've tried or what you know. So it is just code by way of a demonstration of one possibility. Fine-tuning is left as an exercise for the reader. ...


5

You can use font={\usebeamercolor[fg]{block title}}. The reason for using font here is that \usebeamercolor as I understand it essentially inserts a \color{<color name>}, so you cannot use it as a colour name directly. \documentclass{beamer} \usepackage{tikz} \begin{document} \frame{ \begin{tikzpicture} \draw (0, 5) node (n1) ...


2

Apparently, the problem arises because of the glossary entry \gls{DPPM} on the second arrow: During the first (invisible) invocation on the arrow, \gls{DPPM} gets rendered as the long Bis"-(di"-phenyl"-phos"-phino)"-methan (DPPM) as defined in the glossary file. This causes a line break and a larger height of the (invisible) bounding box in the first frame, ...


2

Do you want something like this? \documentclass[tikz,border=10pt,multi]{standalone} \usetikzlibrary{arrows.meta} \begin{document} \begin{tikzpicture} [ customer/.style={circle, draw, fill=gray!50, inner sep=0pt, minimum size=2mm}, depot/.style={draw, fill, thick, inner sep=0pt, minimum size=3mm}, thick, >={Triangle[width=.75ex, ...


3

You need the code after \draw to expand to tikz syntax: \RequirePackage{luatex85} \documentclass{article} \usepackage{fontspec} \usepackage{tikz,xparse} \usetikzlibrary{quotes,through,calc,intersections,backgrounds} \usepackage{luacode} \usepackage[margin=1cm]{geometry} \luadirect{require "LTG_Droites"} \DeclareExpandableDocumentCommand{\Dt}{% ...


1

I don't know the reason exactly, but presumably there was some change in how circuitikz handles keys added to the optional argument of the circuitikz environment. Anyways, an easy solution is to define the styles in a \tikzset elsewhere, e.g. \documentclass{standalone} \usepackage{tikz} \usepackage[siunitx]{circuitikz} \tikzset{ opamp ...


3

You've gotten a good answer already, so this is just an alternative approach, which may be useful in other contexts. pgfplots has a list of styles that it steps through for each \addplot. There are several lists to choose from, see section 4.7.7 Cycle Lists – Options Controlling Line Styles in the manual, but you can also define your own. This is especially ...


5

mark options only affects the marks - not the style of the lines. \addplot+ adds options to those which would be used by \addplot, which would default to cycling through line styles, colours etc. So only options you explicitly override don't take effect. If you don't want the options to be appended, use \addplot[<options>] instead. For example: ...


1

Here is a suggestion using layers. If layer pre main is defined all the \tikzfillbetween stuff goes to this layer automatically. \documentclass{standalone} \usepackage{pgfplots} \usetikzlibrary{patterns,positioning} \pgfplotsset{compat=1.10} \usepgfplotslibrary{fillbetween} \begin{document} \begin{tikzpicture}[ thick, pathE/.style={% path E is used ...


1

I have rebuilt your code from scratch (but using your colors, font sizes, etc.) solely in Tikz. The code is shorter and easier to maintain in some cases. There are very minor differences in positions, but I tried to replicate your own as close as I could I have wrapped everything in a newcommand \mytitlepage with 5 arguments: \mytitlepage{ <title> }{ ...


3

It also possible to solve this by clipping. This avoids that the background of the circles is filled with white. The are of a circle can be excluded from the clipping path by combining the circle with the full drawing area using the even odd rule. The circle area is covered twice and therefore excluded (even). This needs to be repeated for each circle, ...


1

With the option fill=white, you can draw filled white disks above the lines drawn before. Note the changed order of the circles and the cleaned code. \documentclass[]{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw[fill=white] (0.5,0.5) circle [radius=1]; \draw[fill=white] (0.5,-0.5) circle [radius=1]; ...


3

The even odd rule helps. Only these regions are filled, which are covered with an odd number of times. The intersection is filled twice, thus, it remains unfilled: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \filldraw[ radius=3cm, fill=gray, even odd rule, ] (2,2) circle[] (5,2) ...


3

For example: \documentclass[tikz,border=10pt,multi]{standalone} \usepackage{venndiagram} \begin{document} \begin{venndiagram2sets}[labelA={}, labelB={}] \fillANotB \fillBNotA \end{venndiagram2sets} \end{document}


2

A simple tabular and 3 pstricks nodes. The text is written first, and a triangle is added around it: \documentclass[x11names]{standalone} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{ebgaramond} \usepackage{array} \usepackage{pstricks-add} \usepackage{auto-pst-pdf} \psset{unit = 2,dotsize = 2.5pt} \begin{document} \begin{postscript} ...


1

Do you want something like this? \documentclass{scrbook} \usepackage{wrapfig} \usepackage{chemfig} \usetikzlibrary{fit} \usepackage{kantlipsum} \newcommand{\namemole}[1][]{% \chemfig{% ...


3

I don't know why you refuse to post compilable code, but whatever. Anyway, for something like that, I'd use fit to draw the boundaries around 2+ nodes. And I'd use a chain or the TikZ graphs stuff for the graph itself. For example, with a simple chain (no real need for a graph here): \documentclass[tikz,border=10pt,multi]{standalone} ...


0

If your data is going to be plotted in the order that it appears in the table and the index column is not used to adjust the order or position of the bars, you can simply use xtick = {1,...,20} where 20 is just an arbitrary number that's greater than the number of rows in your table. This will generate a tick position at every integer value of x between 1 ...


7

Here is a beginning of solution, I filled the table with any values. you must use the commands canvas to draw on inclined plane and use transform shape for as bow node \documentclass{scrartcl} \usepackage{tikz} \usetikzlibrary{arrows,3d,matrix} % see the explanation below \makeatletter \tikzoption{canvas is xy plane at z}[]{% ...


4

If I understand correctly than you looking for one of the following results: or Both images are generated by: \documentclass[border=3mm, multi, tikz]{standalone} \begin{document} \begin{tikzpicture}[ vrtx/.style = {circle, draw, fill=gray!30, inner sep=2pt} ] \coordinate (i) at (0,0); \coordinate ...


1

You have already named the left plot. Set a name for the right too and use \begin{tikzpicture}[trim left=(first.south west),trim right=(second.south east)] Code: \documentclass{article} \usepackage{blindtext} \usepackage{pgfplots} \pgfplotsset{compat=1.12} \begin{document} \begin{figure} \begin{tikzpicture}[trim left=(first.south west),trim ...


6

Something like this? If I'm not wrong, it's difficult to insert nodes over a path defined with plot option which is what you used to draw the final lines. The solution consists in drawing the line with plot and use another command to place the label over it. In following code there are some other changes respect your original code. The first one is ...


2

You seem to know how to add options to individual cells, with |[...]| already, so in that sense you've almost answered your own question: Add fill=<color> in those options, e.g. |[fill=blue!20]|. \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc,matrix} \usepackage{amsthm} \usepackage{colortbl} \begin{document} \begin{table}[h] ...


1

The reason for this is that & is redefined inside the TikZ matrix. Consider these quotes from the manuals of beamer and TikZ, respectively: You must also use the [fragile] option for frames that include any “fragile” text, which is any text that is not “interpreted the way text is usually interpreted by TEX.” For example, if you use a package that ...


3

One somewhat hacky version, simply not typesetting the labels: \documentclass[tikz]{standalone} \usepackage{tikz} \usetikzlibrary{datavisualization} \begin{document} \begin{tikzpicture} \datavisualization [scientific axes,visualize as line, all axes={ticks={tick typesetter/.code=}}] data { x, y 0, 7 3, 6 7, 0 }; \end{tikzpicture} ...


1

You can add (1) edge [in=150,out=90,looseness=5,->] (1) to create self loop for (1) node, where looseness define how "loose" the curve will be. \documentclass[tikz,border=10pt]{standalone} \usetikzlibrary{positioning} \tikzset{main node/.style={circle,fill=black!20,draw,minimum size=1cm,inner sep=0pt}} \begin{document} \begin{tikzpicture} %%node ...


2

chains, loops and scopes can help: \documentclass[tikz,border=10pt,multi]{standalone} \usetikzlibrary{chains,scopes} \begin{document} \begin{tikzpicture} [ start chain=main going below, every on chain/.append style={text width=15mm, text centered, minimum height=7.5mm, draw}, every join/.append style={->} ] \node [on chain, join] {A}; \node [on ...


0

My answer isn't TeX-style, but how I prefer to do it: Use inkscape (external, but free software) and \includegraphics the exported pdf. The main advantage of this method is, that it is very simple and easy to use. If you dont want to use Tex by any means for Tex's sake, I would recommend this to a beginner.


5

As starting point can serve the following pure TikZ code with libraries arrows.meta, chains and positioning: \documentclass[border=3mm, multi, tikz]{standalone} \usetikzlibrary{arrows.meta, chains, positioning} \begin{document} \begin{tikzpicture}[ node distance = 12mm and 2mm, start chain = going right, every ...


6

Do you want something like this? This was drawn using forest, which is a specialist drawing package for trees, based on TikZ. \documentclass[tikz,border=10pt,multi]{standalone} \usepackage{forest} \begin{document} \begin{forest} for tree={ draw, circle, grow=-180, edge={thick}, thick, edge path'={% (!u.parent anchor) |- ...


6

It isn't entirely clear what you mean by 'structure'. Normally, for a graph or tree, I'd understand this to mean the way in which the nodes are connected to each other and not the distance and direction of one node relative to another. But it seems you mean the latter as well, although whether this is really it is another matter. If so, I take it you want ...


2

Not exactly what daleif proposed but similar. Once nodes A and B are defined, the wanted intersection is at (A|-B) coordinate. Then it's easy to draw desired braces. \documentclass[tikz,border=2mm]{standalone} \usetikzlibrary{positioning, decorations.pathreplacing} \usepackage{lmodern} \begin{document} \begin{tikzpicture}[axis/.style={very thick, ->}, ...


4

One possibility \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{tikz} \usetikzlibrary{shapes.geometric, arrows} \begin{document} \tikzstyle{process} = [rectangle, text centered, draw=black, fill=orange!30] \tikzstyle{arrow} = [thick,->,>=stealth] \begin{tikzpicture}[node distance=1cm] \node (A) [process] {A}; \node (B) ...


8

Quick demonstration with TikZ: \documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes.geometric} \begin{document} \begin{tikzpicture} \node[ draw, align=center, regular polygon, regular polygon sides=3, inner sep=-10pt] { Join \\ Graham \\ as he sets sail\\ \ldots}; \end{tikzpicture} \end{document}


0

A little example with circuits TikZlibrary. \documentclass[tikz,border=2mm]{standalone} \usetikzlibrary{circuits.logic.IEC} \begin{document} \begin{tikzpicture}[circuit logic IEC, huge circuit symbols] \matrix[column sep=10mm] { \node [nand gate] (nand) {}; & & \\ & \node [nor gate, inputs=nni] (nor) {}; & ...


14

It is always appreciated if you show a bit of compilable code that shows the effort you already put into finding a solution. If you have nothing, maybe put at least a bit like: \documentclass{article} \begin{document} \end{document} The following might give you some ideas of how you could solve your problem: shapepar solution: As pointed out in the ...


2

You need to add the [transform shape] option when creating the node. \documentclass{standalone} \usepackage{graphicx,tikz} \begin{document} \begin{tikzpicture} \begin{scope} [rotate=30] \node [transform shape](scope6) at (0,0) {\includegraphics{example-image}}; \node at (0,0) [rotate=0,color=black] {Text}; \end{scope} \end{tikzpicture} ...


2

In general, this is a little bit tricky, as there so many things influencing the size, but for this case, where the ticklabels on the y-axis are the only thing causing problems, you could try adding 'extraAxisOptions','yticklabel style={text width= width("$-0.6$")},align=right}' the matlab2tikz calls, where $-0.6$ is the widest ticklabel. As a ...


1

Something like this: For this scope doesn't work. You can simply do the following: \documentclass[border=3mm, multi, tikz]{standalone} \usepackage{graphicx} \begin{document} \begin{tikzpicture} \node[rotate=30,draw=red,very thick] (scope6) {\includegraphics{example-image}}; \node ...


7

the problem is indeed the connection between Distance, Kind and Pixel. Since "forest" is really a tree, they cant be connect with forest and we have to use the draw command. Therefore we name some nodes. Decorate as you like. \documentclass[tikz,convert={size=640},multi]{standalone} \usepackage{tikz} \usepackage{forest} \usetikzlibrary{graphs,positioning} ...


5

If in your forest version includes grow=west inside for tree options, the result is: \documentclass[tikz,convert={size=640},multi]{standalone} \usetikzlibrary{graphs,positioning} \usepackage{forest} \forestset{ default preamble={ for tree={ grow=west, parent anchor=children, child anchor=east, anchor=east, draw } ...


0

If you do not have to compile this part every time, you could create a pdf file and include this via includegraphics ....just an idea...



Top 50 recent answers are included