New answers tagged

0

This doesn't really answer your question but I find it is a useful layout that one can easily maintain and manipulate. It also allows for some non-standard structure. I haven't worked out how to include file icons just yet. It also works best if you keep the tab control columns reasonably well aligned. \documentclass[crop=false]{standalone} \usepackage{...


0

Using the closed form solution for intersections: \documentclass[border=2pt]{standalone} \usepackage{mathtools} \usepackage{tikz} \begin{document} \begin{minipage}{4in} The circle is given by \begin{equation} x^2 + y^2 = r^2 \end{equation} and the line by \begin{equation} y = ax + b \end{equation} where \begin{equation} a = \frac{y_2-y_1}{x_2-x_1} \quad\...


6

You could use PGFPlots for this: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.13} \begin{document} \begin{tikzpicture} \begin{axis}[ view={110}{30}, xmin=1, xmax=3, ymin=1, ymax=3, zmin=1, zmax=3, axis equal image ] \addplot3 [fill=cyan, fill opacity=0.5] table { x y z 1 2 3 2 1 3 3 1 2 3 2 1 2 3 1 1 3 2 }--...


3

You could try with a pic. It's possible to define foreground code and background code which are drawn in front or behind the path. \documentclass[margin=10pt]{standalone} \usepackage{tikz} \usetikzlibrary{positioning, fadings, backgrounds} \tikzset{ pics/mypic/.style = { foreground code = {\node [red!20, font=\sffamily\bfseries]{...


3

You can use the decorations.markingslibrary, along with the preaction key, so that the decoration is added "before" the path is drawn. Basically this is like the second solution you posted, but all in one. This code provides a style with two arguments decred={ <pos> }{ <text> }. The colored node will be behind the line, the text in front of it. ...


4

Here is a proposition mixing Escher, Penrose and Picasso (do you see the birds?): The code (derived form my answer to Penrose tiling in TikZ): \documentclass[tikz]{standalone} \usepackage{tikz} \usetikzlibrary{calc} \pgfmathsetmacro{\invphi}{2/(1+sqrt(5))} % default styles \tikzset{ % borders style penrose line/.style={draw=black,line join=round}, ...


3

Here is a suggestion using intersection segments. It needs the pgfplots library fillbetween. \documentclass[border=2pt]{standalone} \usepackage{pgfplots} \usepgfplotslibrary{fillbetween} \begin{document} \begin{tikzpicture} \begin{axis}[xmax=9,ymax=9, samples=50,set layers] \addplot[name path=plot 1,blue, ultra thick] (x,x*x); \addplot[name path=plot 2,...


2

To scale your picture you can just use key scale for tikzpicture environment. To draw half unite circle rather then \draw [shift={(0.,0.)}] plot[domain=-1.5707963267948966:1.5707963267948966,variable=\t]({1.*1.*cos(\t r)+0.*1.*sin(\t r)},{0.*1.*cos(\t r)+1.*1.*sin(\t r)}); You can simply add \draw (0,-1) arc [start angle=-90, end angle=90, radius=...


6

Most of the code in qtree-tikz is TeX code, which one exception: pgfsubpic.sty uses \begin{...} .. \end{...}, which is easy to circumvent. Here is an example from the qtree-tikz manual: \usemodule[tikz] \unprotect \input pgfsubpic \input pgftree \input tikz-qtree \protect % Poor man's \begin{...} ... \end{...} \define[1]\begin{\bgroup\csname#1\endcsname \...


3

For comparison, here is a Metapost solution (I am showing ConTeXt code, but it will work with standalone metapost or LaTeX + gmp): \starttext \startMPpage[offset=2mm] z1 = (-2.5,sqrt(2)*(-sqrt(7)+sqrt(13))*(-2.5)-sqrt(13)+2*sqrt(7))*cm; z2 = (1/sqrt(2), sqrt(7))*cm; z3 = (1.25, -sqrt(2)*(sqrt(7)+sqrt(13))*(1.25)+sqrt(13)+2*sqrt(7))*cm; path p, q; ...


4

At ridiculous computational cost, you can calculate the points where the circle intersects with the lines and use a clipping together with the even odd filling rule to produce This uses the intersections library, a scoped \clip and the even odd rule to create an unholy combination. \documentclass[border=10pt,multi,tikz]{standalone} \usetikzlibrary{...


1

You have a wrong & in the first row. \documentclass{article} \usepackage{amsmath} \usepackage{tikz-cd} \begin{document} \[ \begin{tikzcd} & U_0 \ar[dl, swap, "\mathrm{f}_0"] \ar[dr, "\mathrm{f}'_0"] \\ U_1 \ar[d, "\mathrm{f}_1"] & & V_1 \ar[d, "\mathrm{f}'_1"] \\ \vdots \ar[d, "\mathrm{f}_{m-1}"] & & \vdots ...


0

The problem is you have an arrow in the first line which points to nowhere. It's solved adding a & {} at the place the arrow is supposed to point at. \documentclass{article} \usepackage{amsmath} \usepackage{tikz-cd} \begin{document} $\begin{tikzcd} & U_0 \ar[dl, "\operatorname{f}_0"] &{} \ar[dr, "\operatorname{f}'_0"] \\ U_1 \ar[d, "\...


0

Following @Steven_B._Segletes answer, I came up with the following simplified solution that answers to my question. \documentclass[varwidth,border=50]{standalone} \usepackage{tikz} \makeatletter \pgfkeys{% /pgf/invert/.initial=no,% /pgf/invert/.default=yes,% } \pgfdeclareshape{test}{% \inheritsavedanchors[from=circle]% \inheritanchorborder[from=...


1

Here is an approach that doesn't require any libraries (not that there's anything wrong with using libraries). \documentclass{article} \usepackage[english]{babel} \usepackage{tikz} \begin{document} \begin{tikzpicture}[ startstop/.style={rectangle, rounded corners, minimum width=3cm, minimum height=1cm,text centered, draw=black, fill=red!30}, startstop2/....


1

You may use the TikZ library calc, with the appropriate coordinates: \documentclass{article} \usepackage[english]{babel} \usepackage{tikz} \usetikzlibrary{calc} % TikZ library calc \begin{document} \begin{tikzpicture} \tikzstyle{startstop} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm,text centered, draw=black, fill=red!...


2

It is not clear which command you removed. If you removed \draw (0,0) .. controls (1,1) and (2,1) .. (2,0); that should be fine. I can't test any of this because you didn't provide a complete minimal example, but it should work fine. If you tried \draw (0,0) .. .. (2,0); or \draw (0,0) .. (2,0); then it will not work. It would be helpful if you ...


1

I'm adding a new answer because the MWE given by Jake is not working for me. \documentclass{article} \usepackage{pgfplots} %To create a .dat file (not required if you already have the file in the same folder) \begin{filecontents}{vector_field.dat} x y u v 0 0 1 0 1 1 1 1 2 4 1 4 3 9 1 6 4 16 1 8 \end{filecontents} \begin{document} ...


1

Two ways, depending on desired alignment. In the first case, I just left-align a \Longunderstack of the desired text following the \textsuperscript{*}. In the second case, I \llap the \textsuperscript{*}. \documentclass[twoside]{article} \usepackage{pgfplots,stackengine} \setstackEOL{\\} \usepackage{tikz} \begin{document} \begin{tikzpicture} \setstackgap{...


1

\hphantom doesn't start horizontal mode and indeed you get blank lines instead of the space you want. Instead of \hphantom, I recommend using tabular. \documentclass[twoside]{article} \usepackage{tikz} \begin{document} \noindent \begin{tikzpicture} \draw (0,0) node[ outer sep=-1pt, inner sep=0pt, below right, text width=\textwidth ]{\begin{tabular}...


4

Using Jake's answer to How to draw bar chart using tikz? as a starting point, and adding a bit from Robert's answer to get the number at the end of the bars, and with a few modifications here and there. Also added an example of typesetting the table based on the same \pgfplotstable. The values are calculated based on the table you showed and the ...


2

Try that: \usepackage{tikz,pgfplots,pgfplotstable} \begin{document} \pgfplotstableread{ % data Label Adequacy Sustainability Integrity Austria 21.87797 5.566584 24.85545 Brazil 20.93009 7.937881 24.33203 Chile 20.41148 21.126529 27.56199 Australia 26.83072 23.823827 28.94545 }\testdata \begin{tikzpicture} \begin{axis}[ ...


5

Code is not very simple, however, it is (to my opinion) well structered with description what is task of each its part. \documentclass[tikz, border=3mm]{standalone} \usetikzlibrary{arrows.meta, calc, chains, quotes, positioning} \usepackage{amssymb} \begin{document} \begin{tikzpicture}[ > = Stealth, node distance = 10mm and 13mm, ...


3

I used percusse's trick in the answer at How to save the current color in PGF/TikZ?. Note also that the OP wrongly reversed the sense of \makeatletter and \makeatother which would never allow a solution, until corrected. \documentclass[varwidth,border=50]{standalone} \usepackage{tikz} \makeatletter \tikzset{% get stroke color/.code={% \expandafter\...


2

For beginners, Tikz's undoubtedly complicated, therefore I suggest using a WYSISYG editors, for example: GeoGebra/TikzEdt (if you don't have much time). GeoGebra: https://www.sharelatex.com/blog/2013/08/28/tikz-series-pt2.html TikzEdt: http://www.tikzedt.org/ But, please consider learning to write Tikz code (as the quality of generated Tikz code from ...


2

First of all set compat: \pgfplotsset{compat=1.13} Current version is 1.13. AFAIK you have to use at least version 1.11, if you want to use xbar stacked together with nodes near coords. Use ytick={0,...,5} instead ytick=data or maybe better use all y coordinates for the first plot: \addplot[findOptimalPartition,fill] coordinates {(400,0) (0,1) (0,2) (...


1

This is not an answer to OP question, but an example for my comment. As I don't know how to solve Gus' question, an alternative could be to define two different kind of nodes/shapes, one defined with "normal" colors and a second one with "inverted" colors. This way it's not necessary to discover what colors were used. Instead of a new shape I've used a ...


4

I don't understand all the desiderata. I also don't know if an alternative approach is an option. But, for whatever it is worth, here's a forest solution. This satisfies the first 3 desiderata, in addition to applying the defined styles correctly. Whether it satisfies the fourth of the desiderata I cannot say. Since I don't understand that one, if it ...


3

I would suggest doing your preparation with TikZ, as Przemysław Scherwentke comments, it's much easier if you want to edit your diagrams - and it would be foolhardy to assume this will never be necessary. Yet at the same time it's likely - and I think the best way to confirm is to contact the relevant journal itself - that the journal will want a separate ...


4

Image actually present tree (as it also stated with selected tags of question), but was drawn as general graph. Wit use of tree way of drawing, code become very simple and concise: \documentclass[tikz, border=3mm]{standalone} \usetikzlibrary{arrows, quotes, %trees } \usepackage[latin1]{inputenc} \begin{document} \begin{tikzpicture}[ ...


1

A simple solution I used when I needed to underbrace text was simple to use math mode wrapped inside a new command: \newcommand{\undertext}[2] {$\underbrace{\textrm{#1}}_{\textrm{#2}}$} Then you just \undertext{any text}{like this}


2

Don't know if this is a solution to your question. \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw[thick] (0cm,0cm) circle(1cm); \foreach \x in {15,60} { % lines from center to point \draw[black,->] (0cm,0cm) -- (\x:1cm); % dots at each point \...


2

Based on pure guessing ... \documentclass[tikz,border=3mm]{standalone} \usetikzlibrary{arrows,angles,quotes} \begin{document} \begin{tikzpicture}[ angle radius = 7mm, my angle/.style = {draw, angle eccentricity=1.2, font=\footnotesize, <->}, % angle label position! Arrow/.style= {ultra ...


1

I don't know how to achieve that using pgfplot, but with simple tikz you could adapt this (using a foreach loop): \documentclass{article} \usepackage{xcolor} \usepackage{tikz} \definecolor{findOptimalPartition}{HTML}{D7191C} \definecolor{storeClusterComponent}{HTML}{FDAE61} \definecolor{dbscan}{HTML}{ABDDA4} \definecolor{constructCluster}{HTML}{2B83BA} \...


3

A simple solution is use baseline=25mm option: \documentclass[12pt]{article} \usepackage{tikz} \usetikzlibrary{calc,shapes} \usepackage{mathrsfs} \begin{document} \begin{center} \begin{tikzpicture}[baseline=25mm] \coordinate (a0) at (0,0); \coordinate (a1) at (5,5); \coordinate[label=left:$g$] (a2) at (2.5,3.5); \fill (a2) ...


3

How about a path picture? \documentclass[tikz,border=5]{standalone} \tikzset{split fill/.style args={#1 and #2}{path picture={ \fill [#1] (path picture bounding box.south west) rectangle (path picture bounding box.north); \fill [#2] (path picture bounding box.south) rectangle (path picture bounding box.north east); }}} \begin{document} \...


2

A PSTricks solution: \documentclass{article} \usepackage{pstricks} \psset{ dimen = m, fillstyle = solid } % parameter \def\radius{2} \begin{document} \begin{pspicture}(-\radius,-\radius)(\radius,\radius) \pswedge[fillcolor = blue!60]{\radius}{90}{270} \pswedge[fillcolor = red]{\radius}{270}{90} \end{pspicture} \end{document} All you have to ...


1

I finish only left image, the second you can finish on similar way: \documentclass{article} \usepackage{tikz} \usetikzlibrary{backgrounds, scopes} \usepackage[showframe]{geometry} \begin{document} \begin{center}% \begin{tikzpicture}[scale=0.8, thick, L/.style args = {#1/#2}{% L: line line width=#1, draw = #2 %color }, L/....


1

There are many possibilities to realize this. I implemented a center coordinate, which is a bit more flexible. Explanations as comments: \begin{tikzpicture} % Circle's center \coordinate (center) at (2,2); % Create a blue filled arc, starting 2 above the center, % with a start angle of 90°, an end angle of 270° and a radius of 2 \fill[...


0

Ah, the original CV. And license also still there. Very good. Since you don't want to change the height of that box, you have to either make the fontsize smaller, or just reduce the line spacing a bit. I decided to do the last one. Add the following into your preamble. \newcommand{\manylines}[1]{% \begin{tabular}[t]{@{}c@{}}#1\end{tabular}% this is ...


5

All questions (very nearly almost) should include a Minimum Working Example i.e. code for a small document setting up the problem. If you need to get started with TikZ, try the tutorials in the first part of the TikZ manual. \documentclass[border=10pt,multi,tikz]{standalone} \begin{document} \begin{tikzpicture} \fill [red] (0,0) coordinate (a) arc (90:...


2

When setting xmin=0, xmax=1 in your example, I get a dimension too large error. This happens because the point 1000,50 is still processed, even though it lies outside the visible axis domain, and causes an overflow error. To fix this, set restrict x to domain=0:1. That key specifies that points with x coordinates outside the specified range are filtered out ...


0

To plot coordinates from a file use \addplot table [<column selection>]{<file name>}; If the optional argument for table is missing, the first column (with index 0) is used as x values and the second column (with index 1) is used as y-values. To plot f(x) with your file \begin{tikzpicture} \begin{axis} \addplot table {heat.txt}; \end{axis} \...


2

Try this: \documentclass{beamer} \usepackage{pgfplots} \pgfplotsset{compat=1.13} \begin{document} \begin{frame} \begin{columns}[onlytextwidth] \begin{column}{.6\textwidth} \begin{block}<1->{One} text text text text text text text text text text text \end{block} \begin{block}<2->{Two} text \end{block} \...


1

... I change the mind ... after while I compared my solution (hich is based on of Ignasi first solution) again to Ignasi solution, I estimated that differences are small but not negligible. So, here is my solution: \documentclass{article} \usepackage{tabularx} \newcolumntype{C}{>{\centering\arraybackslash}X} \usepackage{tikz} \usetikzlibrary{arrows....


3

Three different suggestions. i) shortening arrows, ii) changing endpoint, iii) curved arrows. \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture}[ scale=\linewidth/10cm, myArrow/.style={thick,->,shorten >=10pt}] % Help Lines \draw[step=1,help lines,black!20] (-4.95,-2.95) grid (4.95,3.95); % Ellipse \draw[thick] (-...


2

This is easy with a simple calculation. To perform it, we need the calc library, and we'll also make use of the anchor system to decide where the arrow ends. Your arrows are ordered and all go to the same node, therefore we can simplify that with a \foreach first, then use it to calculate end coordinates. If you don't understand something, feel free to ...


2

There are several reasons for using pgfplots rather than tikz, here are some that I could think of right now: Automatic scaling: pgfplots will scale things so that the plot doesn't become very large. Try plotting exp(x) for example, instead of sin(x). Automatic ticklabels and axis lines. This doesn't apply for your example of course, but often you want to ...


2

As Zarko suggested you should read rectangle split information (pages 726--728) and positioning library information. From first you will learn that minimum width is valid for vertically splitted rectangles but minimum height is ignored. Then all these options in each nodepart can be suppressed. Rectangle split width will be fixed by maximum of inner part ...


3

You can use in the third one \draw[line width=1mm,blue] (A) to[out=90,in=300,out looseness=1.3] (C); and in the last one \coordinate (aux) at (.5,2.4); \draw[line width=1mm,smooth,blue] (A) to[out=90,in=270] (aux) to[out=90,in=270] (C); To get the end of the last line to be straight, you can do \coordinate (aux) at (.5,2); \draw[line width=1mm,...



Top 50 recent answers are included