• Drawing 3D atomic orbitals in LaTeX [closed]
    by sstac on November 4, 2026 at 12:54 pm

    I am trying to recreate a few graphics found on a paper: https://www.researchgate.net/publication/376028984_Visualizing_atomic_orbitals_of_an_electron_by_Latex The images I want to recreate: The author supposedly wanted to share the source code, but the link in abstract is (at least for me) not working and I wasn't able to reach out to the author, so I decided to try to recreate the graphics myself. Unfortunaley I don't have much experience in drawing in latex/tikz/pgfplots (I did some 3d graphics in tikz-3dplot tho, but that was some time ago) so I am interested if someone can guess or say how were such graphics created? Thanks in advance! Best, Stipe Edit: Narrowed the question, removed the whole bunch of images.

  • Is it possible to change the color of lines in a TikZ pattern?
    by sgmoye on October 30, 2026 at 12:06 pm

    I cannot seem to change the color of the lines in the following, they are always black (based on page 735 of the TikZ documentation, version 3.1.12). The documentation (page 180) says "This option is used to set the color to be used for form-only patterns. This option has no effect on inherently colored patterns" but I'm not entirely sure what that means. Are lines "inherently colored" or "form-only"? The documentation (uses on page 735) seems to imply that the color can be altered. \documentclass[tikz,border=1pt]{standalone} \usetikzlibrary{calc,patterns,patterns.meta} \begin{document} \begin{tikzpicture} \draw[fill=red!20](0,0) rectangle (1,1); \draw[pattern={Lines[angle=-45,yshift=2pt]},pattern color=cyan](0,0) rectangle +(1,1); \end{tikzpicture} \end{document} List of files article.cls 2025/01/22 v1.4n Standard LaTeX document class size10.clo 2025/01/22 v1.4n Standard LaTeX file (size option) tikz.sty 2026-08-01 v3.1.12 (3.1.12) pgf.sty 2026-08-01 v3.1.12 (3.1.12) pgfrcs.sty 2026-08-01 v3.1.12 (3.1.12) pgfutil-common.tex pgfutil-latex.def pgfrcs.code.tex pgf.revision.tex pgfcore.sty 2026-08-01 v3.1.12 (3.1.12) graphicx.sty 2026-05-17 v1.2e Enhanced LaTeX Graphics (DPC,SPQR) keyval.sty 2026-05-17 v1.15 key=value parser (DPC) graphics.sty 2026-05-17 v1.4h Standard LaTeX Graphics (DPC,SPQR) trig.sty 2023/12/02 v1.11 sin cos tan (DPC) graphics.cfg 2016/06/04 v1.11 sample graphics configuration xetex.def 2025/11/01 v5.0p Graphics/color driver for xetex pgfsys.sty 2026-08-01 v3.1.12 (3.1.12) pgfsys.code.tex pgfkeys.code.tex pgfkeyslibraryfiltered.code.tex pgf.cfg 2026-08-01 v3.1.12 (3.1.12) pgfsys-xetex.def 2026-08-01 v3.1.12 (3.1.12) pgfsys-dvipdfmx.def 2026-08-01 v3.1.12 (3.1.12) pgfsys-common-pdf.def 2026-08-01 v3.1.12 (3.1.12) pgfsyssoftpath.code.tex 2026-08-01 v3.1.12 (3.1.12) pgfsysprotocol.code.tex 2026-08-01 v3.1.12 (3.1.12) xcolor.sty 2024/09/29 v3.02 LaTeX color extensions (UK) color.cfg 2016/01/02 v1.6 sample color configuration mathcolor.ltx pgfcore.code.tex pgfmath.code.tex pgfmathutil.code.tex pgfmathparser.code.tex pgfmathfunctions.code.tex pgfmathfunctions.basic.code.tex pgfmathfunctions.trigonometric.code.tex pgfmathfunctions.random.code.tex pgfmathfunctions.comparison.code.tex pgfmathfunctions.base.code.tex pgfmathfunctions.round.code.tex pgfmathfunctions.misc.code.tex pgfmathfunctions.integerarithmetics.code.tex pgfmathcalc.code.tex pgfmathfloat.code.tex pgfint.code.tex pgfcorepoints.code.tex 2026-08-01 v3.1.12 (3.1.12) pgfcorepathconstruct.code.tex 2026-08-01 v3.1.12 (3.1.12) pgfcorepathusage.code.tex 2026-08-01 v3.1.12 (3.1.12) pgfcorescopes.code.tex 2026-08-01 v3.1.12 (3.1.12) pgfcoregraphicstate.code.tex 2026-08-01 v3.1.12 (3.1.12) pgfcoretransformations.code.tex 2026-08-01 v3.1.12 (3.1.12) pgfcorequick.code.tex 2026-08-01 v3.1.12 (3.1.12) pgfcoreobjects.code.tex 2026-08-01 v3.1.12 (3.1.12) pgfcorepathprocessing.code.tex 2026-08-01 v3.1.12 (3.1.12) pgfcorearrows.code.tex 2026-08-01 v3.1.12 (3.1.12) pgfcoreshade.code.tex 2026-08-01 v3.1.12 (3.1.12) pgfcoreimage.code.tex 2026-08-01 v3.1.12 (3.1.12) pgfcoreexternal.code.tex 2026-08-01 v3.1.12 (3.1.12) pgfcorelayers.code.tex 2026-08-01 v3.1.12 (3.1.12) pgfcoretransparency.code.tex 2026-08-01 v3.1.12 (3.1.12) pgfcorepatterns.code.tex 2026-08-01 v3.1.12 (3.1.12) pgfcorerdf.code.tex 2026-08-01 v3.1.12 (3.1.12) pgfmoduleshapes.code.tex 2026-08-01 v3.1.12 (3.1.12) pgfmoduleplot.code.tex 2026-08-01 v3.1.12 (3.1.12) pgfcomp-version-0-65.sty 2026-08-01 v3.1.12 (3.1.12) pgfcomp-version-1-18.sty 2026-08-01 v3.1.12 (3.1.12) pgffor.sty 2026-08-01 v3.1.12 (3.1.12) pgfkeys.sty pgfkeys.code.tex pgfmath.sty pgfmath.code.tex pgffor.code.tex tikz.code.tex pgflibraryplothandlers.code.tex 2026-08-01 v3.1.12 (3.1.12) pgfmodulematrix.code.tex 2026-08-01 v3.1.12 (3.1.12) tikzlibrarytopaths.code.tex 2026-08-01 v3.1.12 (3.1.12) tikzlibrarypatterns.meta.code.tex pgflibrarypatterns.meta.code.tex l3backend-xetex.def 2026-09-09 L3 backend support: XeTeX

  • Interaction between ltproperties, the hook system and the package pgf
    by jlab on October 26, 2026 at 9:44 am

    The other day, I tried to answer a question with the requirements that: some packages are loaded through the hook \AtBeginDocument; some data are saved through the hook \AtEndDocument, to be retrieved at the next run. I finally used an auxiliary file to store the data, but initially I tried to use the new LaTeX properties mechanism documented in ltproperties-doc.pdf. I came across a strange interaction between ltproperties the LaTeX hook system and the pgf package. If I compile \documentclass{article} \NewProperty{test}{now}{}{test} \AtEndDocument{ \RecordProperties{here}{test} } \AtBeginDocument{ \usepackage{lipsum} % \usepackage{pgf} } \begin{document} aaa \RefProperty{here}{test} bbb \end{document} the property is correctly read and the output file contains But, if I uncomment the line \usepackage{pgf} and load the pgf package \AtBeginDocument, the property is lost. The problem doesn't occur with the lipsum package, nor if \usepackage{pgf} is moved outside \AtBeginDocument. Any idea?

  • Triangle Nesting ( Similar to Sierpinski Triangles ) [duplicate]
    by Discrete on August 15, 2026 at 7:09 pm

    Im curious to know if there is a more efficient way to have triangles repeat themselves in one another without needing to run the \draw command for each line of the triangle; similar to Sierpinski's triangles is essentially what it is but in a different way for nesting. So far i've been doing the \draw command as such \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} [scale = 3] \draw[thick] (0,0) -- (2,0) -- (1,1.73205) -- cycle; \draw[thick] (0,0) -- (1,0.8) (2,0) -- (1,0.8) -- (1,1.73205) -- (1,0.8); \draw[thick] (1,0.8) -- (1.566667,0.769); \end{tikzpicture} \end{document} Ive provided an example above of what it should look like however I need to define what the colors mean and some rules it has. Meaning of Colors: Black = 1st Generation triangles, Blue = 2nd Generation triangles, and Red = 3rd Generation triangles as well each generation has a specific intersection where all the points meet ( for example black has a intersection in the middle where all points meet ) I should also say that each generation has its own "sub section" where the rule above applies to each sub section and these sub sections are divided by the lines of the previous generation. ( for example a 3rd generation sub section can have a different intersection than another 3rd generation sub section this is so each has one intersection which will for the sake of simplicity be set in the center for all generations) if you have any questions on this to better help me feel free to ask and I apologize if some of it seems confusing it is a rather "niche" section of discrete geometry relating to triangles and other two dimensional shapes ( side note i'd like this concept to be done with other two dimensional shapes as well so if theres a way to set the starting shape to say a circle or another shape that would be amazing; and it would follow the same rules I have revealed here).

  • I want a command which can take two arbitrary ellipses, and shade the region between them, bounded by their mutual tangents
    by Jasper on November 2, 2025 at 9:31 pm

    I want a command which can take two arbitrary ellipses, and shade the region between them, bounded by their mutual tangents. \documentclass[tikz,border=1cm]{standalone} \begin{document} \begin{tikzpicture} \fill (-5,0) ellipse[x radius = 1, y radius = pi]; \fill ({sqrt(2)},e) ellipse[x radius = {sqrt(pi)}, y radius = {sqrt(e^sqrt(pi))}]; \end{tikzpicture} \end{document}

  • Surface plots using Tikz
    by skm on December 27, 2024 at 11:09 am

    I want to show surface approximation plots, in which I have two variables called calculated and approximated. I need to show two 3D surface plots corresponding to these two variables, whose values are stored in .dat file. I want to have plot as shown in this SO answer. I am able to compile and run the code provided in the answer. However, when I try to make some dummy modifications i.e. adding another hard-coded plot, the code is not running. My non-running Code: \documentclass[border=1cm]{standalone} \usepackage{amsmath} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \pgfplotsset{colormap={violet}{rgb255=(25,25,122) rgb255=(238,140,238) color=(white)}} \begin{document} \begin{tikzpicture}[ declare function={ f(\x,\y)=-exp(-(\x^2+\y^2)/1.3; }] \begin{axis}[ view={30}{20}, mesh/interior colormap name=violet, colormap/viridis, hide axis, xmin=-2, xmax=2, ymin=-2, ymax=2, zmin=-2.5, zmax=0, ] \addplot3[ surf, samples=4, % Reduced number of samples for demonstration domain=-2:2, domain y=-2:2, point meta=explicit, ] table { x y z -2 -2 -2 -1 -2 -1.5 0 -2 -1 1 -2 -0.3 2 -2 0.2 -2 -1 -1.5 -1 -1 -0.8 0 -1 -0.3 1 -1 0.2 2 -1 0.7 -2 0 -1 -1 0 0.1 0 0 0.7 1 0 1.2 2 0 1.5 -2 1 0.2 -1 1 0.6 0 1 1 1 1 1.3 2 1 1.5 -2 2 0.8 -1 2 1 0 2 1.3 1 2 1.5 2 2 1.8 }; \end{axis} \end{tikzpicture} \end{document} How to get a figure like below (Plus added plot using hard-coded or file-loaded values)?

  • How to improve the achievement of gradient color path?
    by Explorer on November 16, 2024 at 2:13 pm

    What I want to replicate is the following gradient elliptic paths: I follow the solution from here and here to achieve the gradient colorm of path(to achieve pattern "darkcolor"-"lightcolor"-"darkcolor"), with the following code: \documentclass[tikz,border=8pt]{standalone} % https://tex.stackexchange.com/a/702274 % https://tex.stackexchange.com/q/141378 \usetikzlibrary{shadings,decorations.markings} \colorlet{lightmagenta}{magenta!50} \colorlet{lightcyan}{cyan!50} \tikzset{ multicolor/.style n args={2}{ decorate, decoration={ markings, mark=between positions 0 and \pgfdecoratedpathlength step 1pt with { \csname pgf@relevantforpicturesizetrue\endcsname \pgfmathparse{round(100-abs(200*(\pgfkeysvalueof{/pgf/decoration/mark info/distance from start}/\pgfdecoratedpathlength)-100))} \pgfsetstrokecolor{#2!\pgfmathresult!#1} \pgfsetlinewidth{\pgflinewidth} \pgfsetroundcap \pgfpathmoveto{\pgfpointorigin} \ifdim\dimexpr\pgfkeysvalueof{/pgf/decoration/mark info/distance from start}+1pt\relax>\pgfdecoratedpathlength \pgfpathlineto{\pgfpointorigin} \else \pgfpathlineto{\pgfpoint{1pt}{0pt}} \fi \pgfusepath{stroke} } } } } \begin{document} \begin{tikzpicture} \foreach \x[evaluate=\x as \y using int(\x*2)] in {22.5,45,...,360} {% \path[ line width=1pt, multicolor={magenta}{lightmagenta}, overlay,rotate around={\x:(\x:2cm)} ] (\x:2cm) ellipse (2.4cm and 1.2cm); \path[ line width=1pt, multicolor={cyan}{lightcyan}, overlay,rotate around={\y:(\y:1cm) }] (\y:1cm) ellipse (2.5cm and 2.2cm); } \end{tikzpicture} \end{document} It gives the following result: However, in the origiaal ideal image, the path was not with the same line width. Any better suggestions to replicate the ideal result?

  • Tikz library: what prevents this code from working? Unable to call the sin() function
    by Adam Daniels on February 7, 2024 at 5:10 am

    I've tried to call a mathematical function in the x-coordinate part of an (x,y) coordinate, to no avail. Strangely it works for the y-coordinate. Something must be wrong with the syntax but I can't figure it out. This code demonstrates the problem: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw (0,0) to [out=30,in=-120] (.5,{cos(60)}); % WORKS \draw (0,0) to [out=30,in=-120] ({.5},{cos(60)}); % WORKS \draw (0,0) to [out=30,in=-120] ({sin(30)},.5); % ATTEMPT 1: DOES NOT WORK \draw (0,0) to [out=30,in=-120] (sin(30),.5); % ATTEMPT 2: DOES NOT WORK \draw (0,0) to [out=30,in=-120] ({sin(30)},{.5}); % ATTEMPT 3: DOES NOT WORK \draw (0,0) to [out=30,in=-120] ({sin(30),.5}); % ATTEMPT 4: DOES NOT WORK \draw (0,0) to [out=30,in=-120] {(sin(30),.5)}; % ATTEMPT 5: DOES NOT WORK \draw (0,0) to [out=30,in=-120] ({{sin(30)},.5}); % ATTEMPT 6: DOES NOT WORK \draw (0,0) to [out=30,in=-120] {({sin(30)},.5)}; % ATTEMPT 7: DOES NOT WORK \end{tikzpicture} \end{document} Your help is greatly appreciated. Best regards,

  • How to Create an Interactive Diagram with TikZ
    by psygo on February 3, 2024 at 3:57 pm

    I'm trying to create an interactive diagram, much like the one used in the EPUBs sold by Go Books: What I mean by "interactive" is that the user controls when things are triggered. For example, animations are not what I would call interactivity because they happen regardless of what the user does. (Of course, in-between each move, we could have an animation.) I quite frankly don't know if that's even possible with TikZ. Is it? Maybe there's a way of injecting HTML and JS into TikZ? Here's a minimal example of a Go board with 3 moves, the idea would be to have TikZ add some sort of UI for going back and forth, and then showing each move accordingly — no need for the play button —: \documentclass{article} \usepackage{tikz} \newlength{\step} \begin{document} \begin{tikzpicture} \setlength{\step}{\dimexpr 10cm / 18 \relax} \draw[step=\step] (0, 0) grid (10, 10); \draw[draw = white, fill = black, line width = 0.1mm] (2 * 10cm / 18, 3 * 10cm / 18) circle [radius = 0.2575cm] node[color = white] {1}; \draw[draw = black, fill = white, line width = 0.1mm] (3 * 10cm / 18, 3 * 10cm / 18) circle [radius = 0.2575cm] node[color = black] {2}; \draw[draw = white, fill = black, line width = 0.1mm] (4 * 10cm / 18, 3 * 10cm / 18) circle [radius = 0.2575cm] node[color = white] {3}; \end{tikzpicture} \end{document}

  • Add angles in TikZ-3d
    by Echelle-courte on April 13, 2023 at 2:26 am

    I've done this figure in TikZ, but I don't know how to add and label the angles in TikZ-3D, how can I do it? Here's the original figure : Here's mine plus the code : \documentclass[tikz]{standalone} \usepackage{tikz} \usepackage{tikz-3dplot} \begin{document} \tdplotsetmaincoords{60}{-30} \begin{tikzpicture}[tdplot_main_coords, >=stealth, scale=2.5] \draw[->, thick] (0,0,0)--(0,0,3) node[left] {$\vec{z}_{n-1}$}; \draw[->, thick] (0,0,0)--(3,0,0) node[below] {$\vec{x}_{n-1}$}; \draw[dashed] (0,0,0)--(0,0.53,0.47); \draw[dashed] (1.75,0,0)--(1.75,0,1); \draw[->, thick] (1.75,0,0)--(1.75,2,1.75) node[left] {$\vec{z}_{n}$}; \draw[dashed] (1.75,0.97,0.85)--(3,0.97,0.85); \draw[->, thick] (1.75,0.97,0.85)--(3,0.97,1.5) node[below] {$\vec{x}_n$}; \draw[<->, thick] (0,0.32,0.25)--(1.75,0.32,0.25) node[above, midway] {$d_n$}; \draw[<->, thick] (2.75,0,0)--(2.75,0.97,0.85) node[right, midway] {$r_n$}; \end{tikzpicture} \end{document}

  • TikZ - 3D surface plot
    by sobat on January 25, 2022 at 4:33 pm

    I want to draw something like this: For the moment I just managed to draw a 3D plate and I don't know how to do it with the 3D sinus curves. I managed to draw something like that, but I don't know how to do for have 2 color in the curve and the same shape. It's not that good !! \documentclass {standalone} \usepackage{pgfplots} \pgfplotsset{compat = newest} \begin{document} \begin{tikzpicture} \begin{axis}[hide axis] \addplot3 [ domain=-2:2, domain y = -2:2, samples = 40, samples y = 40, surf, fill=pink, faceted color = teal] {-exp(-(x^2+y^2)/1.3}; \end{axis} \end{tikzpicture} \end{document} Could you help me?!

  • How to draw an icosahedron with triangulated faces
    by InsideOut on January 21, 2022 at 3:58 pm

    I would like to draw something like this by using TikZ. Here I have found several answers on how to draw such a Platonic solid but no one has the faces divided like this. I do not really care about colours. What really matters to me is to draw such icosahedron as an origami like the picture below. Here I've found a way fro drawing an icosahedron but without subdivision of the faces. How can I do? Thanks!

  • zoombox array with adjustable width ratio
    by Alessandro Cuttin on February 17, 2021 at 9:21 pm

    I've become an avid user of the zoomboxarray library created by Jake. Soon, one becomes aware that a fixed ratio (1:1) between the width of the subcaptionboxes containing the full image and the \zoomboxes is set. While this is convenient most of the times, it may happen that the \zoomboxes are just too big (for example: only one column of zoomboxes with a wide image). Reducing the width of the \zoomboxes in favor of a wider image can improve the end result. So, the ratio of the widths of the subcaptionboxes changes to -for example- 2:1. I'd like to be able to set such ratio. In a first attempt, I tried to hardcode a 2:1 ratio adapting Jake's code. The width of the \zoomboxes can be changed by dividing the \imagewidth by 2 inside the definition of the zoomboxarray style: width=(\imagewidth / 2) / \pgfkeysvalueof{/tikz/zoomboxarray columns} - (\pgfkeysvalueof{/tikz/zoomboxarray columns} - 1) / \pgfkeysvalueof{/tikz/zoomboxarray columns} * \pgfkeysvalueof{/tikz/zoomboxarray inner gap} -\pgflinewidth, The horizontal shift between \zoomboxes also needs to be adjusted: \pgfmathsetmacro\xpos{ (\columncount-1)*((\imagewidth / 2) / \pgfkeysvalueof{/tikz/zoomboxarray columns} + \pgfkeysvalueof{/tikz/zoomboxarray inner gap} / \pgfkeysvalueof{/tikz/zoomboxarray columns} ) + \pgflinewidth } Though, I still haven't found a way to effectively reduce the width of the zoomboxes container and of the related subcaptionbox. The width of the \phantomimage is certainly the key, but in a way that is obscure to me. Here's the full code of an MWE (the image is downloaded from the original question), where it can be seen (with the use of the \fbox{}) that the zoomboxes node is still too large. \documentclass{article} \usepackage{graphicx} \usepackage{caption} \usepackage{subcaption} \usepackage{tikz} \usepackage{pgfplots} \usetikzlibrary{spy,calc} \usepackage{hyperref} \newif\ifblackandwhitecycle \gdef\patternnumber{0} \pgfkeys{/tikz/.cd, zoombox paths/.style={ draw=orange, very thick }, black and white/.is choice, black and white/.default=static, black and white/static/.style={ draw=white, zoombox paths/.append style={ draw=white, postaction={ draw=black, loosely dashed } } }, black and white/static/.code={ \gdef\patternnumber{1} }, black and white/cycle/.code={ \blackandwhitecycletrue \gdef\patternnumber{1} }, black and white pattern/.is choice, black and white pattern/0/.style={}, black and white pattern/1/.style={ draw=white, postaction={ draw=black, dash pattern=on 2pt off 2pt } }, black and white pattern/2/.style={ draw=white, postaction={ draw=black, dash pattern=on 4pt off 4pt } }, black and white pattern/3/.style={ draw=white, postaction={ draw=black, dash pattern=on 4pt off 4pt on 1pt off 4pt } }, black and white pattern/4/.style={ draw=white, postaction={ draw=black, dash pattern=on 4pt off 2pt on 2 pt off 2pt on 2 pt off 2pt } }, zoomboxarray inner gap/.initial=5pt, zoomboxarray columns/.initial=2, zoomboxarray rows/.initial=2, subfigurename/.initial={}, figurename/.initial={zoombox}, zoomboxarray/.style={ execute at begin picture={ \begin{scope}[ spy using outlines={% zoombox paths, width= (\imagewidth / 2) / \pgfkeysvalueof{/tikz/zoomboxarray columns} - (\pgfkeysvalueof{/tikz/zoomboxarray columns} - 1) / \pgfkeysvalueof{/tikz/zoomboxarray columns} * \pgfkeysvalueof{/tikz/zoomboxarray inner gap} -\pgflinewidth, height=\imageheight / \pgfkeysvalueof{/tikz/zoomboxarray rows} - (\pgfkeysvalueof{/tikz/zoomboxarray rows} - 1) / \pgfkeysvalueof{/tikz/zoomboxarray rows} * \pgfkeysvalueof{/tikz/zoomboxarray inner gap}-\pgflinewidth, magnification=3, every spy on node/.style={ zoombox paths }, every spy in node/.style={ zoombox paths } } ] }, execute at end picture={ \end{scope} \node at (image.north) [anchor=north,inner sep=0pt] {\subcaptionbox{\label{\pgfkeysvalueof{/tikz/figurename}-image}}{\phantomimage}}; \node at (zoomboxes container.north) [anchor=north,inner sep=0pt] {\subcaptionbox{\label{\pgfkeysvalueof{/tikz/figurename}-zoom}}{\phantomimage}}; \gdef\patternnumber{0} }, spymargin/.initial=0.5em, zoomboxes xshift/.initial=1, zoomboxes right/.code=\pgfkeys{/tikz/zoomboxes xshift=1}, zoomboxes left/.code=\pgfkeys{/tikz/zoomboxes xshift=-1}, zoomboxes yshift/.initial=0, zoomboxes above/.code={ \pgfkeys{/tikz/zoomboxes yshift=1}, \pgfkeys{/tikz/zoomboxes xshift=0} }, zoomboxes below/.code={ \pgfkeys{/tikz/zoomboxes yshift=-1}, \pgfkeys{/tikz/zoomboxes xshift=0} }, caption margin/.initial=4ex, }, adjust caption spacing/.code={}, image container/.style={ inner sep=0pt, at=(image.north), anchor=north, adjust caption spacing }, zoomboxes container/.style={ inner sep=0pt, at=(image.north), anchor=north, name=zoomboxes container, xshift=\pgfkeysvalueof{/tikz/zoomboxes xshift}*(\imagewidth+\pgfkeysvalueof{/tikz/spymargin}), yshift=\pgfkeysvalueof{/tikz/zoomboxes yshift}*(\imageheight+\pgfkeysvalueof{/tikz/spymargin}+\pgfkeysvalueof{/tikz/caption margin}), adjust caption spacing }, calculate dimensions/.code={ \pgfpointdiff{\pgfpointanchor{image}{south west} }{\pgfpointanchor{image}{north east} } \pgfgetlastxy{\imagewidth}{\imageheight} \global\let\imagewidth=\imagewidth \global\let\imageheight=\imageheight \gdef\columncount{1} \gdef\rowcount{1} \gdef\zoomboxcount{1} }, image node/.style={ inner sep=0pt, name=image, anchor=south west, append after command={ [calculate dimensions] node [image container,subfigurename=\pgfkeysvalueof{/tikz/figurename}-image] {\phantomimage} node [zoomboxes container,subfigurename=\pgfkeysvalueof{/tikz/figurename}-zoom] {\phantomimage} } }, color code/.style={ zoombox paths/.append style={draw=#1} }, connect zoomboxes/.style={ spy connection path={\draw[draw=none,zoombox paths] (tikzspyonnode) -- (tikzspyinnode);} }, help grid code/.code={ \begin{scope}[ x={(image.south east)}, y={(image.north west)}, font=\footnotesize, help lines, overlay ] \foreach \x in {0,1,...,9} { \draw(\x/10,0) -- (\x/10,1); \node [anchor=north] at (\x/10,0) {0.\x}; } \foreach \y in {0,1,...,9} { \draw(0,\y/10) -- (1,\y/10); \node [anchor=east] at (0,\y/10) {0.\y}; } \end{scope} }, help grid/.style={ append after command={ [help grid code] } }, } \newcommand\phantomimage{% \phantom{% \rule{\imagewidth}{\imageheight}% }% } \newcommand\zoombox[2][]{ \begin{scope}[zoombox paths] \pgfmathsetmacro\xpos{ (\columncount-1)*((\imagewidth / 2) / \pgfkeysvalueof{/tikz/zoomboxarray columns} + \pgfkeysvalueof{/tikz/zoomboxarray inner gap} / \pgfkeysvalueof{/tikz/zoomboxarray columns} ) + \pgflinewidth } \pgfmathsetmacro\ypos{ (\rowcount-1)*( \imageheight / \pgfkeysvalueof{/tikz/zoomboxarray rows} + \pgfkeysvalueof{/tikz/zoomboxarray inner gap} / \pgfkeysvalueof{/tikz/zoomboxarray rows} ) + 0.5*\pgflinewidth } \edef\dospy{\noexpand\spy [ #1, zoombox paths/.append style={ black and white pattern=\patternnumber }, every spy on node/.append style={#1}, x=\imagewidth, y=\imageheight ] on (#2) in node [anchor=north west] at ($(zoomboxes container.north west)+(\xpos pt,-\ypos pt)$);} \dospy \pgfmathtruncatemacro\pgfmathresult{ifthenelse(\columncount==\pgfkeysvalueof{/tikz/zoomboxarray columns},\rowcount+1,\rowcount)} \global\let\rowcount=\pgfmathresult \pgfmathtruncatemacro\pgfmathresult{ifthenelse(\columncount==\pgfkeysvalueof{/tikz/zoomboxarray columns},1,\columncount+1)} \global\let\columncount=\pgfmathresult \ifblackandwhitecycle \pgfmathtruncatemacro{\newpatternnumber}{\patternnumber+1} \global\edef\patternnumber{\newpatternnumber} \fi \end{scope} } \begin{document} \begin{figure}[ht]\centering \fbox{ \begin{tikzpicture}[ zoomboxarray,black and white=cycle, ] \node [image node] { \includegraphics[width=0.45\textwidth]{gallery} }; \zoombox{0.27,0.9} \zoombox[color code=red,magnification=6]{0.4,0.83} \zoombox{0.42,0.45} \zoombox[magnification=5]{0.95,0.52} \end{tikzpicture} } \caption{The National Gallery of Canada} \end{figure} \end{document} How can I effectively adjust the width of the \zoomboxes node, possibly as a parameter of the tikzpicture environment?

  • Drawing Complicated geometry figures in tikz
    by furfur on April 13, 2020 at 9:49 am

    I want to get this kind of figures in LaTeX: I am pretty sure these were not written manually in tikz, since it would take too much time. How can I draw hard geometry in tikz without needing to spend half an hour on each figure? I tried geogebra but the figures produced are horrible. Even by changing the software’s settings you still get ugly tikz figures and the nodes labels are placed incorrectly. Please help me, maybe with something like a WYSIWYG program for tikz, because it is not the best option to manually write the tikz code for 200 figures..

  • Drawing Super Mario Bros.....in LaTeX
    by Sebastiano on October 2, 2019 at 10:20 pm

    There are several questions about TeX.SE. that concern designs for recurrences such as fireworks, lunar calendar, the pi-greek, and into my mind I'm remembering a protagonist of an old video game: Super Mario Bros. But is it possible to make detailed drawings of the protagonists of video games with LaTeX? I'm just curious to see only how the users build Super Mario Bros. Thank you everyone.

  • Tangent to ellipse using Tikz
    by MocS on July 25, 2019 at 11:17 pm

    I would like to draw 2 ellipses and a 6-sided polygon that is inscribed in the first ellipse and circumscribed about second ellipse. I am working with package TikZ and I am a beginner, so this is as far as I got: \documentclass[tikz]{standalone} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \clip (-3,-2) rectangle (3,2); \coordinate (A) at (170:2 and 1); \coordinate (B) at (100:2 and 1); \coordinate (C) at (40:2 and 1); \coordinate (F) at (220:2 and 1); \coordinate (E) at (-90:2 and 1); \coordinate (D) at (-30:2 and 1); \coordinate (X) at (intersection of A--E and D--B); \coordinate (Y) at (intersection of A--F and D--C); \coordinate (Z) at (intersection of C--E and F--B); \draw[black,thick] (0,0) ellipse (2 and 1); \draw[black,thin] ($(A)!-0.0!(B)$)--($(A)!1.0!(B)$); \draw[black,thin] ($(C)!-0.0!(B)$)--($(C)!1.0!(B)$); \draw[black,thin] ($(C)!-0.0!(D)$)--($(C)!1.0!(D)$); \draw[black,thin] ($(F)!-0.0!(E)$)--($(F)!1.0!(E)$); \draw[black,thin] ($(E)!-0.0!(D)$)--($(E)!1.0!(D)$); \draw[black,thin] ($(A)!-0.0!(F)$)--($(A)!1.0!(F)$); \foreach \p in {A,B,C,D,E,F} \fill[black] (\p) circle (0.04); \draw[black] ($(A)+(120:0.3)$) node{$A$}; \draw[black] ($(B)+(100:0.3)$) node{$B$}; \draw[black] ($(C)+(90:0.3)$) node{$C$}; \draw[black] ($(D)+(-90:0.3)$) node{$D$}; \draw[black] ($(E)+(-80:0.3)$) node{$E$}; \draw[black] ($(F)+(-110:0.3)$) node{$F$}; \end{tikzpicture} \end{document} So this gives me the outer ellipse, 6 points on it, and the tangents to the inner ellipse. But I am stuck, as I don't know how to draw the inner ellipse. Any help will be appreciated.

  • footnote outside tikzbox and tcolorbox
    by Kώστας Κούδας on March 25, 2019 at 9:52 am

    I use tikz and tcolorbox for theorems. Also I want footnotes outside of the boxes, at the bottom of the page and with the same numbering like the others. I want something like this, but with the numbering style to be the same with the outside footnotes. Is there any solution? This is my code \documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes,snakes} \usepackage[most]{tcolorbox} \usepackage{environ} \renewcommand{\thefootnote}{[\Roman{footnote}]}% Footnote style!!! \tikzstyle{mybox} = [draw=black, fill=white, very thick, rectangle, rounded corners, inner sep=10pt, inner ysep=20pt] \NewEnviron{tikzbox}{\begin{tikzpicture} \node [mybox] (box){% \begin{minipage}{0.50\textwidth} \BODY \end{minipage} }; \end{tikzpicture}% } \NewEnviron{Tbox}{ \begin{tcolorbox}[enhanced, breakable] \BODY \end{tcolorbox} } \begin{document} Some main text Some main text Some main text Some main text Some main text Some main text\footnote{The first footnote.} Other main text Other main text Other main text Other main text\footnote{The second footnote.} \begin{tikzbox} Some tikzboxed text Some tikzboxed text Some tikzboxed text\footnote{I want this footnote outside of the box and with number [III].} \end{tikzbox} \begin{Tbox} Some tcolorboxed text Some tcolorboxed text Some tcolorboxed text Some tcolorboxed text Some tcolorboxed text Some tcolorboxed text\footnote{I want this footnote outside of the box and with number [IV].} \end{Tbox} \end{document} and this is how it looks like: Thanks in advance!!!

  • How to create horn torus in LaTeX?
    by Arindam Jha on June 6, 2018 at 5:20 pm

    This is a horn torus. How can I use LaTeX to generate it ?

  • How can I get correct spacing when reusing Forest trees and when calign is center (default), last etc.?
    by cfr on July 22, 2017 at 2:28 pm

    Forest allows me to reuse (part of) a tree in another tree. However, when calign has certain values, including the default center, this does strange things to the spacing of some nodes. How can this be avoided in a less hackish way than by the use of the commented code block, which is a really horrible workaround? The following example is based on my answer to David Emerson's question. \documentclass[border=10pt,multi,tikz]{standalone} \usepackage{forest} \begin{document} \forestset{ default preamble={ for tree={ align=center, child anchor=parent, draw, }, % before packing={% horrible hack - this shouldn't be needed at all! % where={>On=On=&{n}{1}{n children}{0}}{ % if nodewalk valid={next}{ % s'+=100mm, % }{} % }{}, % } }, } \Forest*{ [Manager 1, name=m1 [Individual\\Contributor 1] [Individual\\Contributor 2] [Individual\\Contributor 3] [Individual\\Contributor 4] [Individual\\Contributor 5] [Individual\\Contributor 6] ] } \Forest*{ [, replace by=m1] } \end{document}

  • Drawing topology of network with TikZ
    by MEDIOUNI on June 26, 2016 at 12:07 am

    I want to draw with TikZ a topology as illustrated below: The shape of node preferred is ball, can you help me ?

  • 3D effects for hollow and solid cylinder in tikz
    by ravi on November 4, 2015 at 6:01 am

    I want to make following things in tikz- Solid Cylinder Hollow Cylinder The solid cylinder is little tilted and touching the top surface of hollow cylinder. The hollow cylinder is open from both the ends. Below is my code- \begin{tikzpicture}[scale=0.5, transform shape] \begin{scope}[shift={(0,0)},rotate=30] \coordinate (ll) at (-2,0); %lower left \coordinate (lr) at ( 2,0); %lower right \coordinate (ul) at (-2,4); %upper left \coordinate (ur) at ( 2,4); %upper right \shade [shading angle=90] (ll) arc (-180:-60:2 cm and .75cm) -- +(0,4) arc (-60:-180:2 cm and .75cm) -- cycle; \shade [shading angle=270] (lr) arc (0:-60:2 cm and .75cm) -- +(0,4) arc (-60:0:2 cm and .75cm) -- cycle; \draw [thick] (ll) arc (-180:0:2 cm and .75cm) -- (ur) arc (0:-180:2 cm and .75cm) -- cycle; \draw [thick, shade, shading angle=30] (ul) arc (-180:180:2 cm and .75cm); \end{scope} \fill [top color=gray!50!black,bottom color=gray!10,middle color=gray,shading=axis,opacity=0.25] (0,0) circle (2cm and 0.5cm); \fill [left color=gray!50!black,right color=gray!50!black,middle color=gray!50,shading=axis,opacity=0.25] (2,0) -- (2,-6) arc (360:180:2cm and 0.5cm) -- (-2,0) arc (180:360:2cm and 0.5cm); \fill [top color=gray!90!,bottom color=gray!2,middle color=gray!30,shading=axis,opacity=0.25] (0,-6) circle (2cm and 0.5cm); \draw (-2,-6) -- (-2,0) arc (180:360:2cm and 0.5cm) -- (2,-6) ++ (-2,0) circle (2cm and 0.5cm); \draw [densely dashed] (-2,0) arc (180:0:2cm and 0.5cm); \end{tikzpicture} Below is the generated picture - The above output is fine but it is difficult to differentiate between hollow and solid object. How to achieve it? Please suggest.

  • TikZ Fill for Fraction Diagram
    by WeCanLearnAnything on August 4, 2015 at 11:34 pm

    I'm trying to shade in one third of this circle. Obviously, it's not working. What did I do wrong? I got no error messages for either of my attempts in the code below, but neither filled anything in. Both just gave this circle. \documentclass[12pt,letterpaper]{article} \usepackage{tikz} \usepackage{xcolor} \begin{document} How to shade in $\frac{1}{3}$ of this? \begin{tikzpicture} \draw (0,0) circle (3cm); \draw (90:3)--(0,0); \draw (210:3)--(0,0); \draw (330:3)--(0,0); \fill[gray] arc[start angle=-30, end angle =90, radius=3cm]; \end{tikzpicture} % In this attempt, I put the color=gray part in the same square brackets as all the other stuff. \begin{tikzpicture} \draw (0,0) circle (3cm); \draw (90:3)--(0,0); \draw (210:3)--(0,0); \draw (330:3)--(0,0); \fill arc[color=gray, start angle=-30, end angle =90, radius=3cm]; \end{tikzpicture} \end{document}

  • 3d Graph Error with Plot
    by dreez91 on June 16, 2015 at 3:25 pm

    I have a problem with plotting a 3d-graph \documentclass[border=5pt]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ title=Exmple using the mesh parameter, hide axis, colormap/cool, ] \addplot3[ mesh, samples = 40, domain=0:1, ] {exp(-(ln(x)-ln(y)))}; \addlegendentry{$\frac{sin(r)}{r}$} \end{axis} \end{tikzpicture} \end{document} The problem is NOTE: coordinate (0Y0.0e0],0Y0.0e0],3Y0.0e0]) has been dropped because it is un bounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y2.5641e-2],0Y0.0e0],3Y0.0e0]) has been dropped because it i s unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y5.1282e-2],0Y0.0e0],3Y0.0e0]) has been dropped because it i s unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y7.6923001e-2],0Y0.0e0],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y1.02564001e-1],0Y0.0e0],3Y0.0e0]) has been dropped because it is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y1.2820499e-1],0Y0.0e0],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y1.5384598e-1],0Y0.0e0],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y1.7948697e-1],0Y0.0e0],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y2.0512796e-1],0Y0.0e0],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y2.3076895e-1],0Y0.0e0],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y2.5640994e-1],0Y0.0e0],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y2.8205093e-1],0Y0.0e0],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y3.0769193e-1],0Y0.0e0],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y3.3333292e-1],0Y0.0e0],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y3.589739e-1],0Y0.0e0],3Y0.0e0]) has been dropped because it is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y3.846149e-1],0Y0.0e0],3Y0.0e0]) has been dropped because it is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y4.1025589e-1],0Y0.0e0],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y4.3589688e-1],0Y0.0e0],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y4.6153787e-1],0Y0.0e0],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y4.8717886e-1],0Y0.0e0],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y5.1281985e-1],0Y0.0e0],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y5.3846085e-1],0Y0.0e0],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y5.6410184e-1],0Y0.0e0],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y5.8974283e-1],0Y0.0e0],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y6.1538382e-1],0Y0.0e0],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y6.4102481e-1],0Y0.0e0],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y6.666658e-1],0Y0.0e0],3Y0.0e0]) has been dropped because it is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y6.923068e-1],0Y0.0e0],3Y0.0e0]) has been dropped because it is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y7.1794778e-1],0Y0.0e0],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y7.4358878e-1],0Y0.0e0],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y7.6922977e-1],0Y0.0e0],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y7.9487076e-1],0Y0.0e0],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y8.2051175e-1],0Y0.0e0],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y8.4615274e-1],0Y0.0e0],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y8.7179373e-1],0Y0.0e0],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y8.9743472e-1],0Y0.0e0],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y9.2307571e-1],0Y0.0e0],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y9.487167e-1],0Y0.0e0],3Y0.0e0]) has been dropped because it is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y9.743577e-1],0Y0.0e0],3Y0.0e0]) has been dropped because it is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (1Y9.9999869e-1],0Y0.0e0],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y2.5641e-2],3Y0.0e0]) has been dropped because it i s unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y5.1282e-2],3Y0.0e0]) has been dropped because it i s unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y7.6923001e-2],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y1.02564001e-1],3Y0.0e0]) has been dropped because it is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y1.2820499e-1],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y1.5384598e-1],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y1.7948697e-1],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y2.0512796e-1],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y2.3076895e-1],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y2.5640994e-1],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y2.8205093e-1],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y3.0769193e-1],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y3.3333292e-1],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y3.589739e-1],3Y0.0e0]) has been dropped because it is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y3.846149e-1],3Y0.0e0]) has been dropped because it is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y4.1025589e-1],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y4.3589688e-1],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y4.6153787e-1],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y4.8717886e-1],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y5.1281985e-1],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y5.3846085e-1],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y5.6410184e-1],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y5.8974283e-1],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y6.1538382e-1],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y6.4102481e-1],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y6.666658e-1],3Y0.0e0]) has been dropped because it is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y6.923068e-1],3Y0.0e0]) has been dropped because it is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y7.1794778e-1],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y7.4358878e-1],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y7.6922977e-1],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y7.9487076e-1],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y8.2051175e-1],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y8.4615274e-1],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y8.7179373e-1],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y8.9743472e-1],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y9.2307571e-1],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y9.487167e-1],3Y0.0e0]) has been dropped because it is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y9.743577e-1],3Y0.0e0]) has been dropped because it is unbounded (in z). (see also unbounded coords=jump). NOTE: coordinate (0Y0.0e0],1Y9.9999869e-1],3Y0.0e0]) has been dropped because i t is unbounded (in z). (see also unbounded coords=jump). ! Package pgfplots Error: An internal error occurred during z buffer reordering s: the rows/cols where not balanced! I have rows= 40, cols=40. If this happens to be wrong, you might want to provide rows and cols manually.. See the pgfplots package documentation for explanation. Type H <return> for immediate help. ... l.17 \end{axis} ? Is there anyone who knows how to fix the problem? It works e.g. with the function sin(x)*sin(y)...

  • Is it possible to draw a 3d cylinder using TikZ-3dplot?
    by Sebastian Schmitz on October 15, 2013 at 10:40 am

    I want to draw a clyinder between two planes. I want to specify the distance between the planes and position and radius of the cylinder. I would like to use tikz-3dplot, because it allows a free rotation of the Viewpoint if everything is implemented with it. There are a few Threads in which the creation of 3D bodies in TikZ, Drawing simple 3D cylinders in TikZ and Drawing 3D cylinder have been discussed. Unfortunately those solution seem not to work with tikz-3dplot, because they all manipulate the 'Viewpoint' themself. This leads to the Problem, that a manipulation of the viewpoint with \tdplotsetmaincoords only rotates all Objects except the Cylinders. Another User had a very similar question which yielded no answer yet. How to draw a 3d cylinder using TikZ-3dplot? To summarize: I want to draw a cylinder in 3d using tikz-3dplot. At the Moment i can draw the circle at the end of the cylinder and a line from border to border, which only recognizes rotation around the x-axis. The Question is how can i put the lines correctly at the side of the cylinder. Example of Code: \documentclass[convert = false, tikz]{standalone} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{textcomp} \usepackage{amsmath} \usepackage{tikz-3dplot} \begin{document} %Configure here Rotation around x and y axis \pgfmathsetmacro{\x}{60} \pgfmathsetmacro{\y}{100} \tdplotsetmaincoords{\x}{\y} \begin{tikzpicture}[ tdplot_main_coords] \coordinate (O) at (0, 0, 0); \draw[-latex] (O) -- (-8, 0, 0) node[font = \small, pos = 1.1] {\(x\)}; \draw[-latex] (O) -- (0, 6, 0) node[font = \small, pos = 1.1] {\(y\)}; \draw[-latex] (O) -- (0, 0, 6) node[font = \small, pos = 1.1] {\(z\)}; % define size of planes \pgfmathsetmacro{\planesize}{4} %plane1 \filldraw[blue, opacity = .2] (0, 0, 0) -- (0, \planesize, 0) -- (0, \planesize, \planesize) -- (0, 0, \planesize) -- cycle; %Define Plane in which the circles of the cylinder are drawn. \tdplotgetpolarcoords{0}{1}{0} \tdplotsetthetaplanecoords{\tdplotresphi} %\tdplotdrawarc[coordinate system, draw styles]{center}{r}{angle start}{angle end}{label options}{label} %circle on first plane \pgfmathsetmacro{\radius}{0.5} \tdplotdrawarc[tdplot_rotated_coords]{(1,1,0)}{\radius}{0}% {360}{}{} %circle on second plane \tdplotdrawarc[tdplot_rotated_coords]{(1,1,4)}{\radius}{0}% {360}{}{} %line from middle to middle \draw[tdplot_rotated_coords] (1,1,0) -- (1, 1, 4) node[font = \small, pos = 1.1] {}; %First Edge of cylinder \draw[tdplot_rotated_coords] ({1+sin(\x)*\radius}, {1+cos(\x)*\radius},0) -- ({1+sin(\x)*\radius}, {1+cos(\x)*\radius}, 4) node[font = \small, pos = 1.1] {}; %plane2 \filldraw[blue, opacity = .2] (-4, 0, 0) -- (-4, \planesize, 0) -- (-4, \planesize, \planesize) -- (-4, 0, \planesize) -- cycle; \end{tikzpicture} \end{document}

  • Hide Tikz node in Beamer
    by jorgehumberto on July 14, 2013 at 4:34 pm

    I am using Tikz to create a flow chart for a Beamer presentation. I managed to get Beamer to uncover each item in the flowshart one by one, but I would like to be able to show one node and then hide it. Is there any way to do this? Here's my code: \begin{frame}{The Detection Method} \tikzstyle{LargeBlock} = [rectangle, draw, fill=blue!20, text width=10em, text badly centered, rounded corners] \tikzstyle{decision} = [diamond, draw, fill=red!20, text badly centered,text width=1.2cm] \tikzstyle{block} = [rectangle, draw, fill=blue!20, text width=5em, text badly centered, rounded corners, minimum height=1em] \tikzstyle{ImgBlock} = [rectangle, draw] \tikzstyle{line} = [draw, -latex'] \tikzstyle{cloud} = [draw, ellipse,fill=red!20, minimum height=1em] \tikzstyle{EmptyAnchor} = [ellipse,minimum height=1em] \begin{tikzpicture}[node distance = 1cm, auto] \pause{} % Step 1 \node [LargeBlock, anchor=north] (init) {Simulated Planet + Star CCFs};\pause{} % Step 2 \node [decision, right=1 cm of init] (build) {$\sum CCFs$}; \path [line] (init) -- (build); \pause{} % Step 3 \node [block, below=0.5 cm of build] (template) {Star Template}; \path [line] (build) -- (template); \pause{} % Step 4 \node [decision, below=0.5 cm of init] (normalise) {$\frac{CCFs}{Template}$}; \path [line] (init) -- (normalise); \path [line] (template) -- (normalise); \pause{} % Step \node [EmptyAnchor, below=1.5 cm of normalise] (empty0) {}; \node [EmptyAnchor, right=2.5 cm of empty0] (empty3) {}; \node [ImgBlock, right=5 cm of empty0] (img1) {{\pgftext{\includegraphics[width=4.5cm,page=6]{./figures/Jupiter_3days_EELT.pdf}}}}; \path [line,dashed] (normalise) |- (empty3); \pause{} % Step 5 \path [line] (init) -- (build); \node [LargeBlock, below=0.5 cm of normalise] (NormCCFs) {Normalized CCFs}; \path [line] (normalise) -- (NormCCFs); \pause{} % Step 6 \node [decision, below=0.5 cm of NormCCFs] (stack) {$stack$ $CCFs$}; \node [EmptyAnchor, below=0.5 cm of NormCCFs] (empty1) {}; \path [line] (NormCCFs) -- node[color=red]{Correct Planet RV} (stack); \pause{} % Step 7 \node [EmptyAnchor, right=2 cm of stack] (empty2) {}; \node [ImgBlock, right=5 cm of empty1] (stop) {{\pgftext{\includegraphics[width=4.5cm,page=8]{./figures/Jupiter_3days_EELT.pdf}}}}; \path [line,dashed] (stack) -- (empty2); \end{tikzpicture} \end{frame} I want node (img1) to appear and then vanish when node (NormCCFs) appears. Any takers?

  • generate simple cylindrical shape with text in latex (tikz)
    by KatyB on December 11, 2012 at 3:06 pm

    I am attempting to generate the following diagram in latex: I've been using the tikz package, which although its capabilities seem to be endless, it does have a rather steep learning curve. I am currently learning how to generate simple diagrams including circles, arrows, squares, and have no idea how to include text yet. I am working through the manual so I will eventually have a good understanding of the tool, but as of yet, the diagram shown is beyond my capabilities. Could someone specify how I should go around generating this diagram? Many thanks for your help.

  • Drawing 3D cylinder
    by Jana on July 15, 2012 at 9:20 am

    I need to draw a lot of 3D cylinders with different dimensions. Has anyone maybe already defined a command like \3Dcylinder{x}{y}{z}? I found 3D bodies in TikZ and tried the third answer. But I don't understand how the parameters work. Also I found Drawing simple 3D cylinders in TikZ. But I don't know how to use it to easily draw a bunch of different cylinders.

  • Creating gears in TikZ
    by azetina on June 5, 2012 at 10:54 pm

    I am trying to create a gear in TikZ in which the number of spikes can be determined and the size as well. I was looking through the pgfmanual and stumbled upon the decorations section and I tried a piece of code there. Here is what I have so far: \documentclass[letterpaper]{article} \usepackage{tikz} \usetikzlibrary{decorations} \begin{document} \pgfdeclaredecoration{example}{initial} { \state{initial}[width=20pt] { \pgfpathlineto{\pgfpoint{0pt}{5pt}} \pgfpathlineto{\pgfpoint{5pt}{5pt}} \pgfpathlineto{\pgfpoint{5pt}{-5pt}} \pgfpathlineto{\pgfpoint{10pt}{-5pt}} \pgfpathlineto{\pgfpoint{10pt}{5pt}} } \state{final} { \pgfpathlineto{\pgfpointdecoratedpathlast} } } \tikz[decoration=example] { \draw [red,decorate] (0,0) circle (1cm); } \end{document} which yields: Of course the above is not satisfactory. Is there a way a gear can be drawn in TikZ or any other graphics package? Update: For those interested in ready made svg images, the NounProject provides some sample files. Follow this link: Engrenages.

  • Drawing on an image with TikZ
    by nacho4d on January 23, 2011 at 5:08 pm

    Recently, I have learned how to draw simple stuff with TikZ. I really like it. Now I wonder if it is possible to draw with TikZ on an image. Instead of pasting an image in Illustrator and adding some vectors to point to something in the picture, I would like to do it using TikZ. Is it possible? For example, on a picture of a computer (PNG, etc.) I would like to draw some arrows and labels saying "Keyboard", "Monitor", etc..

  • Is there a way to tune ball shading in TikZ ?
    by Łukasz Lew on August 18, 2010 at 1:55 pm

    I want to create a Go stone in TikZ. "ball color" option in node style is almost OK. Here is my result: But I don't like the stones, they are "too balish". The "reflection" should be less spot-on and more ambient. I could get such a result if I could manipulate both shading colors or shading curve. Can I do it in TikZ? Here is what I want to achieve: PS. Any ideas to render wood-like background w/o texture?