• 3d Tikz Graph highlighting a specific interp line and axis problem
    by FishDrowned on April 7, 2026 at 2:43 pm

    I'm currently trying to graphically represent Feynman's technique. Specifically, I have the function rad(atan(sqrt(2-x*x)))/(1+x*x) which is being parametrized as rad(atan(t*sqrt(2-x*x)))/(1+x*x). I managed to create the graph for the function, \documentclass{standalone} \usepackage{tikz,pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ axis lines = center, axis on top, view={50}{30}, xlabel={$x$}, ylabel={$t$}, zlabel={}, xmin=-2, xmax=2, ymin=-2, ymax=2, zmin=-2, zmax=2, tick label style={font=\tiny} ] \addplot3[ surf, shader=faceted interp, faceted color=black!60, opacity=0.85, samples=22, samples y=18, domain=-1.4:1.4, domain y=-2:2, ] {rad(atan(y*sqrt(2-x*x)))/(1+x*x)}; \end{axis} \end{tikzpicture} \end{document} But I'm having trouble figuring out how to a) highlight the specific line along the function that represents rad(atan(sqrt(2-x*x)))/(1+x*x) and b) getting the axis lines to be above and below the 3d surface when the surface is above and below.

  • How to plot y = x^{2/3} + 0.8 cos(kx) √(3-x²) in LaTeX TikZ
    by hola on April 7, 2026 at 1:45 pm

    I would like to plot the following function in LaTeX using TikZ or pgfplots: \[ y = x^{2/3} + 0.8 \cdot \cos(kx) \cdot \sqrt{3 - x^2} \] The domain is \( - \sqrt{3} \leq x \leq \sqrt{3} \). I need to create a nice graph where: The curve looks smooth I can easily change the value of \( k \) (number of oscillations) The modulated amplitude (the \( \sqrt{3-x^2} \) part) is clearly visible I have tried basic \addplot but I have problems with the fractional power \( x^{2/3} \) and with making the cosine oscillation look good. MWE (Minimal Working Example): \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis} \addplot {x^(2/3)}; % this part works, but adding the rest is difficult \end{axis} \end{tikzpicture} \end{document} pgfplots tikz-pgf plot functions graphics

  • How to draw an orientation link with tikzpicture
    by DLIN on April 6, 2026 at 5:14 pm

    I want to draw the above picture in the book Lecture on the topology of 3-manifold. So far, I can only draw the Hopf link: \documentclass[tikz]{standalone} \usepackage{tikz} \usetikzlibrary{knots} \begin{document} \begin{tikzpicture} \begin{knot}[flip crossing={2}] \strand (1.5,0) circle (1.0); \strand (2.5,0) circle (1.0); \end{knot} \end{tikzpicture} \end{document} Q: I do not know what kind of command I should use to draw the above picture.

  • Arranging nodes to have a nice circle shape
    by user516076 on April 5, 2026 at 1:42 am

    I need your help to make the label, i.e. the numbers to be arranged circular nicely and spot-on (not estimating and guessing using rectangle coordinate, which is very difficult). i'm thinking of polar coordinate, but how to implement it so that it can be positioned exactly in the middle of each part? You see, I used manual and it looks ugly and messy... \documentclass[tikz,border=5pt]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}[scale=1.2, every node/.style={font=\Large}] % Radii \def\R{3} \def\r{1.75} % Outer circle (black) \draw[black, line width=1.2pt] (0,0) circle (\R); % Inner circle (cyan) \draw[cyan!70!black, line width=1.2pt] (0,0) circle (\r); % Straight dividing lines (green) \draw[green!60!black, line width=1.2pt] (-\R,0) -- (\R,0); \draw[green!60!black, line width=1.2pt] ({\R*cos(60)},{\R*sin(60)}) -- ({\R*cos(240)},{\R*sin(240)}); \draw[green!60!black, line width=1.2pt] ({\R*cos(120)},{\R*sin(120)}) -- ({\R*cos(300)},{\R*sin(300)}); % Outer ring numbers (red) % Top sector \node[red] at (-0.55, 2.35) {3}; \node[red] at ( 0.55, 2.35) {5}; % Upper-right sector \node[red] at (1.90, 1.65) {4}; \node[red] at (2.30, 0.65) {7}; % Lower-right sector \node[red] at (2.35,-0.65) {0}; \node[red] at (1.90,-1.65) {6}; % Bottom sector \node[red] at (-0.55,-2.35) {2}; \node[red] at ( 0.55,-2.35) {10}; % Lower-left sector \node[red] at (-1.90,-0.65) {4}; \node[red] at (-2.30,-1.65) {1}; % Upper-left sector \node[red] at (-2.30, 0.65) {8}; \node[red] at (-1.90, 1.65) {7}; % Inner circle numbers (red) \node[red] at ( 0.00, 0.95) {?}; \node[red] at ( 1.05, 0.25) {5}; \node[red] at ( 1.00,-0.65) {15}; \node[red] at ( 0.00,-1.10) {8}; \node[red] at (-0.95,-0.60) {11}; \node[red] at (-1.05, 0.25) {6}; \end{tikzpicture} \end{document} At least, I wish to have something similar to this:

  • How to adapt a Tikzpicture to the text height?
    by Mika Ike on April 4, 2026 at 3:09 pm

    How to adapt a Tikzpicture to the text height? Spplatter from https://ctan.org/pkg/fontmfizz \documentclass[12pt]{exam} \usepackage[utf8]{inputenc} \usepackage[spanish]{babel} \usepackage{eurosym} \usepackage{multirow} \usepackage[inkscapearea=page]{svg} % só para cargar atrqvuiso, nono para o path de tikz \usepackage{fontawesome7} \usepackage[galician,showseconds=false,showzone=false]{datetime2} \usepackage{unicode-math} \setmainfont{TeX Gyre Pagella} % OpenType version of Palladio/Palatino \setmathfont{TeX Gyre Pagella Math} %\newfontfamily\oldenglish{Old English Text MT} \usepackage{tikz} \usetikzlibrary{svg.path} \begin{document} Agora imos mezclar unha icona(carácter/glifo) dunha fonte \faHouseChimney e otro \tikz{\draw[fill=pink,draw=blue,rotate=0,yscale=-1,scale=1] svg { M23.999,26.112c-3.483-0.418-7.164-2.025-10.217-3.856-3.701-2.249-2.859-5.579-8.0652-4.417-5.0472,1.1313-1.8324,5.4324,0.86046,7.1001,4.6884,2.8745,3.918,1.2779,8.8904,3.6589,2.4074,1.146,4.1677,2.7235,5.3368,4.8239,0.52724,0.97038-2.1169,3.2264-3.8704,1.6642-1.8034-1.6066-5.538,0.77956-5.5322,2.0477,0.0052,1.1273-0.10624,3.6251,4.5829,4.1545,3.4805,0.39298,4.5667,4.4943,2.9491,5.1787-4.7047,1.9945-11.583-0.28724-15.714,2.7056-1.9751,1.4435-3.1972,4.5997-0.21206,5.8065,3.8945,1.5922,9.8389-3.0121,14.117-2.2379,10.591,1.9348,1.3002,8.8326-0.69399,11.17-5.5488,6.566,5.7667,7.0227,9.7142,5.7719,5.3871-1.6959,7.5148-6.0259,12.746-4.3582,2.3503,0.75948,1.6706,4.7191,1.5265,6.2539-0.16448,1.9055-0.88085,3.7365-0.84415,5.6578,0,0.89244-0.02175,1.6959,1.0752,2.0395,1.2057,0.38763,2.4618-0.67046,3.6294-0.13522,1.1867,0.53637,1.2723,2.1601,1.4708,3.1123,0.48528,2.5455,0.47033,5.3152,0,7.8607-0.37382,2.0688-1.6353,4.2121-1.4178,6.3406,0.26779,2.8734,4.7074,3.1416,6.5711,0.96794,1.1147-1.2812,1.3675-3.5889,1.1323-5.1068-1.759-7.3243-4.9031-21.573,4.6707-25.994,6.7695-3.1416,5.5312,1.653,7.6327,4.5253,1.8854,2.5613,3.5384,3.2914,3.9149,0.43383,0.35751-2.6356-0.96921-6.0138-1.0956-8.7239-0.08972-2.0542,2.0825-3.1416,4.112-3.8413,5.1356-1.7421,11.565-1.2812,16.199,1.2361,3.6458,1.9787,2.4508,2.0763,6.8333,3.1028,3.8252,0.89357,5.2567-1.579,4.4125-5.3471-4.7665-4.6397-6.6118-1.286-12.808-2.7002-4.0742-0.92398-2.4716-3.8985,1.2471-3.2842,1.5838,0.26164,2.276-1.9024,1.7552-3.3095-1.2467-3.3687-0.17052-6.8773,2.9243-9.0974,1.6149-1.1618,2.2943-2.6495,2.6178-4.5245,0.37654-1.9956-0.2118-4.4225-2.7973-3.9909-3.0177,0.52059-4.3825,4.1535-7.0958,5.1361-2.9987,1.0716-5.6032-1.1595-5.6752-3.7208-0.08836-2.7855,2.3177-5.2713,2.7296-7.9959,0.79114-5.2994-7.7578-2.932-11.636-4.5095-6.2516-2.5613-1.6916-3.8621,0.32018-7.2122,1.0956-1.7871,3.1238-5.0763,1.4015-7.0257-1.4926-1.7128-3.8456-1.0874-5.2987,0.32678-2.4251,2.3382-1.9031,5.8662-2.3897,8.7396-0.68103,4.1681-1.3791,4.785-6.3896,6.6904-3.431,1.2936-8.3708,0.60848-10.955-1.7139-2.1586-1.9798-1.9411-5.1361-4.2208-6.9671-4.4151-3.5732-6.8633,2.6503-7.9032,5.3592-1.6883,4.5129-3.4269,9.0675-10.542,8.2044z };} obtido dun \verb".svg" (arquivo ou path). \end{document}

  • How to draw an SVG using paths in Tikz picture?
    by Mika Ike on April 4, 2026 at 2:50 pm

    How to draw the same image than an SVG using paths in TikZ? The target is get the same TikZ image than the Splatter (fontmfizz) but I can´t. 1.- The TikZ image obtained is vertical flipped, and 2.- Some little parts are not in the expected place \documentclass[12pt]{exam} \usepackage[galician,showseconds=false,showzone=false]{datetime2} \usepackage{unicode-math} \setmainfont{TeX Gyre Pagella} % OpenType version of Palladio/Palatino \setmathfont{TeX Gyre Pagella Math} %\newfontfamily\oldenglish{Old English Text MT} \usepackage{tikz} \usetikzlibrary{svg.path} \begin{document} lorem ipsum kasdjkj dsd ds f sd f ds f ds f ds fsd fa dsf asdf ds f sdaf asdf asdf sad f sad fsdafs \smash{\raisebox{-6em}{\tikz{\draw[fill=violet!82,draw=yellow,rotate=0,yscale=-1,scale=0.5] svg { m28.235,20.103c-0.59539,0.23753-1.8493,0.04972-3.957-0.856-3.599-1.49-5.895-3.36-8.416-5.035-2.486-1.668-5.365-3.379-6.7284-5.1931-1.1392-1.6464,1.9884-2.4412,6.0064-1.3811,5.2395,1.3773,8.2717,4.8177,10.576,6.7541,0.87281,0.70463,4.3397,5.0474,2.5194,5.7114z m68.523,76.118c0.14409,0,3.8782,4.9434,4.668,6.282,1.0249,1.6981,4.8501,5.8809,2.6222,7.6669-1.4722,1.1618-2.7105-0.52059-3.7164-1.519-1.0766-1.0705-6.3033-12.296-3.5737-12.43z m29.958,76.255c0.11396,0.03513,0.21137,0.09847,0.30037,0.156,2.5843,1.3991-2.9327,10.618-3.5239,12.686-0.78314,2.6414-4.5676,5.3907-6.3669,1.611-1.5082-3.2142,8.0274-14.751,9.5905-14.453z M23.999,26.112c-3.483-0.418-7.164-2.025-10.217-3.856-3.701-2.249-2.859-5.579-8.0652-4.417-5.0472,1.1313-1.8324,5.4324,0.86046,7.1001,4.6884,2.8745,3.918,1.2779,8.8904,3.6589,2.4074,1.146,4.1677,2.7235,5.3368,4.8239,0.52724,0.97038-2.1169,3.2264-3.8704,1.6642-1.8034-1.6066-5.538,0.77956-5.5322,2.0477,0.0052,1.1273-0.10624,3.6251,4.5829,4.1545,3.4805,0.39298,4.5667,4.4943,2.9491,5.1787-4.7047,1.9945-11.583-0.28724-15.714,2.7056-1.9751,1.4435-3.1972,4.5997-0.21206,5.8065,3.8945,1.5922,9.8389-3.0121,14.117-2.2379,10.591,1.9348,1.3002,8.8326-0.69399,11.17-5.5488,6.566,5.7667,7.0227,9.7142,5.7719,5.3871-1.6959,7.5148-6.0259,12.746-4.3582,2.3503,0.75948,1.6706,4.7191,1.5265,6.2539-0.16448,1.9055-0.88085,3.7365-0.84415,5.6578,0,0.89244-0.02175,1.6959,1.0752,2.0395,1.2057,0.38763,2.4618-0.67046,3.6294-0.13522,1.1867,0.53637,1.2723,2.1601,1.4708,3.1123,0.48528,2.5455,0.47033,5.3152,0,7.8607-0.37382,2.0688-1.6353,4.2121-1.4178,6.3406,0.26779,2.8734,4.7074,3.1416,6.5711,0.96794,1.1147-1.2812,1.3675-3.5889,1.1323-5.1068-1.759-7.3243-4.9031-21.573,4.6707-25.994,6.7695-3.1416,5.5312,1.653,7.6327,4.5253,1.8854,2.5613,3.5384,3.2914,3.9149,0.43383,0.35751-2.6356-0.96921-6.0138-1.0956-8.7239-0.08972-2.0542,2.0825-3.1416,4.112-3.8413,5.1356-1.7421,11.565-1.2812,16.199,1.2361,3.6458,1.9787,2.4508,2.0763,6.8333,3.1028,3.8252,0.89357,5.2567-1.579,4.4125-5.3471-4.7665-4.6397-6.6118-1.286-12.808-2.7002-4.0742-0.92398-2.4716-3.8985,1.2471-3.2842,1.5838,0.26164,2.276-1.9024,1.7552-3.3095-1.2467-3.3687-0.17052-6.8773,2.9243-9.0974,1.6149-1.1618,2.2943-2.6495,2.6178-4.5245,0.37654-1.9956-0.2118-4.4225-2.7973-3.9909-3.0177,0.52059-4.3825,4.1535-7.0958,5.1361-2.9987,1.0716-5.6032-1.1595-5.6752-3.7208-0.08836-2.7855,2.3177-5.2713,2.7296-7.9959,0.79114-5.2994-7.7578-2.932-11.636-4.5095-6.2516-2.5613-1.6916-3.8621,0.32018-7.2122,1.0956-1.7871,3.1238-5.0763,1.4015-7.0257-1.4926-1.7128-3.8456-1.0874-5.2987,0.32678-2.4251,2.3382-1.9031,5.8662-2.3897,8.7396-0.68103,4.1681-1.3791,4.785-6.3896,6.6904-3.431,1.2936-8.3708,0.60848-10.955-1.7139-2.1586-1.9798-1.9411-5.1361-4.2208-6.9671-4.4151-3.5732-6.8633,2.6503-7.9032,5.3592-1.6883,4.5129-3.4269,9.0675-10.542,8.2044z m84.472,20.141c-0.46364-0.09395-0.4995-0.80523,0.24684-2.441,1.1978-2.7514,3.2175-5.1922,4.92-7.5908,1.7001-2.3768,3.3668-4.9643,5.5286-6.9391,1.9848-1.7473,3.8013-0.91559,3.2896,1.7053-0.66016,3.4141-4.6558,7.3623-6.7652,9.8565-0.75958,0.92329-5.8873,5.7427-7.2198,5.409z m88.466,72.472c-0.3968,0.1723-1.2325,0.03606-2.6372-0.62094-2.3986-1.0812-3.9291-2.4373-5.6092-3.6528-1.6568-1.2099-3.5752-2.4508-4.4841-3.7668-0.75927-1.1943,1.3255-1.7708,4.0031-1.0018,3.4919,0.99907,5.5128,3.4947,7.0483,4.8993,0.58169,0.51113,2.8922,3.6613,1.6791,4.143z M51.882,7.3591c-0.426-0.0546-0.892-0.3354-1.307-0.9496-0.743-1.0353-0.642-1.9171-0.767-2.7944-0.113-0.8689-0.383-1.8219,0.118-2.5152,0.50011-0.61071,2.4544-0.21454,3.6617,0.79567,1.5778,1.3162,0.83608,2.7148,0.69686,3.6142-0.03464,0.33374-1.1388,2.0314-2.4021,1.8494z m50.199,46.064c-0.42596-0.05463-0.89232-0.33545-1.3068-0.94963-0.74288-1.0353-0.64204-1.9171-0.76702-2.7944-0.11349-0.8689-0.38317-1.8219,0.11743-2.5152,0.50011-0.61071,2.4544-0.21454,3.6617,0.79566,1.5778,1.3162,0.83608,2.7148,0.69686,3.6142-0.03464,0.33374-1.1388,2.0314-2.4021,1.8494z };}}} askdlfhjsdajkf hjasdkh fjksdah jkh jkh jk hjk hlkj askdlfhjsdajkf hjasdkh fjksdah jkh jkh jk hjk hlkj askdlfhjsdajkf hjasdkh fjksdah jkh jkh jk hjk hlkj askdlfhjsdajkf hjasdkh fjksdah jkh jkh jk hjk hlkj askdlfhjsdajkf hjasdkh fjksdah jkh jkh jk hjk hlkj askdlfhjsdajkf hjasdkh fjksdah jkh jkh jk hjk hlkj \vspace{3em} \begin{tikzpicture} \draw[fill=orange,draw=cyan] svg{ m28.235,20.103c-0.59539,0.23753-1.8493,0.04972-3.957-0.856-3.599-1.49-5.895-3.36-8.416-5.035-2.486-1.668-5.365-3.379-6.7284-5.1931-1.1392-1.6464,1.9884-2.4412,6.0064-1.3811,5.2395,1.3773,8.2717,4.8177,10.576,6.7541,0.87281,0.70463,4.3397,5.0474,2.5194,5.7114z m68.523,76.118c0.14409,0,3.8782,4.9434,4.668,6.282,1.0249,1.6981,4.8501,5.8809,2.6222,7.6669-1.4722,1.1618-2.7105-0.52059-3.7164-1.519-1.0766-1.0705-6.3033-12.296-3.5737-12.43z m29.958,76.255c0.11396,0.03513,0.21137,0.09847,0.30037,0.156,2.5843,1.3991-2.9327,10.618-3.5239,12.686-0.78314,2.6414-4.5676,5.3907-6.3669,1.611-1.5082-3.2142,8.0274-14.751,9.5905-14.453z M23.999,26.112c-3.483-0.418-7.164-2.025-10.217-3.856-3.701-2.249-2.859-5.579-8.0652-4.417-5.0472,1.1313-1.8324,5.4324,0.86046,7.1001,4.6884,2.8745,3.918,1.2779,8.8904,3.6589,2.4074,1.146,4.1677,2.7235,5.3368,4.8239,0.52724,0.97038-2.1169,3.2264-3.8704,1.6642-1.8034-1.6066-5.538,0.77956-5.5322,2.0477,0.0052,1.1273-0.10624,3.6251,4.5829,4.1545,3.4805,0.39298,4.5667,4.4943,2.9491,5.1787-4.7047,1.9945-11.583-0.28724-15.714,2.7056-1.9751,1.4435-3.1972,4.5997-0.21206,5.8065,3.8945,1.5922,9.8389-3.0121,14.117-2.2379,10.591,1.9348,1.3002,8.8326-0.69399,11.17-5.5488,6.566,5.7667,7.0227,9.7142,5.7719,5.3871-1.6959,7.5148-6.0259,12.746-4.3582,2.3503,0.75948,1.6706,4.7191,1.5265,6.2539-0.16448,1.9055-0.88085,3.7365-0.84415,5.6578,0,0.89244-0.02175,1.6959,1.0752,2.0395,1.2057,0.38763,2.4618-0.67046,3.6294-0.13522,1.1867,0.53637,1.2723,2.1601,1.4708,3.1123,0.48528,2.5455,0.47033,5.3152,0,7.8607-0.37382,2.0688-1.6353,4.2121-1.4178,6.3406,0.26779,2.8734,4.7074,3.1416,6.5711,0.96794,1.1147-1.2812,1.3675-3.5889,1.1323-5.1068-1.759-7.3243-4.9031-21.573,4.6707-25.994,6.7695-3.1416,5.5312,1.653,7.6327,4.5253,1.8854,2.5613,3.5384,3.2914,3.9149,0.43383,0.35751-2.6356-0.96921-6.0138-1.0956-8.7239-0.08972-2.0542,2.0825-3.1416,4.112-3.8413,5.1356-1.7421,11.565-1.2812,16.199,1.2361,3.6458,1.9787,2.4508,2.0763,6.8333,3.1028,3.8252,0.89357,5.2567-1.579,4.4125-5.3471-4.7665-4.6397-6.6118-1.286-12.808-2.7002-4.0742-0.92398-2.4716-3.8985,1.2471-3.2842,1.5838,0.26164,2.276-1.9024,1.7552-3.3095-1.2467-3.3687-0.17052-6.8773,2.9243-9.0974,1.6149-1.1618,2.2943-2.6495,2.6178-4.5245,0.37654-1.9956-0.2118-4.4225-2.7973-3.9909-3.0177,0.52059-4.3825,4.1535-7.0958,5.1361-2.9987,1.0716-5.6032-1.1595-5.6752-3.7208-0.08836-2.7855,2.3177-5.2713,2.7296-7.9959,0.79114-5.2994-7.7578-2.932-11.636-4.5095-6.2516-2.5613-1.6916-3.8621,0.32018-7.2122,1.0956-1.7871,3.1238-5.0763,1.4015-7.0257-1.4926-1.7128-3.8456-1.0874-5.2987,0.32678-2.4251,2.3382-1.9031,5.8662-2.3897,8.7396-0.68103,4.1681-1.3791,4.785-6.3896,6.6904-3.431,1.2936-8.3708,0.60848-10.955-1.7139-2.1586-1.9798-1.9411-5.1361-4.2208-6.9671-4.4151-3.5732-6.8633,2.6503-7.9032,5.3592-1.6883,4.5129-3.4269,9.0675-10.542,8.2044z m84.472,20.141c-0.46364-0.09395-0.4995-0.80523,0.24684-2.441,1.1978-2.7514,3.2175-5.1922,4.92-7.5908,1.7001-2.3768,3.3668-4.9643,5.5286-6.9391,1.9848-1.7473,3.8013-0.91559,3.2896,1.7053-0.66016,3.4141-4.6558,7.3623-6.7652,9.8565-0.75958,0.92329-5.8873,5.7427-7.2198,5.409z m88.466,72.472c-0.3968,0.1723-1.2325,0.03606-2.6372-0.62094-2.3986-1.0812-3.9291-2.4373-5.6092-3.6528-1.6568-1.2099-3.5752-2.4508-4.4841-3.7668-0.75927-1.1943,1.3255-1.7708,4.0031-1.0018,3.4919,0.99907,5.5128,3.4947,7.0483,4.8993,0.58169,0.51113,2.8922,3.6613,1.6791,4.143z M51.882,7.3591c-0.426-0.0546-0.892-0.3354-1.307-0.9496-0.743-1.0353-0.642-1.9171-0.767-2.7944-0.113-0.8689-0.383-1.8219,0.118-2.5152,0.50011-0.61071,2.4544-0.21454,3.6617,0.79567,1.5778,1.3162,0.83608,2.7148,0.69686,3.6142-0.03464,0.33374-1.1388,2.0314-2.4021,1.8494z m50.199,46.064c-0.42596-0.05463-0.89232-0.33545-1.3068-0.94963-0.74288-1.0353-0.64204-1.9171-0.76702-2.7944-0.11349-0.8689-0.38317-1.8219,0.11743-2.5152,0.50011-0.61071,2.4544-0.21454,3.6617,0.79566,1.5778,1.3162,0.83608,2.7148,0.69686,3.6142-0.03464,0.33374-1.1388,2.0314-2.4021,1.8494z }; \end{tikzpicture} \end{document} In addition(optional/secondary): Opt1.- is posible use directly the .svg file in the \draw[fill=violet] svg { .... } Opt2.- Is possible use the SVG option transform="matrix(1,0,0,-1,0,0)" in Tikz path?

  • Picking marbles probability course
    by Arne Timperman on April 4, 2026 at 1:21 pm

    For my probability course, I want to create the following figure with marbles. EDIT: red purple means, it could be red or purble I could create this in Tikz, placing each marble separately, but that does not seem like the correct method to me. AI returned the following (incorrect code). \documentclass[10pt,a4paper,svgnames,openleft,explicit]{book} \usepackage{tikz} \usetikzlibrary{decorations.pathreplacing} \begin{document} \begin{center} \begin{tikzpicture} % Parameters \def\r{0.35} % radius \def\dx{1.0} % x distance \def\dy{1.0} % y distance % --- BOVENSTE 4 RIJEN: rood/paars half --- \foreach \row in {0,1,2,3}{ \foreach \col in {0,...,7}{ % paars rechts \fill[purple] (\col*\dx, -\row*\dy) arc[start angle=-45, end angle=135, radius=\r] -- (\col*\dx, -\row*\dy) -- cycle; % rood links \fill[red] (\col*\dx, -\row*\dy) arc[start angle=135, end angle=315, radius=\r] -- (\col*\dx, -\row*\dy) -- cycle; } } % --- ONDERSTE 4 RIJEN: geel --- \foreach \row in {4,5,6,7}{ \foreach \col in {0,...,7}{ \fill[yellow] (\col*\dx, -\row*\dy) circle (\r); } } % --- ACCOLADE + tekst --- \draw[line width=1pt] (8.5, -0.3) -- (8.5, -3.7) decorate[decoration={brace, amplitude=8pt}]{(8.5,-3.7) -- (8.5,-0.3)}; \node[right] at (8.7, -2) {geen 6 gele}; \end{tikzpicture} \end{center} \end{document} Resulting in this figure Any suggestions?

  • Drawing a planar graph with loops [closed]
    by Trevor3 on April 4, 2026 at 11:57 am

    I have been trying to draw the following diagram in TikZ: I've tried my best to produce the above figure using Microsoft Paint but have no idea whatsoever how to do it in TikZ (though it doesn't look that complicated). Any help is greatly appreciated.

  • Draw a line wrap around cylinders [closed]
    by Hoàng on April 4, 2026 at 10:29 am

    I new to Tikz and want to draw an image like this: I have stuck to draw the line wrap around, it wraps exactly 10 rounds. Thank you many for help.

  • pgf-PeriodicTable: monochrome (black/white) Periodic table - problem with radiation symbol and 'Ra' shorthand
    by cis on April 4, 2026 at 6:57 am

    I want to create a perfect monochrome Periodic table (for black and white printing, etc.). 1/2. Instead of the colored "radioactive symbol" (which seems to be set hard-coded by the package), I'd like to use an asterisk '*' or a simple text character. 2/2. Secondly, the term 'Ra' in the legend must also be replaced by the star (or the other symbol used). Note: The aforementioned "radioactive symbol" seems to be (hard-coded) retrieved from the file /texmf-dist/tex/latex/pgf-periodictable/pgfPT_radio_symbol.pdf → which is located near the package file. One could therefore "hack" the problem by placing a PDF file with the same name in one's working directory. However, I'm wondering if there's a more elegant solution. PS: Since I'm not yet very familiar with the package, general suggestions for improvement are welcome. My progress so far: \documentclass[paper=a4, paper=landscape]{scrarticle} \usepackage[margin=11mm,showframe=false,]{geometry} \usepackage{lmodern} \usepackage{pgf-PeriodicTable} \begin{document} \pgfPT[ cell font=\sffamily,% normal LaTeX font (avoids font warnings of pgf-PeriodicTable) csSolid, show title=false, %Z list={1,...,36,87,88},% test Z backcolor=white, Z color=black, Z font=\footnotesize\bfseries, %CS render mode=fill and outline,% default CS outline color=black,% Outline always black CS solid=black, % Solid: black CS liquid=gray,% Liquid: gray CS synt=white,% Synthetic: white ("inline color") CS gas=lightgray,% Gaseous: white (only outline visible) light gray name color=black, name font=\fontsize{5.125pt}{6.125pt}\selectfont,% default: \tiny but seems to large Ar color=black, capitalize element names=true,% please! period label color=black,% Color of period numbers (left) group label color=black,% Color of group numbers (top) %legend radio color=red,% test MNM line width=1.4pt,% default: 0.8pt MNM line color=black,% default: red!80!black %show MNM line=false,% alternative ] \end{document} PPS: The star for "radioactive" is not that unusual.

  • tikz, multipart node: how to define height of empty part
    by Zarko on April 4, 2026 at 3:21 am

    My question is very similar to this question which unfortunately hasn't answered yet. in one comment is mentioned, that multi part node has a bug. Do anyone know, if meantime was this bug fixed or know some work around it? \documentclass[border=1mm, 11pt]{standalone} \usepackage{tikz} \usetikzlibrary{shapes.multipart} \begin{document} \begin{tikzpicture}[ MPNV/.style args = {#1/#2}{%, rectangle split parts=#1, text width=#2, shape=rectangle split, draw, rectangle split empty part height=7mm, rectangle split part fill={white, cyan!50}, inner sep=1mm, outer sep=0mm, align=center, }, ] \node [MPNV=2/7mm] {\nodepart{one} \rotatebox{90}{some test} \nodepart{two} }; \end{tikzpicture} \end{document} As temporary solution I insert in the second node part the rule \rule{0mm}{5mm}. However, I would be much happier, if I can add some fix to my document preamble. BTW, I use recent version of tikz: 3.1.11a from August 29, 2025.

  • pgf-PeriodicTable: Adjust font alignment (and color scheme)
    by cis on April 3, 2026 at 6:37 pm

    First of all: I've noticed that the search for pgf-PeriodicTable isn't currently yielding any significant results. I've created a new tag and hope to vitalize this wonderful package with this post; and I look forward to seeing many more great PTEs in the future. I want to create a very simple periodic table, similar to the one you find with a Google search (see image below); ideally, it should also use this color scheme for the text and background. I'm having a few problems with pgf-PeriodicTable: · How do I ensure that Z (in a slightly larger font) is perfectly left-aligned? · And that Ar is perfectly right-aligned? Since I am not very familiar with the package, suggestions for improvement of a general nature are welcome. My current approach: \documentclass[paper=a5]{scrarticle} \usepackage[margin=5mm, showframe=true, ]{geometry} \usepackage[en]{pgf-PeriodicTable} \begin{document} \pgfPTbuildcell(6,3)% [(1;1-2;Z), (1;2.5-3;Ar),% not sure but I set this (2-4;1-3;CS),(5-6;1-3;name) %,(4.75;1-3;radio)% do not know where to place best yet ] \pgfPTpreviewcell[1.8] \noindent\pgfPT[ % Common =========================== show title=false, show legend=false,% true does not work cell width=7.25mm, cell height=7.25mm, %back color scheme=Wikipedia, % Z =============================== Z font=\tiny\bfseries, Z backcolor=none, Z color=black, % Ar =============================== Ar font=\fontsize{4}{4}\selectfont, Ar precision=1, % names ============================ capitalize element names=true,% please! name font=\fontsize{3.5}{4}\selectfont, ] \end{document}

  • Draw a cage for Cuyes using tikz [closed]
    by Robert on April 3, 2026 at 3:15 pm

    I am a LaTeX newbie. Please, help me draw a cage to grow cuyes, with all the accesories. Thanks in advance.

  • Nicely organized graph representing Feynman
    by FishDrowned on April 3, 2026 at 1:26 pm

    I don't quite understand why the first node is no longer pointing toward $C_0$. How can I move $C_0$ to be on the far right side, still level with the first node (kind of looking like a trapezoid) while still connected to the first node? \documentclass{article} \usepackage{tikz} \usetikzlibrary{graphs} \begin{document} \begin{center} \scalebox{1.2}{ \tikz \graph [grow right sep]{ x1 [as =$\displaystyle \int_a^b{f(x)dx}$] -> {x2[as=$C_0$, red], x3[as=$F(t)$] -> x4[as=$F^\prime(t)$] -> x5[as=$\displaystyle \int{F^\prime(t)dt}$] -> x6[as=$C(t) + C_{1}$, red]->x2}; }; } \end{center} \end{document} This is what it currently looks like: This is the intended result (essentially, ignore the terrible drawing lol): Any help or a push toward some sort of useful resource is much appreciated.

  • How to colorized any line drawed with draw (nor with plot expression)?
    by Mika Ike on April 1, 2026 at 1:44 pm

    How to colorized any line drawed with draw (nor with plot expression)? \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ axis lines = middle, %title={Cor baseada no valor de $y$}, title={Color depending on $y$ coordinate}, colormap/hot % Podes usar 'hot', 'cool', 'jet', etc. ] \addplot[ mesh, % Divide o trazo en segmentos para aplicar cores thick, domain=-3:3, samples=100, point meta=y % Indica que a cor depende do valor de y ] {x^2}; % A función matemática \draw[thick, xshift=0.5,rounded corners] (-2,0.5) .. controls (0,-1) and (0,7) .. (1,7.8) .. controls (2,1) and (2,4) .. (3,3) node[anchor=east,pos=0.95] {How to colorize black line with colormap?} node[anchor=north east,pos=0.95] {depending on $y$ coordinate}; \end{axis} \end{tikzpicture} \end{document}

  • Retrieve coordinates of self-intersections of a curve
    by Ventrikle on April 1, 2026 at 11:06 am

    I am trying to extract the intersection points of a closed curve using the spath3 package. Currently, I have managed to find these points by splitting the path at self-intersections and then using the spath cs (coordinate system) on the resulting components. However, I noticed that the spath3 documentation doesn't seem to provide a direct command for "finding intersections" and returning them as coordinates. My current workaround involves a somewhat manual process: splitting the path, identifying components, and then grabbing the coordinates at the end of specific segments. Here is my MWE. \documentclass[tikz, border=10pt]{standalone} \usetikzlibrary{spath3, knots, hobby, intersections} \begin{document} \begin{tikzpicture}[ use Hobby shortcut, ] \path[spath/save=trefoil] ([closed]90:2) foreach \k in {1,...,3} {.. (-30+\k*240:.5) .. (90+\k*240:2) } (90:2); \tikzset{ spath/.cd, split at self intersections=trefoil, remove empty components=trefoil, get components of={trefoil}\pathcomponents, } % Label each component at its midpoint for reference \foreach[count=\k] \cpt in \pathcomponents { \node[] at (spath cs:{\cpt} 0.5) {\tiny \k}; } % Extracting coordinates before inserting gaps \foreach[count=\k] \i in {1, 3, 5} { \coordinate (A\k) at (spath cs:\getComponentOf{\pathcomponents}{\i} 1); } \tikzset{ % Gaps are inserted after coordinate retrieval. % If inserted earlier, spath cs would only capture positions within the fragmented arcs. spath/insert gaps after components={trefoil}{10pt}{1,3,5}, } \draw[spath/use=trefoil]; % Mark the original intersection points \foreach \k in {1,2,3} { \fill[red, opacity=0.5] (A\k) circle[radius=2pt] node[above, black, opacity=1] {\color{red}\(\k\)}; } \end{tikzpicture} \end{document} While this code works, it feels like a "workaround." Is there a more concise or idiomatic way to retrieve these intersection coordinates directly using spath3 or its integration with the intersections library?

  • Setting node style on specific slide, in a deferred manner
    by ysalmon on March 30, 2026 at 7:43 pm

    I want to animate a DFS in an example graph. I know I can use keys like onslide to activate specific styling on a given slide, but this requires to give the instruction at the place where the node is defined. I would like to be able to just specify the order in which DFS visits the nodes, eg. \foreach \val[count=\slide from 2] in {0,1,2,3,4,5,11,16,15,14,20,19,25,18,24,,31,30,,36,42,43,38,39,46,47,40,35,34,27} {set node l\val to be red-filled starting on slide \slide} I got the idea to use a expl3 proplist to store, on a given slide, which nodes should have which style (full code below). Then I can define a custom tikz style with some code to retrieve from the proplist and do a \pgfkeysalso. Presently, this works if I set the style to eg. fill. However, setting it to eg. fill=red gives an error Package pgfkeys Error: I do not know the key '/tikz/fill=red' and I am going to ignore it. Perhaps you misspelled it. I presume this is a catcode issue, but I am not able to solve it (I tried converting from tokenlist to expl3 string, to no avail). I know I can avoid the need for an = sign by defining a custom style with the appropriate colour (and this is better code style anyway). But still, this limitation is annoying. MWE : \documentclass{beamer} \usepackage{tikz} \ExplSyntaxOn \NewDocumentCommand{\DeferPropInit}{m} { \prop_gclear_new:c {__DeferPropList#1} } \NewDocumentCommand{\DeferPropReplace}{D<>{.-}mmm} { \only<#1>{\prop_gput:cee {__DeferPropList#2} {#3} {#4}} } % not used here, might be useful in other circumstances \NewDocumentCommand{\DeferPropAppend}{D<>{.-}mmm} { \only<#1>{\prop_get:ceNTF {__DeferPropList#2} {#3} \l_tmpa_tl {\prop_gput:cee {__DeferPropList#2} {#3} {\l_tmpa_tl, #4}} % #3 present in list {\prop_gput:cee {__DeferPropList#2} {#3} {#4}} % #3 not present in list } } \tikzset{DeferPropGet/.code~2~args = { \prop_get:ceNT {__DeferPropList#1} {#2} \l_tmpa_tl {\pgfkeysalso {\l_tmpa_tl}} }} % for debug \NewDocumentCommand{\DeferPropLog}{m}{\prop_log:c {__DeferPropList#1}} \ExplSyntaxOff \begin{document} \begin{frame} \begin{center} \begin{tikzpicture} \DeferPropInit{DFS} \foreach \val[count=\slide from 2] in {0,1,2,3,4,5,11,16,15,14,20,19,25,18,24,,31,30,,36,42,43,38,39,46,47,40,35,34,27} {\DeferPropReplace<\slide->{DFS}{l\val}{fill}} % breaks with {fill=red} %\DeferPropLog{DFS} % for debug \foreach \i in {0,...,5}{ \foreach \j in {0,...,7}{ \pgfmathtruncatemacro\eti{\i+\j*6} \draw(\j,-\i) node[DeferPropGet={DFS}{l\eti}] (l\eti) {\eti}; } } % graph edges omitted for brievety \end{tikzpicture} \end{center} \end{frame} \end{document}

  • What is a better approach to plot the double path style as a subpath?
    by Explorer on March 29, 2026 at 3:03 am

    I want to replicate something as below: Now is my code, but good with the conjunction (the double path's start and end, and the glitch of double), even with line join=round: \documentclass[tikz,border=5pt]{standalone} \begin{document} \begin{tikzpicture}[line join=round] \coordinate (start) at (0,1.5); \coordinate (end) at (0,0); \draw[magenta] (start) -- ++(3,0) coordinate (doublestart) ++(-.5,-1.5) coordinate (doubleend) -- (end); \draw[cyan,double,double distance=2.5pt] (doublestart) .. controls ++(.25,-.75) and ++(-.3,1) .. (doubleend) ; \end{tikzpicture} \end{document}

  • I am trying to make a really cool animation using Koch snowflakes, but don't know how
    by Jasper on March 22, 2026 at 3:28 pm

    I was scrolling through reels earlier and came across a really cool animation: https://www.youtube.com/shorts/aQbq_Fpyyb4. Note: You can analyze the gif frame by frame using the method suggested by MS-SPO in the comments, or by using the website ez-gif, or by using custom python scripts. I interchangeably use ez-gif and python for these sorts of things, and in this instance used ez-gif. I did some digging and found this old post, which I modified slightly. % Source - https://tex.stackexchange.com/a/205608 % Posted by Mark Wibrow % Retrieved 2026-03-22, License - CC BY-SA 3.0 \documentclass[tikz, border=5]{standalone} \usetikzlibrary{lindenmayersystems} \tikzset{koch snowflake/.style={insert path={% l-system [l-system={rule set={F -> F-F++F-F}, axiom=F++F++F, step=0.75cm/3^#1, angle=60, order=#1,anchor=center}] -- cycle}}} \begin{document} \begin{tikzpicture} \path[fill=orange,koch snowflake=4]; \end{tikzpicture} \end{document} I am however without a clue as to how to go about producing this gif I found. I am seeking assistance in creating this gif.

  • Putting two flowcharts on the same page side by side in Latex
    by Destr on January 31, 2026 at 12:27 pm

    So i have the following code in latex and i'm trying to put these two flowcharts side by side, for some reason i cant do that and instead one is on top of the other , i can't understand what i do wrong. Below is the code and here is the resulting image \documentclass{article} \usepackage[dvipsnames]{xcolor} \usepackage{tikz} \usetikzlibrary{arrows.meta, positioning, calc} \usepackage{xcolor} \usepackage{graphicx} \usetikzlibrary{shapes.geometric, arrows.meta, positioning,calc} \usepackage{algorithm} \usepackage{algorithmic} \begin{document} \begin{figure}[ht] \centering % ================= LEFT DIAGRAM ================= \begin{minipage}[t]{0.30\textwidth} \centering \begin{tikzpicture}[ scale=0.75, transform shape, node distance=1cm, every node/.style={font=\scriptsize}, block/.style={rectangle, draw, rounded corners, minimum width=2.6cm, minimum height=0.7cm, align=center}, adder/.style={circle, draw, minimum size=0.45cm, inner sep=0pt}, arrow/.style={->, thick} ] \tikzset{ inputoutput/.style={block, fill=cyan!40}, linear/.style={block, fill=green!40}, mixup/.style={block, fill=BrickRed!40}, penc/.style={block, fill=purple!40}, cmamba/.style={block, fill=red!40}, rms/.style={block, fill=yellow!40} } \node[inputoutput] (input) {Input}; \node[mixup, above=of input] (mixup) {Channel Mixup}; \node[linear, above=of mixup] (lin1) {Linear}; \node[penc, above=of lin1] (penc) {Positional Encoding}; \node[adder, above=of penc] (add) {$+$}; \node[cmamba, above=of add] (cmamba) {CMamba}; \node[rms, above=of cmamba] (rms) {RMS Norm}; \node[linear, above=of rms] (lin2) {Linear}; \node[inputoutput, above=of lin2] (output) {Output}; \draw[arrow] (input) -- (mixup); \draw[arrow] (mixup) -- (lin1); \draw[arrow] (lin1) -- (penc); \draw[arrow] (penc) -- (add); \draw[arrow] (add) -- (cmamba); \draw[arrow] (cmamba) -- (rms); \draw[arrow] (rms) -- (lin2); \draw[arrow] (lin2) -- (output); \draw[arrow] (input.east) -- ++(1.2,0) |- (add.east); \end{tikzpicture} \caption*{(a) Overall Architecture} \end{minipage} \hfill % ================= RIGHT DIAGRAM ================= \begin{minipage}[t]{0.30\textwidth} \centering \begin{tikzpicture}[ scale=0.7, transform shape, node distance=0.45cm, every node/.style={font=\scriptsize}, block/.style={rectangle, draw, rounded corners, minimum width=3.2cm, minimum height=0.7cm, align=center}, mult/.style={circle, draw, minimum size=0.45cm, inner sep=0pt}, arrow/.style={->, thick} ] \node[block, fill=green!40] (linL) {Linear}; \node[block, fill=RoyalBlue!40, above=of linL] (conv) {Conv1D}; \node[block, fill=magenta!40, above=of conv] (siluL) {SiLU}; \node[block, fill=red!40, above=of siluL] (ssm) {SSM}; \node[block, fill=green!40, right=0.8cm of linL] (linR) {Linear}; \node[block, fill=magenta!40, above=of linR] (siluR) {SiLU}; \node[mult] (mult) at ($(ssm.north)!0.5!(siluR.north) + (0,2cm)$) {$\times$}; \draw[arrow] (linL) -- (conv); \draw[arrow] (conv) -- (siluL); \draw[arrow] (siluL) -- (ssm); \draw[arrow] (linR) -- (siluR); \draw[arrow] (ssm.north) |- (mult.west); \draw[arrow] (siluR.north) |- (mult.east); \node[block, fill=yellow!40, above=0.4cm of mult] (rms2) {RMS Norm}; \draw[arrow] (mult) -- (rms2); \end{tikzpicture} \caption*{(b) CMamba Block (Expanded)} \end{minipage} \caption{Overview of the model architecture and the internal structure of the CMamba block.} \label{fig:cmamba_combined} \end{figure} \end{document}

  • How is It possible to draw 2 merging spherical caps with tikz?
    by Waxler on February 15, 2024 at 2:34 pm

    I am trying to reproduce a figure using only tikz. I have produced the figure using Inkscape but I am wondering if I can do it fully in Latex. This is the aimed figure : And with the help of some contributors here, I was able to reproduce the big lines of the figure by running this code : \documentclass{article} \usepackage{tikz} \usepackage{xcolor} \tikzset{hemisphere/.style={#1,shading=ball,ball color=#1,fill opacity=0.75}} \usepackage{tikz-3dplot} \tdplotsetmaincoords{60}{110} \usetikzlibrary{3d,perspective} \begin{document} \begin{figure}[h] \centering \begin{tikzpicture}[isometric view,rotate around z=-90,line cap=round,line join=round] % some dimensions \pgfmathsetmacro\r{1} % radius \pgfmathsetmacro\d{1.9} % distance between centers \pgfmathsetmacro\a{acos(\d/(2*\r)} % angle \pgfmathsetmacro\jr{sqrt(\r*\r-0.25*\d*\d)} % join radius % x-axis and centers \draw[canvas is xy plane at z=0,scale=1.5,fill=gray!7.5] (-\r,-\r) rectangle (\d+\r,\r); \draw[-latex] (0,0) -- (3.5*\r,0) node[right] {$x$}; \draw[dashed,-latex] (0,0) -- (0,2.5*\r) node[right] {$y$}; \draw[-latex] (0,0) -- (-2,2*\r)node[right] {$z$} {[canvas is yz plane at x=0]}; \foreach\i in {0,1} \fill (\i*\d,0) circle (0.2mm); % left hemisphere \draw[black,thin] (225:\r) arc (225:45:\r); \draw[hemisphere=blue,scale = 1] (225:\r) arc (225:360-\a:\r) {[canvas is yz plane at x=0.5*\d] arc (180:0:\jr)} arc (\a:45:\r) arc (0:180:\r cm); % right hemisphere \draw[black,thin] (\d,0) ++ (225:\r) arc (225:180+\a:\r) {[canvas is yz plane at x=0.5*\d] arc (180:0:\jr)} arc (180-\a:45:\r); \draw[hemisphere=green] (\d,0) ++ (225:\r) arc (225:405:\r) arc (0:180:\r cm); \draw[dashed,black,thin]{[canvas is yz plane at x=1.8] (0.05,0) ++ (180:0.95) arc (180:0:0.95)}; \draw[stealth-stealth,red,ultra thin] (1.9,0,0) -- (1.3,1.05,0.3)node[below right,pos = 0.5,scale = 0.3,red] {$a$} {[canvas is yz plane at x=1.8]}; \draw[stealth-stealth,red,ultra thin] (1,0,0) -- (1,0,0.35)node[below right,pos = 0.85,scale = 0.3,red] {$h_0$} {[canvas is yz plane at x=0.5*\d]}; \draw[-latex] (0,0,1.223*\r) -- (-2,2*\r) {[canvas is yz plane at x=0]}; \end{tikzpicture} \end{figure} \end{document} Which gives something like this : You can notice that is somehow similar but my question is : is it possible to draw something that is not fully spherical ? Much more like a spherical cap rather than a full semi-spherical shape ? I have tried to play with the position of the xy plane but I think the problem is with the package \tikzset{hemisphere} Any help/advice would be appreciated ! Thank you in advance, Best regards. UPDATE : I tried to follow the same procedure as the post suggested in the comments this post but didn't manage to do it correctly. I know that I have to get rid of the \draw[hemisphere..] and replace it with another line. My attempt is this but don't work at all : \documentclass{article} \usepackage{tikz} \usepackage{xcolor} \tikzset{hemisphere/.style={#1,shading=ball,ball color=#1,fill opacity=0.75}} \usepackage{tikz-3dplot} \tdplotsetmaincoords{60}{110} \usetikzlibrary{3d,perspective} \usetikzlibrary{shadings} \begin{document} \begin{figure}[h] \centering \begin{tikzpicture}[isometric view,rotate around z=-90,line cap=round,line join=round] % some dimensions \pgfmathsetmacro\r{1} % radius \pgfmathsetmacro\d{1.9} % distance between centers \pgfmathsetmacro\a{acos(\d/(2*\r)} % angle \pgfmathsetmacro\jr{sqrt(\r*\r-0.25*\d*\d)} % join radius % x-axis and centers \draw[canvas is xy plane at z=0,scale=1.5,fill=gray!7.5] (-\r,-\r) rectangle (\d+\r,\r); \draw[-latex] (0,0) -- (3.5*\r,0) node[right] {$x$}; \draw[dashed,-latex] (0,0) -- (0,2.5*\r) node[right] {$y$}; \draw[-latex] (0,0) -- (-2,2*\r)node[right] {$z$} {[canvas is yz plane at x=0]}; \foreach\i in {0,1} \fill (\i*\d,0) circle (0.2mm); % left hemisphere \draw[black,thin] (225:\r) arc (225:45:\r); \shade[ball color=green!50!blue] (0,0) ++ (225:\r) arc (225:0:\r) -- cycle; % right hemisphere \draw[black,thin] (\d,0) ++ (225:\r) arc (225:180+\a:\r) {[canvas is yz plane at x=0.5*\d] arc (180:0:\jr)} arc (180-\a:45:\r); \shade[ball color=green!50!blue] (\d+\r,0) arc (0:180:\r) -- cycle; \draw[dashed,black,thin]{[canvas is yz plane at x=1.8] (0.05,0) ++ (180:0.95) arc (180:0:0.95)}; \draw[stealth-stealth,red,ultra thin] (1.9,0,0) -- (1.3,1.05,0.3) node[below right,pos=0.5,scale=0.3,red] {$a$} {[canvas is yz plane at x=1.8]}; \draw[stealth-stealth,red,ultra thin] (1,0,0) -- (1,0,0.35) node[below right,pos=0.85,scale=0.3,red] {$h_0$} {[canvas is yz plane at x=0.5*\d]}; \draw[-latex] (0,0,1.223*\r) -- (-2,2*\r) {[canvas is yz plane at x=0]}; \end{tikzpicture} \end{figure} \end{document}

  • Tikz symbols over colors in table
    by David Moldes on November 14, 2023 at 1:53 pm

    I am using the tikz package to create checkmarks and crosses, but if I color the rows, then they are only partially seen. Here is a minimal working example: \documentclass[table]{article} \usepackage{graphicx, xcolor} % Required for inserting images \usepackage{tabularx,booktabs} \usepackage{amsmath,amsfonts,amssymb,amscd,amsthm} \usepackage{multirow} \usepackage{array} \usepackage{multicol} \definecolor{DarkGreen}{rgb}{0.0, 0.5, 0.0} \definecolor{DarkRed}{rgb}{0.76, 0.13, 0.28} \definecolor{lavender}{rgb}{0.9, 0.9, 0.98} \usepackage{tikz} \def\checkmark{\color{DarkGreen}\tikz\fill[scale=0.4](0,.35) -- (.25,0) -- (1,.7) -- (.25,.15) -- cycle;} \def\cross{\color{DarkRed}$\mathbin{\tikz [x=1.4ex,y=1.4ex,line width=.2ex, red] \draw (0,0) -- (1,1) (0,1) -- (1,0);}$} \begin{document} \begin{table}[] \begin{tabular}{lccccc} \toprule & \multicolumn{3}{c}{\textbf{Proteins}} & \textbf{CHs} & \multicolumn{1}{l}{} \\ \cline{2-5} \multicolumn{1}{c}{\textbf{DES}} & \textit{BCA Microplate} & \textit{BCA 1 mL} & \textit{Bradford} & \textit{Dubois} & \textit{\textbf{Apt?}} \\ \toprule \rowcolor{lavender} \textit{ChCl:Lactic acid} & -22,6\% & 13,2\% & 15,0\% & 4,3\% & \multirow{2}{*}{\checkmark} \\ \rowcolor{lavender} \textit{ChCl:Lactic acid} & -32,0\% & 6,3\% & -7,5\% & 12,9\% & \\ \textit{ChCl:2Lactic acid} & -43,6\% & 8,3\% & 10,8\% & 11,9\% & \multirow{2}{*}{\checkmark} \\ \textit{ChCl:2Lactic acid} & -46,7\% & -2,0\% & -3,1\% & 20,8\% & \\ \rowcolor{lavender} \textit{ChCl:3Lactic Acid} & -41,7\% & 6,4\% & 5,9\% & 12,9\% & \multirow{2}{*}{\checkmark} \\ \rowcolor{lavender} \textit{ChCl:3Lactic Acid} & -51,1\% & -1,6\% & 3,9\% & 35,1\% & \\ \textit{ChCl:6Lactic Acid} & -57,3\% & -3,3\% & 3,1\% & 42,9\% & \multirow{2}{*}{\cross} \\ \textit{ChCl:6Lactic Acid} & -54,6\% & -1,1\% & 6,4\% & 28,0\% & \\ \bottomrule \end{tabular} \end{table} \end{document}

  • Animated Brownian motion with fading
    by JeT on June 9, 2023 at 8:28 am

    I try to reproduce this interesting visual on brownian motion and to make an animation out of it. \documentclass[10pt]{standalone} \usepackage{tikz} \usetikzlibrary{fadings} \begin{document} \begin{tikzpicture} \foreach \Y in {1,...,10} {\draw[path fading=west] (3*rnd,1-2*rnd) foreach \X in {1,...,100} {-- ++ (0.05,0.2-0.4*rnd)}; } \end{tikzpicture} \end{document} This is only the first step to get an Animation I have no idea on how to move forward though :/ Source. BrownianMotion

  • How to make those lines in Tikz?
    by Mordecai on March 14, 2023 at 10:03 am

    Here the lines: I have no idea how to make the little bump. If only it were straight lines 🙂 Colors are: green: #9DC634 orange: #F39614 pink: #F39614 purple: #AB7CB5 Thanks for your help

  • How to change the color and arrow of the circular diagram of the smartdiagram
    by user12585 on July 18, 2021 at 12:17 pm

    https://texdoc.org/serve/smartdiagram/0 page 4 has a basic circular diagram. \begin{center} \smartdiagram[circular diagram]{Set up,Run,Analyse,Modify~/ Add} \end{center} I want to set each box shape rectangle without any shades each box has no filling color (transparent) arrow color black and a direct edge Please advise.

  • Is there a bug in the `arrows.meta` or `bending` library with the `double` option in TikZ 3.1.5b?
    by AndréC on July 10, 2020 at 4:56 pm

    When the bending library is loaded, the double arrows are no longer attached to the line. \documentclass[tikz,border=5mm]{standalone} \usetikzlibrary{bending} \usetikzlibrary{arrows.meta} \begin{document} \begin{tikzpicture}[] % Old arrows library prior to Tikz 3.0 \begin{scope}[>=latex] \draw (90:1.5)--(0,0)--(0:1.5); \draw [blue,,->] (0:5mm)arc[start angle=0,delta angle=90,radius=5mm]; \draw [red,double,->] (0:10mm)arc[start angle=0,delta angle=90,radius=10mm]; \node[align=left,anchor=west] at (0,-1){With old library\\ arrows no bug}; \end{scope} % New arrows.meta library introduced with Tikz 3.0 \begin{scope}[>={Triangle[]},xshift=4cm] \draw (90:1.5)--(0,0)--(0:1.5); \draw [blue,,->] (0:5mm)arc[start angle=0,delta angle=90,radius=5mm]; \draw [red,double,->] (0:10mm)arc[start angle=0,delta angle=90,radius=10mm]; \end{scope} \begin{scope}[>=Stealth,xshift=6cm] \draw (90:1.5)--(0,0)--(0:1.5); \draw [blue,,->] (0:5mm)arc[start angle=0,delta angle=90,radius=5mm]; \draw [red,double,->] (0:10mm)arc[start angle=0,delta angle=90,radius=10mm]; \node[align=left,anchor=center] at (0,-1){With new library\\ arrows.meta: bug}; \end{scope} \end{tikzpicture} \end{document}

  • pdflatex not working anymore after updating pdflatex.ini and initexmf --dump=pdflatex
    by user140574 on August 3, 2017 at 10:36 am

    I tried to overcome the well known tex capacity exceed problem, when using large Surf-plot with many datapoints. I tried this by typing into the cmd (Windows 7, MikTex 2.9): initexmf --edit-config-file=pdflatex main_memory=5000000 extra_mem_bot=5000000 font_mem_size=5000000 pool_size=5000000 buf_size=5000000 **initexmf --dump=pdflatex** Now, pdflatex does not work anymore, a dvi is built, but no output. The log also says that the system maybe just failed. pdflatex is broke... Any Ideas? (I cannot think of a proper MWE.)

  • Creating a triangular table
    by soandos on April 26, 2013 at 3:01 am

    Is there a way to create something that looks like this? I have looked at the \rotatebox command, but that will not get the same "jagged" edges on the bottom, and looked at How to draw a diagonally-split grid with TikZ? which seems applicable (especially in conjunction with the \rotatebox). I was able to make this: With code adapted from the link, but I have no idea how to customize it. \documentclass[12pt]{article} \usepackage[english]{babel} \usepackage{amsfonts} \usepackage{tikz} \usepackage{rotating} \usetikzlibrary{calc,decorations.shapes} \tikzset{ decorate with/.style args={#1 separated by #2}{ fill, decorate,decoration={shape backgrounds,shape=#1,shape size=1.5mm, shape sep={#2, between borders}} } } \pgfkeys{/tikz/.cd, num quad/.initial=5, num quad/.get=\numquad, num quad/.store in=\numquad, } \begin{document} \usetikzlibrary{calc,decorations.shapes} \rotatebox{315}{\begin{tikzpicture}[x=0.5025cm,y=0.5025cm,line cap=round] \foreach \x [count=\xi] in {1,...,\numquad}{ \foreach \y [count=\yi] in {\x,...,\numquad}{ \node [draw, minimum size=0.5cm,outer sep=0pt,inner sep=0pt] (u-\xi\yi) at (\xi,-\yi) {}; } } \end{tikzpicture} } \end{document}

  • How can I draw a vertical line in a table cell?
    by kloop on November 30, 2012 at 1:06 am

    I hope the explanation will be clear: I have a table with 4 rows, and one of the columns there is a value that is identical in all rows. I want instead of copying it 4 times for each row, just put it in the middle (between the 2nd and 3rd row) and have two vertical lines stretching above and below it up to to the 1st row and 4th row. I managed to put the number using multirow in the middle, but I don't know how to draw the two vertical lines. Any ideas? EDIT: I want the vertical lines to stretch from the middle above the number -- up and one from the middle below the number down.

  • TiKZ decoration doesn't work
    by Turion on May 17, 2011 at 5:05 pm

    I am trying to get TikZ decorations to work, but so far without success. In this minimal example, I am trying to compile an example found in pgfmanual.pdf in section 20.2: \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations} \begin{document} \begin{tikzpicture} \draw decorate [decoration=zigzag] {(0,0) -- (2,2)}; \end{tikzpicture} \end{document} I always get this error "! Package pgfkeys Error: I do not know the key '/pgf/decoration/crosses' and I am going to ignore it. Perhaps you misspelled it." What is the problem?