pgfplots
- Graph not getting plotted properly in tikz [closed]by aimalik on May 30, 2025 at 4:04 pm
Hi I'm trying to plot the following function using Tikz in overleaf: \frac{\left(4x+2\right)}{x^{2}+4x-5} Here's my code: \begin{center} \begin{tikzpicture} \begin{axis}[ axis lines = left, xlabel = \(q\), ylabel = {\(C\)}, xmin=0, ymin=0, ymax=10, ] %Below the red parabola is defined \addplot [ range=0:10, domain=0:10, samples=100, color=red, ] {((4*x)+(2))/((x^2)+(4*x)+(5))}; \addlegendentry{\(C=\frac{4x+2}{x^2+4x-5}\)} \end{axis} \end{tikzpicture} \end{center} It's not plotting the function correctly. Will be grateful for any help.
- \pgfplotsset size gets ignoredby KeynesCoeFen on May 29, 2025 at 10:01 pm
I am trying to use the \pgfplotsset to set the size. Unfortunately, the command seems to have no effect. A MWE is below. Can you help me change the code so that I can use the command \pgfplotsset{width=5cm,height=20cm,compat=1.9} to influence the size of the plot? \documentclass{article} \usepackage[margin=0.25in]{geometry} \usepackage{pgfplots} \pgfplotsset{width=5cm,height=20cm,compat=1.9} % We will externalize the figures \usepgfplotslibrary{external} \tikzexternalize \begin{document} These plots should be resized. Yet, even clownishly large dimensions have no consequence. %Here begins the 2D plot \begin{table} \caption{this is close to my use case.} \centering \begin{tabular}{ccc} \begin{tikzpicture} \begin{axis} \addplot[color=red]{exp(x)}; \end{axis} \end{tikzpicture} %Here ends the 2D plot & & %Here begins the 3D plot \begin{tikzpicture} \begin{axis} \addplot3[ surf, ] {exp(-x^2-y^2)*x}; \end{axis} \end{tikzpicture} \\ (a) Annoyingly mis-sized plot. & & (b) Another annoyingly mis-sized plot. \\ \end{tabular} \end{table} \end{document}
- Axis break on stacked and grouped bar plotby mnmbs on May 29, 2025 at 7:06 pm
I am trying to make a stacked and grouped bar plot with an axis break on the y axis. I am almost there, but I noticed a weird behaviour. The stacked items are not shown in the correct order. For example in the code below the crosshatched patterned item should be at the bottom but instead it is at the top. Any ideas why the stacked items are not showing in the correct order? Any help is appreciated 🙂 % Colors \definecolor{color3}{HTML}{33a02c} \definecolor{color2}{HTML}{ff7f00} \definecolor{color1}{HTML}{ee3377} \begin{figure} \centering \begin{tikzpicture} \begin{groupplot}[ group style={ group size=1 by 2, vertical sep=0pt }, ybar, symbolic x coords={Data1, Data2}, xtick=data, enlarge x limits=0.2, xlabel={Datasets}, ylabel={Total Time (sec)}, legend style={at={(0.5,-0.15)},anchor=north,legend columns=3}, legend cell align=left ] \nextgroupplot[ ymin=30, ymax=40, ytick={35,40}, axis x line*=top, axis y discontinuity=parallel, xtick=\empty ] % 1st bar \addplot[fill=color1, postaction={pattern=crosshatch}, bar shift=-10pt] coordinates {(Data1,1.142) (Data2,0.62354)}; \addplot[fill=color1, postaction={pattern=north east lines}, bar shift=-10pt] coordinates {(Data1,5e-06) (Data2,3e-06)}; \addplot[fill=color1, postaction={pattern=crosshatch dots}, bar shift=-10pt] coordinates {(Data1,0) (Data2,17.326)}; \addplot[fill=color1, postaction={pattern=north west lines}, bar shift=-10pt] coordinates {(Data1,0) (Data2,1.9005)}; % 2nd bar \addplot[fill=color3, postaction={pattern=crosshatch}, bar shift=0pt] coordinates {(Data1,0) (Data2,0)}; \addplot[fill=color3, postaction={pattern=north east lines}, bar shift=0pt] coordinates {(Data1,0) (Data2,0)}; \addplot[fill=color3, postaction={pattern=crosshatch dots}, bar shift=0pt] coordinates {(Data1,0) (Data2,34.2315)}; \addplot[fill=color3, postaction={pattern=north west lines}, bar shift=0pt] coordinates {(Data1,0) (Data2,2.56667)}; % 3rd bar \addplot[fill=color2, postaction={pattern=crosshatch}, bar shift=10pt] coordinates {(Data1,1.142) (Data2,0.83083)}; \addplot[fill=color2, postaction={pattern=north east lines}, bar shift=10pt] coordinates {(Data1,5e-06) (Data2,6e-06)}; \addplot[fill=color2, postaction={pattern=crosshatch dots}, bar shift=10pt] coordinates {(Data1,0) (Data2,0)}; \addplot[fill=color2, postaction={pattern=north west lines}, bar shift=10pt] coordinates {(Data1,0) (Data2,0)}; %%% BOTTOM PLOT (LOW VALUES) \nextgroupplot[ ymin=0, ymax=4, axis x line*=bottom ] % 1st bar \addplot[fill=color1, postaction={pattern=crosshatch}, bar shift=-10pt] coordinates {(Data1,1.142) (Data2,0.62354)}; \addplot[fill=color1, postaction={pattern=north east lines}, bar shift=-10pt] coordinates {(Data1,5e-06) (Data2,3e-06)}; \addplot[fill=color1, postaction={pattern=crosshatch dots}, bar shift=-10pt] coordinates {(Data1,0.873583) (Data2,4)}; % clipped at 4 \addplot[fill=color1, postaction={pattern=north west lines}, bar shift=-10pt] coordinates {(Data1,0.181732) (Data2,0)}; % 2nd bar \addplot[fill=color3, postaction={pattern=crosshatch}, bar shift=0pt] coordinates {(Data1,0) (Data2,0)}; \addplot[fill=color3, postaction={pattern=north east lines}, bar shift=0pt] coordinates {(Data1,4e-06) (Data2,1.5e-05)}; \addplot[fill=color3, postaction={pattern=crosshatch dots}, bar shift=0pt] coordinates {(Data1,2.88893) (Data2,4)}; % clipped at 4 \addplot[fill=color3, postaction={pattern=north west lines}, bar shift=0pt] coordinates {(Data1,0.192377) (Data2,0)}; % 3rd bar \addplot[fill=color2, postaction={pattern=crosshatch}, bar shift=10pt] coordinates {(Data1,1.142) (Data2,0.83083)}; \addplot[fill=color2, postaction={pattern=north east lines}, bar shift=10pt] coordinates {(Data1,5e-06) (Data2,6e-06)}; \addplot[fill=color2, postaction={pattern=crosshatch dots}, bar shift=10pt] coordinates {(Data1,0.873583) (Data2,0.88308)}; \addplot[fill=color2, postaction={pattern=north west lines}, bar shift=10pt] coordinates {(Data1,0.181732) (Data2,0.072528)}; \end{groupplot} \end{tikzpicture} \end{figure} output: For reference, my version of the code without the axis break gives the following output:
- tikz/pgfplot How to read color of each bar in ybar plot from csv fileby RBredereck on May 29, 2025 at 2:29 pm
I have the code which defines more or less exactly how my plot should look like. However, the colors of the bars are hard-coded by the x-range. I would like it to be read out from the csv-file. I read and tried several options, but it looks quite tricky. Does anyone know an elegant way? \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \usepackage{pgfplotstable} \usepackage{filecontents} \begin{filecontents*}{bardata.csv} label,x,y,color {(2,0)},0,0.505,steelblue {(2,19)},1,0.4075,steelblue {(2,38)},2,0.32625,steelblue {(2,57)},3,0.1725,steelblue {(2,76)},4,0.105,steelblue {(2,95)},5,0.02,steelblue {(3,0)},6,0.3475,lightsteelblue {(3,19)},7,0.2875,lightsteelblue {(3,38)},8,0.22125,lightsteelblue {(3,57)},9,0.1475,lightsteelblue {(3,76)},10,0.08,lightsteelblue {(3,95)},11,0.025,lightsteelblue \end{filecontents*} \pgfplotsset{compat=1.17} \begin{document} \begin{tikzpicture} \definecolor{darkgray176}{RGB}{176,176,176} \definecolor{lightsteelblue}{RGB}{174,199,232} \definecolor{steelblue}{RGB}{31,119,180} % Einlesen der CSV-Datei \pgfplotstableread[col sep=comma]{bardata.csv}\datatable \begin{axis}[ tick align=outside, tick pos=left, title={Plot Title}, x grid style={darkgray176}, xlabel={X-Axis}, xlabel style={yshift=-5pt}, xtick=data, xticklabels from table={\datatable}{label}, % xticklabels aus der CSV direkt xticklabel style={font=\scriptsize, rotate=40.0, anchor=east, xshift=2pt}, y grid style={darkgray176}, ylabel={Y-Axis}, ymin=0, ytick style={color=black}, enlarge x limits={abs=1.1} ] % Zahlenlabels über den Balken fettdruck \addplot[ only marks, nodes near coords, every node near coord/.append style={font=\bfseries, scale=0.5, anchor=north, yshift=1pt, text=white}, nodes near coords={\pgfmathprintnumber[fixed, precision=2,assume math mode=true]{\pgfplotspointmeta}} % explizite Einstellung zum Fettdruck ] table[x=x, y=y, meta=y] {\datatable}; % Balken und Zahlenlabels zeichnen \addplot[ ybar, bar width=0.8, fill=lightsteelblue, restrict x to domain=6:11 ] table[x=x, y=y] {\datatable}; \addplot[ ybar, bar width=0.8, fill=steelblue, restrict x to domain=0:5 ] table[x=x, y=y] {\datatable}; \end{axis} \end{tikzpicture} \end{document}
- Removing a specific part of the shaded region in LaTeXby andorooo on May 26, 2025 at 2:14 am
I'm having some trouble with my code. I wish for there to be a shaded region between the two curves and to be above the x-axis, but I end up with a shaded region outside of the two curves too. I was just wondering how to remove that part given the code I have below? Thanks! \begin{tikzpicture} \begin{axis}[ axis lines=middle, xmin=-0.2, xmax=2, ymin=-3, ymax=5, xtick={1}, ytick={2}, xticklabels={$1$}, yticklabels={$2$}, xlabel={$x$}, ylabel={$y$}, samples=300, width=12cm, height=8cm, clip=false, axis line style={->}, tick style={black} ] % Define all 3 paths \addplot [ name path=A, domain=0.1:1, draw=none ] {ln(x)/ln(3) + 2}; \addplot [ name path=B, domain=0.1:1, draw=none ] {4*x^3 - 2}; \addplot [ name path=C, domain=0.1:1, draw=none ] {0}; % x-axis % Fill between f(x) and g(x), clipped above y = 0 \addplot [ fill=gray, opacity=0.3 ] fill between[ of=A and B, soft clip={domain=0.1:1} ]; \addplot [ fill=gray, opacity=0.3 ] fill between[ of=A and C, soft clip={domain=0.1:1} ]; \addplot [ fill=white ] fill between[ of=B and C, soft clip={domain=0.1:0.7937} ]; % Plot functions \addplot[thick, ->, domain=0:1.2] {ln(x)/ln(3) + 2} node[pos=0.95, below right] {$f(x)=\log_3 x + 2$}; \addplot[thick, ->, domain=0:1.2] {4*x^3 - 2} node[pos=0.85, above right] {$g(x)=4x^3 - 2$}; % Dashed lines and point \draw[dashed] (axis cs:1,0) -- (axis cs:1,2); \draw[dashed] (axis cs:0,2) -- (axis cs:1,2); \filldraw[black] (axis cs:1,2) circle (2pt) node[above right]{$P$}; % Rotation arrow \draw[->, thick] (axis cs:0.02,2.5) arc[start angle=80, end angle=-260, x radius=0.1, y radius=0.09]; \end{axis} \end{tikzpicture} \end{center}
- Bug in pgfplots? "xticklabels" considers order in csv while "symbolic x coords" does notby nopx on May 19, 2025 at 11:47 am
For barplots: I found that xticklabels does considers the order in the csv files while symbolic x coords` does not. This leads to situations where incorrect data is displayed. That is the ticks do not appear for the correct data. In the below example it shows the value two for metric C, even though the value in the csv is three. What am I doing wrong? How to fix this? Here is a minimal example: \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \iftrue % If true, the displayed data is wrong! The alternative is just two rows flipped, see below. \begin{filecontents*}{data.csv} ,methodA,methodB,methodC metricA,1,1,1 metricC,3,3,3 metricB,2,2,2 \end{filecontents*} \else \begin{filecontents*}{data.csv} ,methodA,methodB,methodC metricA,1,1,1 metricB,2,2,2 metricC,3,3,3 \end{filecontents*} \fi \begin{document} \pgfplotstableread[col sep = comma]{data.csv}\table \begin{tikzpicture} \begin{axis}[ ybar, symbolic x coords={metricA,metricB,metricC}, xticklabels={A,B,C}, xtick=data, ] \addplot [fill=red ] table [x index=0, y=methodA] {\table}; \addplot [fill=blue ] table [x index=0, y=methodB] {\table}; \addplot [fill=green] table [x index=0, y=methodC] {\table}; \end{axis} \end{tikzpicture} \end{document} If we extend the example to 6 different rows, it become even more confusing. \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \begin{filecontents*}{data.csv} ,methodA,methodB,methodC A,1,1,1 B,2,2,2 D,4,4,4 E,5,5,5 F,6,6,6 C,3,3,3 \end{filecontents*} \begin{document} \pgfplotstableread[col sep = comma]{data.csv}\table \begin{tikzpicture} \begin{axis}[ ybar, symbolic x coords={A,B,C,D,E,F}, xtick=data, xticklabels={A,B,C,D,E,F}, ] \addplot [fill=red ] table [x index=0, y=methodA] {\table}; \addplot [fill=blue ] table [x index=0, y=methodB] {\table}; \addplot [fill=green] table [x index=0, y=methodC] {\table}; \end{axis} \end{tikzpicture} \end{document} The xticklabels seems to be completely confused about the labels. I don't see any pattern anymore ... Please, does anyone understand this?
- Howto plot a step function with pgflot? [closed]by katang on May 17, 2025 at 3:25 pm
I want to plot a step-like function from a table. Step like means that two consecutive points have the same ordinate value. As I noticed, pgfplot somehow optimizes out the vertical line and replaces it with a line from its neighbor; that is not vertical. Is there some internal switch to get rid off this? (I mean, instead of making that section manually, as two plots) The 1st column is time, and at the time 0.52 a sudden jump (much shorter that the time step) happens. By default, the system draws a sloping line. I attempted to duplicate the time value, but it dues not work. I wanted to suggest that Actually, I have a .csv data file a,b,c,d,e,f,g,h,i,j,k 0.000,0,0,0,0,0,1, 0.008,7.64292,0,0,0.0701185,+0.0701185,1, 0.018,7.30177,0,0,0.0669887,+0.0669887,1, 0.026,14.8236,0,0,0.135997,+0.135997,1, 0.036,14.162,0,0,0.129926,+0.129926,1, 0.042,21.367,0,0,0.196028,+0.196028,0, 0.052,21.367,0,0,0.196028,+0.196028,0, 0.052,27.47,2.76335,2.35194,0.230441,2.1215,0, 0.062,37.4732,7.20964,2.24504,0.323194,1.92185,0,
- How to add two reference lines in a plot using extra y ticks in different colours?by Fathima Thekkekara on May 17, 2025 at 7:46 am
I cannot change the title with scaling. \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ width=10cm, height=6cm, domain=0:2, samples=20, ymin=0, ymax=4, % Add extra y ticks extra y ticks={0.5, 0.75}, extra y tick labels={$0.5$, $0.75$}, % Explicitly style the extra y ticks extra y tick style={grid=major,ticklabel style={font=\small}, color=red},major grid style={thick,dashed,draw=green},tick style={thick,red}, %dash pattern=on 1pt off 3pt, ] % Plot x^2 curve \addplot[blue, thick] {x^2}; \end{axis} \end{tikzpicture} \end{document} The above code works perfectly but with the same color (green) for both extra horizontal lines. I tried the following code to specify different colors to each horizontal lines \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ width=10cm, height=6cm, domain=0:2, samples=20, ymin=0, ymax=4, % Add extra y ticks extra y ticks={0.5, 0.75}, extra y tick labels={$0.5$, $0.75$}, extra y tick style list={grid=major {draw=cyan, line width=1.5pt, dashed, ticklabel style={cyan}}, {draw=magenta, line width=1.5pt, dash dot, ticklabel style={magenta}} }, ] % % Plot x^2 curve \addplot[blue, thick] {x^2}; \end{axis} \end{tikzpicture} \end{document} But no horizontal line appeared -- only the x^2 plot in blue appears.
- pgfplots 3d schoolbook style (grid/tick marks)by Sammy on May 16, 2025 at 3:48 pm
I'm trying to recreate the look of a 3D coordinate system as used in German schoolbooks. Below, I've included a minimal working example (MWE). The code that handles the grid and tick marks is quite lengthy, and my implementation isn’t very robust when it comes to making changes. Is there a simpler and more reliable way to achieve the desired result using pgfplots, particularly regarding the style and placement of tick marks and the background grid? I considered modifying the tick mark style, but as far as I can tell, there's no built-in option for this. (Avoid multiple tick marks in 3D tikz plot). I looked through the source code of pgfplots for a code piece I could patch, but I wasn't able to understand what's going on. It seems in an earlier version of pgfplots there was a bug that kind of "implemented" the tick mark style I'm looking for: Uniform appearance of tick marks in 3d pgfplot? Fix: https://github.com/pgf-tikz/pgfplots/commit/47a07927c46ecbdcd8a982c90c922bc4925e828b Is there a way to access the tick positions directly directly? Is there an easier option to have the tick marks always have length 0.1 inch regardless what value the ytick distance is? In the target style, the orientation of the axes will always be the same as shown in the example, and the distance between two grid lines should always be 5 mm. I’d like to retain this consistent layout while being able to freely adjust other parameters in the plot. Any other suggestions or improvements are very welcome. \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \newcommand{\unitvectorx}{(\pgfkeysvalueof{/pgfplots/minor x tick num} + 1)*0.5/\pgfkeysvalueof{/pgfplots/xtick distance}} \newcommand{\unitvectory}{(\pgfkeysvalueof{/pgfplots/minor y tick num} + 1)*0.5/\pgfkeysvalueof{/pgfplots/ytick distance}} \newcommand{\unitvectorz}{(\pgfkeysvalueof{/pgfplots/minor z tick num} + 1)*0.5/\pgfkeysvalueof{/pgfplots/ztick distance}} \pgfplotsset{ 3d_style/.style={ axis lines = middle, tick style = transparent, major tick length = 0.1in, minor tick num = 1, xtick distance = 1, ytick distance = 1, ztick distance = 1, xlabel = $x_1$, ylabel = $x_2$, zlabel = $x_3$, x = {(-.5cm*\unitvectorx,-.5cm*\unitvectorx)}, y = {(1cm*\unitvectory,0)}, z = {(0,1cm*\unitvectorz)}, set layers = standard, execute at end axis = {\pgfmathsetmacro{\xenlarge}{(\pgfkeysvalueof{/pgfplots/xmax} - \pgfkeysvalueof{/pgfplots/xmin}) * \pgfkeysvalueof{/pgfplots/enlarge x limits})} \pgfmathsetmacro{\yenlarge}{(\pgfkeysvalueof{/pgfplots/ymax} - \pgfkeysvalueof{/pgfplots/ymin}) * \pgfkeysvalueof{/pgfplots/enlarge y limits})} \pgfmathsetmacro{\zenlarge}{(\pgfkeysvalueof{/pgfplots/zmax} - \pgfkeysvalueof{/pgfplots/zmin}) * \pgfkeysvalueof{/pgfplots/enlarge z limits})} \pgfmathsetmacro{\xmin}{\pgfkeysvalueof{/pgfplots/xmin} - \xenlarge} \pgfmathsetmacro{\ymin}{\pgfkeysvalueof{/pgfplots/ymin} - \yenlarge} \pgfmathsetmacro{\zmin}{\pgfkeysvalueof{/pgfplots/zmin} - \zenlarge} \pgfmathsetmacro{\xmax}{\pgfkeysvalueof{/pgfplots/xmax} + \xenlarge} \pgfmathsetmacro{\ymax}{\pgfkeysvalueof{/pgfplots/ymax} + \yenlarge} \pgfmathsetmacro{\zmax}{\pgfkeysvalueof{/pgfplots/zmax} + \zenlarge} \pgfmathsetmacro{\ygriddist}{\pgfkeysvalueof{/pgfplots/ytick distance} / (\pgfkeysvalueof{/pgfplots/minor y tick num} + 1)} \pgfmathsetmacro{\zgriddist}{\pgfkeysvalueof{/pgfplots/ztick distance} / (\pgfkeysvalueof{/pgfplots/minor z tick num} + 1)} \pgfmathsetmacro{\ygridmin}{ceil(\ymin / \ygriddist) * \ygriddist} \pgfmathsetmacro{\zgridmin}{ceil(\zmin / \zgriddist) * \zgriddist} \pgfmathsetmacro{\ygridnext}{\ygridmin + \ygriddist} \pgfmathsetmacro{\zgridnext}{\zgridmin + \zgriddist} \pgfmathsetmacro{\ygridmax}{floor(\ymax / \ygriddist) * \ygriddist} \pgfmathsetmacro{\zgridmax}{floor(\zmax / \zgriddist) * \zgriddist} \pgfmathsetmacro{\xtickmin}{ceil(\xmin / \pgfkeysvalueof{/pgfplots/xtick distance}) * \pgfkeysvalueof{/pgfplots/xtick distance}} \pgfmathsetmacro{\ytickmin}{ceil(\ymin / \pgfkeysvalueof{/pgfplots/ytick distance}) * \pgfkeysvalueof{/pgfplots/ytick distance}} \pgfmathsetmacro{\ztickmin}{ceil(\zmin / \pgfkeysvalueof{/pgfplots/ztick distance}) * \pgfkeysvalueof{/pgfplots/ztick distance}} \pgfmathsetmacro{\xticknext}{\xtickmin + \pgfkeysvalueof{/pgfplots/xtick distance}} \pgfmathsetmacro{\yticknext}{\ytickmin + \pgfkeysvalueof{/pgfplots/ytick distance}} \pgfmathsetmacro{\zticknext}{\ztickmin + \pgfkeysvalueof{/pgfplots/ztick distance}} \pgfmathsetmacro{\xtickmax}{floor(\xmax / \pgfkeysvalueof{/pgfplots/xtick distance}) * \pgfkeysvalueof{/pgfplots/xtick distance}} \pgfmathsetmacro{\ytickmax}{floor(\ymax / \pgfkeysvalueof{/pgfplots/ytick distance}) * \pgfkeysvalueof{/pgfplots/ytick distance}} \pgfmathsetmacro{\ztickmax}{floor(\zmax / \pgfkeysvalueof{/pgfplots/ztick distance}) * \pgfkeysvalueof{/pgfplots/ztick distance}} \pgfmathsetmacro{\tickylength}{\pgfkeysvalueof{/pgfplots/major tick length}/1cm*0.5/\pgfkeysvalueof{/pgfplots/ytick distance}} \pgfmathsetmacro{\tickzlength}{\pgfkeysvalueof{/pgfplots/major tick length}/1cm*0.5/\pgfkeysvalueof{/pgfplots/ztick distance}} \pgfplotsonlayer{axis background} \draw[gray!50] \foreach \y in {\ygridmin,\ygridnext,...,\ygridmax}{(0,\y,\zmin) -- (0,\y,\zmax)}; \draw[gray!50] \foreach \z in {\zgridmin,\zgridnext,...,\zgridmax}{(0,\ymin,\z) -- (0,\ymax,\z)}; \endpgfplotsonlayer \pgfplotsonlayer{axis ticks} \draw \foreach \x in {\xtickmin,\xticknext,...,\xtickmax}{(\x,0,-\tickzlength) -- (\x,0,\tickzlength)}; \draw \foreach \y in {\ytickmin,\yticknext,...,\ytickmax}{(0,\y,-\tickzlength) -- (0,\y,\tickzlength)}; \draw \foreach \z in {\ztickmin,\zticknext,...,\ztickmax}{(0,-\tickylength,\z) -- (0,\tickylength,\z)}; \endpgfplotsonlayer } } } \begin{document} \begin{tikzpicture} \begin{axis}[ 3d_style, xmin=-9.2, xmax=9.2, ymin=-5.2, ymax=5.2, zmin=-5.2, zmax=5.2, ] \end{axis} \end{tikzpicture} \end{document}
- Tikz + PGFplots: How to add begin and end arrows for graph of cubic functionby Oregon Math Tutor on May 15, 2025 at 9:23 pm
I have created the graph for the cubic function y = 1(x+3)(x+1)(x-1) (see image below) Now I want to add arrowheads to the beginning and end of the graph without changing the parameters defining the cartesian plane. I have tried solutions like this without success. And inserting this code snip I found here (h/t @JasperHabicht): Placing arrows on ends of function graphs based on y domain limits: \addplot[red,very thick,Stealth-Stealth,samples=23] BTW: How does samples= ___ affect the arrowhead position? Being at my wits end, I would greatly appreciate your assistance. Thank you! mwe: \documentclass{article} \usepackage[margin=1in]{geometry} \usepackage{amsmath, amsfonts, amssymb} \usepackage{graphicx} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \usepackage{enumerate} \begin{document} \section*{ASSIGNMENT 10-F \hfill [10-F]} \noindent \textbf{Directions:} Approximate when the function is (a) positive or negative and (b) increasing or decreasing. (c) Approximate the relative minima and maxima, (d) identify the x-intercepts (zeros) and (e) describe the end behavior of the function. \vspace{0.5cm} \begin{figure}[h!] \centering \begin{minipage}{0.3\textwidth} \centering \textbf{1)}\\ \begin{tikzpicture}[scale=1.0] \begin{axis}[ axis lines=middle, xlabel={}, ylabel={}, xtick distance=1, ytick distance=1, xmin=-6.5, xmax=6.5, ymin=-8, ymax=8, grid=major, width=1.2\linewidth, height=1.2\linewidth, ticklabel style={font=\tiny}, major grid style={lightgray}, ] % Plot the cubic function y = -(x+3)(x+1)(x-1) \addplot[domain=-6:4, samples=100, smooth, blue, thick] {-1*(x+3)*(x+1)*(x-1)}; % === Added section: mark intercepts with black dots === % Black dots at x-intercepts: x = -3, -1, 1 (where y = 0) \addplot[only marks, mark=*, mark size=2pt, black] coordinates {(-3,0) (-1,0) (1,0)}; % Black dot at corrected y-intercept: x = 0, y = 3 \addplot[only marks, mark=*, mark size=2pt, black] coordinates {(0,3)}; % === End of added section === \end{axis} \end{tikzpicture} \end{minipage} \end{figure} \end{document}
- Pgfplots tick label values are incorrectby UkuNano on May 10, 2025 at 7:45 pm
I have the x axis of my data in volts, but I want to show it in millivolts, therefore I want to multiply the tick label numbers by 1000 while positioning the labels correctly relative to my data. I have arrived at the following code, which does format the numbers correctly, but the numbers themselves are incorrect. \documentclass[tikz, border=5mm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ xmin=0.003600, xmax=0.003660, ymin=0.0, ymax=0.06, xtick={0.003600, 0.003610, 0.003620, 0.003630, 0.003640, 0.003650, 0.003660}, xticklabel={ \pgfmathparse{round(1000*\tick*1000)/1000} \pgfmathprintnumber[fixed, fixed zerofill, precision=3]{\pgfmathresult} }, scaled x ticks=false ] \end{axis} \end{tikzpicture} \end{document} The values should be 3.600, 3.610, 3.620, 3.630, 3.640, 3.650, 3.660. But instead they are 3.601, 3.616, 3.616, 3.632, 3.647, 3.647, 3.662. The numbers also repeat which is very weird. How could I make the numbers be correct? Or is there a completely different approach to achieve my original goal?
- Making a column Chart with two different y-axis labeling and scalingby vampsz on May 8, 2025 at 2:37 pm
iam trying to do a column chart for my report in latex. The column chart should have two different y-axis labeling and scaling. The one with kwh/m^2 and the other one with kg/m^2. Thats my Code: \documentclass[a4paper, 12pt, oneside]{report} \usepackage{pgfplots} \begin{document} \begin{figure} \centering \begin{tikzpicture} % Erste Achse (links) für kWh/m² \begin{axis}[ ybar, bar width=15pt, width=0.9\textwidth, height=0.6\textwidth, symbolic x coords={Energieverbrauch, CO2Emissionen}, xtick=data, xlabel={Parameter}, ymin=0, ylabel={Energieverbrauch [kWh/m²]}, axis y line=left, grid=major ] \addplot[fill=blue] coordinates { (Energieverbrauch, 123.2) (CO2Emissionen, 29.57) }; \legend{Ist-Zustand} \end{axis} % Zweite Achse (rechts) für kg/m² \begin{axis}[ ybar, bar width=15pt, symbolic x coords={Energieverbrauch, CO2Emissionen}, xtick=\empty, ymin=0, ylabel={CO$_{2}$-Emissionen [kg/m²]}, axis y line=right, scaled ticks=false, % Verhindert inkorrekte Skalierungen tick label style={/pgf/number format/fixed}, legend style={draw=none, at={(0.5,-0.15)}, anchor=north, legend columns=-1} ] \addplot[fill=orange] coordinates { (Energieverbrauch, 13.7) (CO2Emissionen, 3.3) }; \legend{Passivhaus} \end{axis} \end{tikzpicture} \caption{Vergleich des Energieverbrauchs und der CO$_{2}$-Emissionen zwischen Ist-Zustand und Passivhaus} \label{fig:energie-co2} \end{figure} \end{document} And thats my output: The chart is really off. It looks like the other axis is too far to the left. Iam new to latex so I dont really know what do to. Can someone help me. What am I doing wrong? Thank you!
- Using PGFPlots/TikZ to plot on 5 Axis [closed]by Gore on May 5, 2025 at 4:52 am
I am trying to create a plot that utilizes all four of the traditional axes, but includes an additional 5th axis using the transform canvas feature. However, I am running into a problem when plotting my 5th axis. I would like it so that my plot has linear x axes, top and bottom, and logarithmic y axes, one left and two right. However, when I try to apply the logarithmic ymode to the transform canvas axis, I always run into a dimension too large error in tex. I have tried renaming my data columns, multiple file formats, and seemingly hours of fruitless attempts. All I would like to do is ensure that my transformed, 2nd y-axis, can compile with a ymode = log. Below is the code that I am currently working on; however, the transformed y-axis is being plotted on a linear-linear scale instead of linear-log. \documentclass{standalone} \usepackage{pgfplots} \usepackage{parskip,fullpage} \usepackage{siunitx} \pgfplotsset{ compat=1.18, scale only axis, width=12cm, height=10cm, every axis/.append style={ enlarge x limits=0.05, enlarge y limits=0.05, }, } \begin{document} \begin{tikzpicture} % Left axis (linear–log): \begin{axis}[ axis y line*=left, axis x line*=bottom, xmode=linear, ymode=log, xlabel={Time (\si{\second})}, ylabel={Thermal diffusivity (\si{m^2/s})}, legend style={at={(0.5,-.2)},anchor=north,legend columns=1}, ] \addplot[olive,mark=square*] table[ col sep=comma, x=time, y=alpha_t ]{raw_dual_axis_1.csv}; \addlegendentry{Thermal diffusivity} \end{axis} % Right axis (linear–log for T_emb): \begin{axis}[ axis y line*=right, axis x line*=top, xmode=linear, ymode=log, xlabel={Fourier}, ylabel={Embedded Temp (\si{\kelvin})}, ] \addplot[cyan,mark=diamond*] table[ col sep=comma, x=Fo, y=T_emb ]{raw_dual_axis_1.csv}; \end{axis} % Second right axis (linear y for Qi): \begin{axis}[ axis x line=none, axis y line*=right, ylabel={Heat Rate ($Q$, \si{\joule})}, axis line style={transform canvas={xshift=2cm}}, y tick style={transform canvas={xshift=2cm}}, y tick label style={xshift=2cm}, ] \addplot[red,mark=diamond*] table[ col sep=comma, x=Fo, y=Qi, ]{raw_dual_axis_1.csv}; \end{axis} \end{tikzpicture} \end{document} All help is greatly appreciated. Edit: Including the first few seconds of arbitrary data:
- pgfplots: CTAN vs. Githubby Dr. Manuel Kuehner on May 3, 2025 at 11:51 am
This might be a stupid question :). pgfplots is available on CTAN as version 1.18.1 2021-05-17. pgfplots is also on Github, see https://github.com/pgf-tikz/pgfplots. Since pgfplots in not actively officially maintained for quite some time, the CTAN version is "old". Q: My understanding is (maybe wrong), that the Github version still gets bug fixes -- is that the case? If yes, how would one install the Github version on one's local TeXLive system? Related: Future of the pgfplots package
- Still unable to colour barplot according to groups using pgfplotsby JustARando on May 3, 2025 at 9:46 am
This is in relation to my previous question here:How to colour barplot according to groups in table to which, it was suggested that I refer to another question here: Colors and legend in groupplots/barplot Briefly, I have data that can be categorised as animal or plant origin. I want the barplot of the animal values to be red and those of plants to be green (or blue, whichever). I tried to restructure my datatable to implement the coding style in the suggested link, but to no avail. I am continuously getting errors. I am new to LaTeX and I have referred to the manual as much as I can. Please help me solve this problem. Here is my minimal code that gives me an error: \documentclass{beamer} \begin{document} \begin{frame} \begin{tikzpicture} \pgfplotstableread[row sep=\\,col sep=&]{ Goat milk & Buffalo milk & Buffalo meat & Eggs & Cereals & Vegetables \\ 69.8 & 19.0 & 19.7 & 5 & 1.6 & 0.3 \\ }\coeqtable \begin{tikzpicture} \only<5->{ \begin{axis}[ xbar, % enlarge x limits=0.15, width = 5cm, %enlarge x limits=0.3, ytick=data, xmin=0, xlabel={CO\textsubscript{2~eq.}/kg\textsubscript{protein}}, xmajorgrids=true, xminorgrids=true, grid style=dashed, label style = {font=\scriptsize}, yticklabel style={xshift=0.6ex, text width=1.7cm, font=\scriptsize, align=right}, ticklabel style = {font=\scriptsize}, ] \addplot [fill=red!60, draw=red] table [x expr=\coordindex, y=Goat milk] {\coeqtable}; %Will manually enter colour for each bar \end{axis} \end{tikzpicture} \end{frame} \end{document}
- Addplot from file errorby Serubi on May 2, 2025 at 10:45 pm
community I have the following code \documentclass{standalone} \usepackage[utf8]{inputenc} \usepackage[spanish,es-nodecimaldot,es-tabla,es-noshorthands]{babel} \usepackage[dvipsnames,table,xcdraw]{xcolor} \usepackage[section]{placeins} \usepackage[none]{hyphenat} \usepackage{array,calc,enumitem,geometry,hyperref,longtable,pdflscape,tabto,titlesec} \usepackage{amsmath,amssymb,cancel,dsfont,libgreek,mathrsfs,stackrel,xfrac} \usepackage{pgfplots,tikz} \begin{document} \begin{tikzpicture} \begin{axis} \addplot table [x index=3, y index=0, col sep=tab, header=false] {SAT.dat}; \end{axis} \end{tikzpicture} \end{document} Where SAT.dat is a data matrix got in MatLab by save('SAT.dat','SAT','-ascii','-tabs') and the variable SAT is a 20001×5 matrix I'm getting this error: TeX capacity exceeded, sorry [main memory size=5000000]. ...able [x index=0, y index=2] {SAT_Ts.dat};. Could, please, someone help me?
- How to colour barplot according to groups in tableby JustARando on May 2, 2025 at 12:12 pm
I am trying to make a barplot, but fill according to the Type of the sample. Here is my MWE: Currently, this displays all the bars with red. I want the Animal samples in red and the Plant samples in Green. I have seen other examples where they use "meta" as some group indicator, but those appear to only work for scatter plots. \documentclass{beamer} \usepackage{pgfplots} \pgfplotsset{compat=1.17} \usepackage{pgfplotstable} \begin{document} \begin{frame} \pgfplotstableread[row sep=\\,col sep=&]{ Source & Emission & Type\\ Meat & 51.1 & Animal\\ Eggs & 32.3 & Animal\\ Vegetable & 19.1 & Plant\\ Legumes & 24.3 & Plant\\ Milk & 18.5 & Animal\\ Cereals & 14.3 & Plant\\ }\proteintable \begin{tikzpicture} \begin{axis}[ xbar, width = 5cm, symbolic y coords={% Meat,% Eggs,% Vegetable,% Legumes,% Milk,% Cereals% }, ytick=data, xmin=0, xlabel={Protein calories (\%)}, legend style={at={(0.8,0.85)}, anchor=center, legend columns=2, draw=none}, xmajorgrids=true, xminorgrids=true, grid style=dashed, label style = {font=\scriptsize}, yticklabel style={xshift=0.6ex, text width=1.7cm, font=\scriptsize, align=right}, ticklabel style = {font=\scriptsize}, ] \addplot [fill=red!60, draw=red] table[y=Source,x=Emission]{\proteintable}; \end{axis} \end{tikzpicture} \end{frame} \end{document}
- incorrect graph output using dateplot in PGFplotsby Elmar on May 1, 2025 at 2:08 pm
I'm using this code to plot a time series \documentclass{scrartcl} \usepackage{pgfplots, pgfcalendar} \usepgfplotslibrary{dateplot} \pgfplotstableread[col sep=tab] {test_time_series.txt}\data \begin{document} \begin{figure} \begin{tikzpicture} \begin{axis}[ date coordinates in=x,% xticklabel=\hour:\minute,% ] \addplot table [x={time}, y={depth_m}] {\data}; \end{axis} \end{tikzpicture} \end{figure} \end{document} resulting in this plot: however, the actual data should look like this, i.e., smooth and not 'blocky' as in the above plot: What could possibly cause this? the input data is in this tab-separated format: time depth_m 2023-07-26 13:45:07 3248.7475 2023-07-26 13:45:08 3249.239 2023-07-26 13:45:09 3249.7315 2023-07-26 13:45:10 3250.1205 2023-07-26 13:45:11 3250.608667 2023-07-26 13:45:12 3251.093 2023-07-26 13:45:13 3251.584 2023-07-26 13:45:14 3252.075 2023-07-26 13:45:15 3252.471 2023-07-26 13:45:16 3252.889333 ...
- How to plot two vertical aligned tikz/pgfplots?by José on April 23, 2025 at 3:35 pm
I want to replicate the plot in picture. Is a plot that depicts the total production function (upper) and the average and marginal production (lower). I need several things: to increase the y-axis domain just to not loose the label, to align the points for the optimum of the total production with the corresponding point in the average cost, to align the maximum of the marginal function (lower plot) with the corresponding point in the upper plot and to add, if possible, the x-values for the points and to labels for the y-label Q(Xme) and Q(Xmg) \documentclass[12pt,a4paper]{article} \usepackage{tikz} \usepackage{pgfplots} \usetikzlibrary{plot} \pgfplotsset{compat=1.16} \usepackage{float} \begin{document} \begin{tikzpicture} \begin{axis}[ % width and height if axis, adjust to your liking width=8cm, height=7cm, xtick=\empty, % remove all ticks from x-axis ytick=\empty, % ditto for y-axis xlabel=$v_1$, ylabel=$Q(X)$, axis lines=center, % default is to make a box around the axis domain=0:14, samples=100] \addplot [blue] {64*x^2-4*x^3}; \node[] at (120,240) {\footnotesize $\bullet$\ \'Optimo}; \end{axis} \end{tikzpicture}\\ \begin{tikzpicture} \begin{axis}[ % width and height if axis, adjust to your liking width=8cm, height=7cm, xtick=\empty, % remove all ticks from x-axis ytick=\empty, % ditto for y-axis xlabel=$v_1$, ylabel=$Q(X_{me})\\$Q(X_{mg})$, axis lines=center, % default is to make a box around the axis domain=0:14, samples=100] \addplot [red] {64*x-4*x^2}; \addplot [blue] {-12*x^2 + 128*x}; \node[] at (80,815) {\footnotesize $\bullet$}; \node[] at (55,900) {\footnotesize $\bullet$}; \end{axis} \end{tikzpicture} \end{document}
- pgfplots speed up compilation (filtered rows)by Mathieu on December 4, 2024 at 2:36 pm
I have a csv file with approx 2000 rows and filter 100 rows of the data. However, the compilation time is already approx five seconds. When we filter rows (see below) are there some pertinent settings to speed up the compilation? I already use standalone tikz to only have to compile once, still, I feel there is room for improvement. \documentclass[tikz]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \usepackage{pgfplotstable} \usepackage{xstring} \begin{document} \begin{tikzpicture} %Load csv file \pgfplotstableread[col sep=comma, header=true]{data.csv}\data % Plot the rows where the first column contains Exp18 \begin{axis}[] \addplot[table/x index={1}, table/y index={2}, x filter/.code={ \pgfplotstablegetelem{\coordindex}{Experiment}\of{\data} \IfStrEq{\pgfplotsretval}{Exp18} {} {\def\pgfmathresult{}} }] table {\data}; \end{axis} \end{tikzpicture} \end{document} Here is the file content of data.csv. (I had to delete some rows to input less than 30000 characters.) # Exp1, Some meta info..., # Exp2, ..., # Exp3, ..., # Exp4, ..., # Exp5, ..., # Exp6, ..., # Exp7, ..., # Exp8, ..., # Exp9, ..., # Exp10, ..., # Exp11, ..., # Exp12, ..., # Exp13, ..., # Exp14, ..., # Exp15, ..., # Exp16, ..., # Exp17, ..., # Exp18, ..., Experiment,X,Y Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp18,nan,nan Exp18,nan,nan Exp18,1.758,0.1279 Exp18,2.7777,0.1718 Exp18,3.7679,0.212 Exp18,4.7874,0.2447 Exp18,5.8074,0.2752 Exp18,6.8276,0.2997 Exp18,7.8479,0.3194 Exp18,8.8679,0.3362 Exp18,9.8874,0.3562 Exp18,10.9074,0.3726 Exp18,11.8975,0.3856 Exp18,12.918,0.4001 Exp18,13.9378,0.4135 Exp18,14.9578,0.4284 Exp18,15.9773,0.4392 Exp18,16.9974,0.4492 Exp18,18.0179,0.4578 Exp18,19.0378,0.4685 Exp18,20.0276,0.4834 Exp18,21.0478,0.4923 Exp18,22.0674,0.5009 Exp18,23.0875,0.5102 Exp18,24.1079,0.521 Exp18,25.1276,0.5325 Exp18,26.1479,0.5425 Exp18,27.1377,0.5478 Exp18,28.1574,0.5582 Exp18,29.1775,0.569 Exp18,30.2278,0.579 Exp18,31.2479,0.589 Exp18,32.2672,0.5961 Exp18,33.2874,0.6032 Exp18,34.3079,0.6113 Exp18,35.298,0.6236 Exp18,36.3177,0.6314 Exp18,37.3377,0.6389 Exp18,38.3573,0.6452 Exp18,39.3776,0.6549 Exp18,40.3981,0.6668 Exp18,41.4176,0.6753 Exp18,42.408,0.6809 Exp18,43.4274,0.6894 Exp18,44.4474,0.7017 Exp18,45.4675,0.7117 Exp18,46.488,0.7184 Exp18,47.5079,0.727 Exp18,48.5275,0.7352 Exp18,49.5473,0.7456 Exp18,50.5374,0.7556 Exp18,51.5579,0.7642 Exp18,52.5778,0.772 Exp18,53.5981,0.7846 Exp18,54.6173,0.7958 Exp18,55.6373,0.8051 Exp18,56.6578,0.8125 Exp18,57.6781,0.8214 Exp18,58.6678,0.8356 Exp18,59.6879,0.8467 Exp18,60.7072,0.8549 Exp18,61.7275,0.8623 Exp18,62.7479,0.8724 Exp18,63.7676,0.8861 Exp18,64.7878,0.898 Exp18,65.7776,0.9059 Exp18,66.7974,0.9159 Exp18,67.8175,0.93 Exp18,68.8381,0.9427 Exp18,69.8576,0.9531 Exp18,70.8778,0.9627 Exp18,71.8974,0.9724 Exp18,72.9175,0.9843 Exp18,73.9076,0.9988 Exp18,74.928,1.0089 Exp18,75.9479,1.0185 Exp18,76.9676,1.0319 Exp18,77.9872,1.0464 Exp18,79.0074,1.0591 Exp18,80.0281,1.0717 Exp18,81.0179,1.0821 Exp18,82.0378,1.0974 Exp18,83.0571,1.1122 Exp18,84.0774,1.1253 Exp18,85.0978,1.1364 Exp18,86.1179,1.1502 Exp18,87.1379,1.1658 Exp18,88.1575,1.1833 Exp18,89.1472,1.1933 Exp18,90.1675,1.2074 Exp18,91.188,1.2245 Exp18,92.2077,1.2416 Exp18,93.2279,1.2595 Exp18,94.2472,1.2733 Exp18,95.2675,1.2889 Exp18,96.2881,1.3056 Exp18,97.2781,1.3249 Exp18,98.2974,1.3413 Exp18,99.3177,1.3569 Exp18,100,1.3551
- Generate math plots and put them properly inside tikz nodeby Dalek on August 28, 2024 at 6:11 pm
I will appreciate if I can get suggestions on how to modify the following code to generate the same plot as the provided figure. I'd like to generate the same SED plot inside the box as well \documentclass[tikz,border=10pt]{standalone} \usepackage{amsmath} \usepackage{tikz} \usetikzlibrary{fit,positioning, decorations.pathmorphing, shapes.geometric, arrows.meta} \usepackage{graphicx} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \usepgfplotslibrary{fillbetween} \begin{document} \begin{figure} \centering \begin{tikzpicture} % Images \node at (0, 0) {\includegraphics[width=1.5cm]{example-image}}; % Replace with actual image \node at (0, -4) {\includegraphics[width=1.5cm]{example-image}}; % Replace with actual image % Neural network layers (Encoder) \node[draw, circle, fill=green!30] (n1) at (2, 0.25) {}; \node[draw, circle, fill=green!30] (n2) at (2, -0.25) {}; \node[draw, circle, fill=green!30] (n3) at (3, 0.5) {}; \node[draw, circle, fill=green!30] (n4) at (3, 0) {}; \node[draw, circle, fill=green!30] (n5) at (3, -0.5) {}; \node[draw, circle, fill=green!30] (n6) at (4, 0.25) {}; \node[draw, circle, fill=green!30] (n7) at (4, -0.25) {}; % Edges between nodes \foreach \i in {1,2} \foreach \j in {3,4,5} \draw[-] (n\i) -- (n\j); \foreach \i in {3,4,5} \foreach \j in {6,7} \draw[-] (n\i) -- (n\j); %Decoder Network \node[draw, circle, fill=green!30] (n9) at (2, -3.5) {}; \node[draw, circle, fill=green!30] (n10) at (2, -4.00) {}; \node[draw, circle, fill=green!30] (n11) at (3, -3.75) {}; \node[draw, circle, fill=green!30] (n12) at (3, -3.25) {}; \node[draw, circle, fill=green!30] (n13) at (3, -4.25) {}; \node[draw, circle, fill=green!30] (n14) at (4, -3.5) {}; \node[draw, circle, fill=green!30] (n15) at (4, -4.00) {}; % Edges between nodes \foreach \i in {9,10} \foreach \j in {11,12,13} \draw[-] (n\i) -- (n\j); \foreach \i in {11,12,13} \foreach \j in {14,15} \draw[-] (n\i) -- (n\j); % Latent space box \draw[rounded corners, fill=purple!10] (7, 0) rectangle (10.5, -4); % SDE Trajectories \begin{scope} \clip (4.5, -2) rectangle (10.5, -1); \draw[green] plot[domain=4.5:10.5, samples=100, smooth, variable=\x] (\x, {sin(10*\x r)/10+rand/10}); \draw[green] plot[domain=4.5:10.5, samples=100, smooth, variable=\x] (\x, {sin(8*\x r)/15+rand/10}); \draw[green] plot[domain=4.5:10.5, samples=100, smooth, variable=\x] (\x, {cos(9*\x r)/12+rand/10}); \end{scope} % Path arrows \draw[->, thick] (7, 0.25) -- (10, 0.25); \draw[->,thick] (2, 0.75) -- (4., 0.75); \draw[->,thick] (4, -3.) -- (2., -3.); \draw[->,thick] (10.5, -4.25) -- (7.5, -4.25); \draw[->,thick, color=red] (5.75, -2) -- (5.75, -4.5); % Gaussian distribution (rotated 90 degrees) \node at (4, -2.75) { \begin{axis}[width=1.5cm, height=1.cm, axis lines=box, samples=100, domain=-3.:3., scale only axis, rotate=270, ticks=none, xtick=\empty, ytick=\empty] \addplot[very thick, purple] {exp(-(x+0.5)^2) + 1.15*exp(-((x-1.5)/1.2)^2) + 0.75*exp(-((x+2.5)/0.8)^2)}; \end{axis} }; \node at (5.0, -1.0) {$q(\mathbf{z}_0|\mathbf{x})$}; \node at (5.5,-5) {$\mathbf{D}_{\mathrm{KL}}\big[q(z_0|x)||p(z_0)\big]$}; % Gaussian distribution (rotated 90 degrees) \node at (5.5, -4.0) { \begin{axis}[width=4cm, height=1.cm, axis lines=box, samples=100, domain=-3.:3., scale only axis, rotate=270, ticks=none, xtick=\empty, ytick=\empty] \addplot[very thick, purple] {exp(-((x+0.65)/0.95)^2) + 1.12*exp(-((x-1.25)/1.25)^2) + 0.85*exp(-((x+2.45)/0.95)^2)}; \end{axis} }; \node at (6.5, 0.5) {$p(\mathbf{z}_0)$}; \node at (10, -4.0) { \begin{axis}[width=4cm, height=1.cm, axis lines=box, samples=100, domain=-3.:3., scale only axis, rotate=270, ticks=none, xtick=\empty, ytick=\empty] \addplot[very thick, purple] {exp(-(x)^2)}; \end{axis} }; \node at (11.25, 0.55) {$p(\mathbf{z}_{\text{T}})$}; % Labels \node at (3, 1) {Encoder}; \node at (3, -2.75) {Decoder}; \node at (9, 0.5) {Latent Space Diffusion}; \node at (9, -4.5) {Latent Space Denoising}; % Adjusted axis for SDE Trajectories \begin{axis}[ at={(8, -3)}, rotate=180,% Positioning the plot inside the latent space diffusion box anchor=north west, width=6cm, height=4cm, xmin=0, xmax=1, ymin=-0.75, ymax=0.75, axis lines=none, xtick=\empty, ytick=\empty ] \addplot[blue, thick, domain=0:1, samples=100] {0.2*x + 0.3*sqrt(x)*rand}; \addplot[red, thick, domain=0:1, samples=100] {0.15*x - 0.2*sqrt(x)*rand}; \addplot[black, thick, domain=0:1, samples=100] {0.12*x + 0.4*sqrt(x)*rand}; \addplot[orange, thick, domain=0:1, samples=100] {0.05*x - 0.25*sqrt(x)*rand}; \addplot[purple, thick, domain=0:1, samples=100] {0.2*x + 0.85*sqrt(x)*rand}; \end{axis} % Probability Flow label \node at (8.5, -3.8) {Probability Flow}; \end{tikzpicture} \caption{diffusion with latent variables} \label{fig:DLV} \end{figure} \end{document} Thanks.
- How to do math functions in point meta symbolic for color mapsby Thorbjørn E. K. Christensen on July 29, 2024 at 4:00 pm
I'm trying to have a repetitive colormap. To do this, I'd draw the colorbar, and then moduli the color by the factor giving the number of repititions I want. This looks something like the following MWE (Should repeat black->red colorbar 10 times): \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[view={0}{90}, hide axis, shader=interp, mesh/color input = explicit mathparse, y domain=0:1, domain=0:10, ] \addplot3 [ surf, variable=\x, variable y=\y, point meta={symbolic={rgb=mod(x,1),0,0}}, % <- switch out "mod(x,1)" -> "x/10" for working but wrong example ] (x,y,1); \end{axis} \end{tikzpicture} \end{document} This however gives an error, that the input to the mod operator is a wrongly formatted: point_meta_symbolic_math.tex|21 error| Package PGF Math Error: Sorry, an internal routine of the floating point unit got an ill-formatted floating point number `0'. The unreadable part was near '0'. (in 'mod(x'). Is there a way to use simple math functions in the symbolic color calculations? I can Repeat the code manually, going within the range 0 to 1 for the value, and then shifting the x-coordinate in the plot below. This would however leave a small gap, so it is very fiddly (especially when changing the mod number). There are also places where it is less doable, for example in polar coordinates, In particular if trying to create a repetitive circular colorscale (repetitive version along the rotation of say: Correct use of axis cs). Thanks for any help.
- Missing labels in barchartby Yevin Christopher on March 18, 2024 at 9:31 pm
I'm trying to draw a barchart but the text that I underlined and colored as green doesn't seem to display. This is how it appears. The following is the code. \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.8} \newcommand{\ImageWidth}{11cm} \usepackage{tikz} \usetikzlibrary{decorations.pathreplacing,positioning, arrows.meta} \usetikzlibrary{patterns} \begin{document} \begin{figure}[ht] \centering \scalebox{0.72}{ % Adjust the scale factor as needed \begin{tikzpicture} \begin{axis}[ height=19.58cm, width=15.44cm, xbar, xmin=-1000, xmax=25000, xlabel={Time elapsed since the first kernel driver (module) was unloaded (in seconds)}, symbolic y coords={ \underline{\textcolor{red}{mdd.sys}}, \underline{\textcolor{red}{Beep.SYS$^4$}}, \underline{\textcolor{red}{Beep.SYS$^3$}}, \underline{\textcolor{red}{Beep.SYS$^2$}}, \underline{\textcolor{red}{Beep.SYS$^1$}}, \underline{\textcolor{red}{imapi.sys}}, \underline{\textcolor{red}{processr.sys}}, \underline{\textcolor{red}{Cdaudio.SYS}}, \underline{\textcolor{red}{Sfloppy.SYS}}, \underline{\textcolor{green}{kmixer.sys}}, \underline{\textcolor{green}{drmkaud.sys}}, \underline{\textcolor{green}{DMusic.sys}}, \underline{\textcolor{green}{aec.sys}}, \underline{\textcolor{green}{swmidi.sys}}, \underline{\textcolor{green}{splitter.sys}}, \underline{\textcolor{green}{Serial.SYS}}, \underline{\textcolor{green}{Parport.SYS}}, \underline{\textcolor{green}{imapi.sys}}, \underline{\textcolor{green}{redbook.sys}}, \underline{\textcolor{green}{intelppm.sys}}, \underline{\textcolor{green}{Cdaudio.SYS}}, \underline{\textcolor{green}{Sfloppy.SYS}}, \underline{\textcolor{green}{Flpydisk.SYS}}, \underline{\textcolor{green}{Fdc.SYS}} }, ytick=data, nodes near coords, nodes near coords align={horizontal}, scaled x ticks=false, ] \addplot [fill=red!30,draw=red, postaction={pattern=north east lines}] coordinates { (13450,\underline{\textcolor{red}{mdd.sys}}) (8168,\underline{\textcolor{red}{Beep.SYS$^4$}}) (8168,\underline{\textcolor{red}{Beep.SYS$^3$}}) (8168,\underline{\textcolor{red}{Beep.SYS$^2$}}) (8167,\underline{\textcolor{red}{Beep.SYS$^1$}}) (0,\underline{\textcolor{red}{imapi.sys}}) (0,\underline{\textcolor{red}{processr.sys}}) (0,\underline{\textcolor{red}{Cdaudio.SYS}}) (0,\underline{\textcolor{red}{Sfloppy.SYS}}) }; \addplot [fill=green!30,draw=green, postaction={pattern=north east lines}] coordinates { (20324,\underline{\textcolor{green}{kmixer.sys}}) (20145,\underline{\textcolor{green}{drmkaud.sys}}) (20142,\underline{\textcolor{green}{DMusic.sys}}) (20141,\underline{\textcolor{green}{aec.sys}}) (20139,\underline{\textcolor{green}{swmidi.sys}}) (20132,\underline{\textcolor{green}{splitter.sys}}) (19881,\underline{\textcolor{green}{Serial.SYS}}) (19880,\underline{\textcolor{green}{Parport.SYS}}) (9,\underline{\textcolor{green}{imapi.sys}}) (9,\underline{\textcolor{green}{redbook.sys}}) (8,\underline{\textcolor{green}{intelppm.sys}}) (1,\underline{\textcolor{green}{Cdaudio.SYS}}) (0,\underline{\textcolor{green}{Sfloppy.SYS}}) (0,\underline{\textcolor{green}{Flpydisk.SYS}}) (0,\underline{\textcolor{green}{Fdc.SYS}}) }; \legend{Infected memory image, Baseline memory image} \end{axis} \end{tikzpicture} } % End of \scalebox \caption{Timeline depicting unloaded kernel drivers (modules) from both memory images.} \end{figure} \end{document} It would be great if someone could help me. Thanks in advance.
- Reducing the number of markers when plot with PGFplotsby wzFelix on March 2, 2024 at 11:01 am
There are too many markers on the line, how could I only plot few of markers? Figure: Code: \documentclass[tikz]{standalone} \RequirePackage{pgfplots} \begin{document} % This file was created by matlab2tikz. % %The latest updates can be retrieved from % http://www.mathworks.com/matlabcentral/fileexchange/22022-matlab2tikz-matlab2tikz %where you can also make suggestions and rate matlab2tikz. % \definecolor{mycolor1}{rgb}{0.58824,0.58824,0.58824}% \definecolor{mycolor2}{rgb}{0.89412,0.10196,0.10980}% \definecolor{mycolor3}{rgb}{0.21569,0.49412,0.72157}% \definecolor{mycolor4}{rgb}{0.30196,0.68627,0.29020}% \definecolor{mycolor5}{rgb}{1.00000,0.49804,0.00000}% % \begin{tikzpicture} \begin{axis}[% width=4.521in, height=3.539in, at={(0.758in,0.508in)}, scale only axis, xmin=0, xmax=3000, xtick={ 0, 500, 1000, 1500, 2000, 2500, 3000}, xlabel style={font=\color{white!15!black}}, xlabel={X}, ymin=0, ymax=1, ylabel style={font=\color{white!15!black}}, ylabel={Y}, axis background/.style={fill=white}, axis x line*=bottom, axis y line*=left, xmajorgrids, ymajorgrids, legend style={at={(0.03,0.03)}, anchor=south west, legend cell align=left, align=left, draw=white!15!black} ] \addplot [color=mycolor4, dashed, line width=2.0pt, mark=square, mark options={solid, mycolor4}] table[row sep=crcr]{% 50 0.9834264\\ 100 0.974296\\ 150 0.9648184\\ 200 0.9529258\\ 250 0.9410852\\ 300 0.9304922\\ 350 0.920181\\ 400 0.9098856\\ 450 0.9005352\\ 500 0.8908822\\ 550 0.8804412\\ 600 0.867324\\ 650 0.8567086\\ 700 0.8448816\\ 750 0.8282384\\ 800 0.8195136\\ 850 0.8067574\\ 900 0.7918128\\ 950 0.7785728\\ 1000 0.7620058\\ 1050 0.7464702\\ 1100 0.7249504\\ 1150 0.7063224\\ 1200 0.686981\\ 1250 0.663326\\ 1300 0.6409518\\ 1350 0.6151574\\ 1400 0.5793994\\ 1450 0.5536608\\ 1500 0.5244878\\ 1550 0.4909266\\ 1600 0.452572\\ 1650 0.419305\\ 1700 0.3855892\\ 1750 0.3481886\\ 1800 0.3107104\\ 1850 0.2804826\\ 1900 0.248753\\ 1950 0.223371\\ 2000 0.1922176\\ 2050 0.171771\\ 2100 0.1519022\\ 2150 0.13144\\ 2200 0.113525\\ 2250 0.0949822\\ 2300 0.0790246\\ 2350 0.0656442\\ 2400 0.0598496\\ 2450 0.0489776\\ 2500 0.0411896\\ 2550 0.03396\\ 2600 0.0285898\\ 2650 0.0242706\\ 2700 0.019216\\ 2750 0.0153486\\ 2800 0.0130666\\ 2850 0.0091866\\ 2900 0.0079618\\ }; \addlegendentry{my line} \end{axis} \end{tikzpicture}% \end{document}
- Why does this MWE not compile (heatmap with contour lines)?by Sim Son on August 22, 2023 at 2:08 pm
I'm trying to plot some 3D data which is saved in a csv file. Plotting just the color map works fine, but I also need to add the contour lines, so I get a result similar to this: My intuition was that it's possible to simply add another \addplot3[...] table {...} block to my existing plot like this: \begin{tikzpicture} \begin{axis}[...] \addplot3[surf] table {data.csv}; % <- this is my existing plot, which works \addplot3[...] table {data.csv}; % <- this should be okay?! \end{axis} \end{tikzpicture} This question seems to be about the exact same issue, so I tried to adapt the answer into my document, but to no avail. In the end I found that even this minimal example doesn't compile for me (which is the accepted answer from the mentioned question): \documentclass[border=1 cm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{filecontents}{data_test.dat} 0 0 3 0 2 1 0 3 2 1 0 1 1 2 2 1 3 2 2 0 1 2 2 2 2 3 1 \end{filecontents} \begin{document} \begin{tikzpicture} \begin{axis}%[view={0}{90}] \addplot3[surf] table {data_test.dat}; \addplot3[contour lua={levels={1,2,3}}] table {data_test.dat}; \end{axis} \end{tikzpicture} \end{document} When I try to compile this in my TeXworks installation with the LuaLaTeX engine (using the option --shell-escape) I get the following error : ! Package pgfkeys Error: I do not know the key '/tikz/contour lua', to which you passed 'levels={1,2,3}', and I am going to ignore it. Perhaps you misspelled it. This error message looks quite similar to the kind of errors I had with my original document, but why do I get it even in this MWE? Since the OP of the mentioned question has the exact same requirements as I do, I'm confident that my problem is solved once I'm able to compile the MWE above. Thanks for spending your time! Edit: I just checked for updates in the MiKTeX Console and updated all suggested packages - nothing changed. I also included \listfiles at the top of my document, which returned: *File List* standalone.cls 2018/03/26 v1.3a Class to compile TeX sub-files standalone shellesc.sty 2019/11/08 v1.0c unified shell escape interface for LaTeX ifluatex.sty 2019/10/25 v1.5 ifluatex legacy package. Use iftex instead. iftex.sty 2020/03/06 v1.0d TeX engine tests xkeyval.sty 2020/11/20 v2.8 package option processing (HA) xkeyval.tex 2014/12/03 v2.7a key=value parser (HA) standalone.cfg 2018/03/26 v1.3a Default configuration file for 'standalone' class article.cls 2020/04/10 v1.4m Standard LaTeX document class size10.clo 2020/04/10 v1.4m Standard LaTeX file (size option) luatex85.sty 2016/06/15 v1.4 pdftex aliases for luatex pdftexcmds.sty 2020-06-27 v0.33 Utility functions of pdfTeX for LuaTeX (HO) infwarerr.sty 2019/12/03 v1.5 Providing info/warning/error messages (HO) ltxcmds.sty 2020-05-10 v1.25 LaTeX kernel commands for general use (HO) pgfplots.sty 2020/02/29 v1.17 Data Visualization (1.17) graphicx.sty 2020/09/09 v1.2b Enhanced LaTeX Graphics (DPC,SPQR) graphics.sty 2020/08/30 v1.4c Standard LaTeX Graphics (DPC,SPQR) trig.sty 2016/01/03 v1.10 sin cos tan (DPC) graphics.cfg 2016/06/04 v1.11 sample graphics configuration luatex.def 2020/10/05 v1.2a Graphics/color driver for luatex tikz.sty 2020/12/01 v3.1.7a (3.1.7a) pgf.sty 2020/12/01 v3.1.7a (3.1.7a) pgfrcs.sty 2020/12/01 v3.1.7a (3.1.7a) pgfrcs.code.tex pgfcore.sty 2020/12/01 v3.1.7a (3.1.7a) pgfsys.sty 2020/12/01 v3.1.7a (3.1.7a) pgfsys.code.tex pgfsyssoftpath.code.tex 2020/12/01 v3.1.7a (3.1.7a) pgfsysprotocol.code.tex 2020/12/01 v3.1.7a (3.1.7a) xcolor.sty 2016/05/11 v2.12 LaTeX color extensions (UK) color.cfg 2016/01/02 v1.6 sample color configuration pgfcore.code.tex pgfcomp-version-0-65.sty 2020/12/01 v3.1.7a (3.1.7a) pgfcomp-version-1-18.sty 2020/12/01 v3.1.7a (3.1.7a) pgffor.sty 2020/12/01 v3.1.7a (3.1.7a) pgfkeys.sty pgfkeys.code.tex pgfmath.sty pgfmath.code.tex pgffor.code.tex tikz.code.tex l3backend-luatex.def 2020-09-24 L3 backend support: PDF output (LuaTeX) ts1cmr.fd 2019/12/16 v2.5j Standard LaTeX font definitions supp-pdf.mkii epstopdf-base.sty 2020-01-24 v2.11 Base part for package epstopdf epstopdf-sys.cfg 2021/03/18 v2.0 Configuration of epstopdf for MiKTeX ***********
- A three dimensional graph of a function with bounded range [duplicate]by Kirill Sm on August 14, 2023 at 7:29 pm
I want to graph the function f(x,y) = sin(x)sin(y) on the square $[0,2\pi]\times[0,2\pi]$, but only for values that are smaller than some value, for example 0.5. This is the graph of the whole function on the square: Which I created by using the pgfplots package: \documentclass{article} \usepackage[margin=0.25in]{geometry} \usepackage{pgfplots} \pgfplotsset{width=10cm,compat=1.9} \begin{tikzpicture} \begin{axis}[grid=major] \addplot3[surf,shader=interp,samples=50,domain=0:2*pi,y domain=0:2*pi {sin(deg(x))*sin(deg(y))}; \end{axis} \end{tikzpicture} \end{document} I thought that I just can declare that the maximum value of z is 0.5 but this is what I get: I had an idea to define the function to be f(x,y) for values that are less than 0.5, and 5 otherwise, and then to declare the maximum z value to be 1 for example, but I'm not sure how can I define such function. Can someone please help me with that? Thank you in advance!
- How to align the bar charts in a stacked bar chart properly?by Student on August 4, 2023 at 1:29 pm
I'm working on this LaTeX code to fit the bounds properly. I want to include the percentage on top of every bar plot, and the legend must be simply a rectangle. Also, can anyone please help me use patterns in this code? Code: \documentclass[preprint,12pt,3p]{elsarticle} \usepackage{graphicx} \usepackage{float} \usepackage{epstopdf} \usepackage{caption} \usepackage{subfig} \usepackage{xcolor} \usepackage{pgfplots} \usepackage{tikz} \pgfplotsset{compat=1.10} \usetikzlibrary{decorations.pathreplacing} \begin{document} \begin{figure}[ht!] \centering \subfloat[][Sub figure first]{\resizebox{0.5\textwidth}{!}{ \begin{tikzpicture} \begin{axis}[ ybar, ymin=0, width = 12cm, height = 5cm, bar width=12pt, ylabel={$\mathcal{J}$ of WM}, nodes near coords, xticklabel style={rotate=90}, xtick = data, table/header=false, table/row sep=\\, xticklabels from table={\footnotesize wells\\\footnotesize lemput\\\footnotesize wang\\\footnotesize % wells\\\footnotesize lemput\\\footnotesize wang\\\footnotesize proposed\\ % \footnotesize wells\\\footnotesize lemput\\\footnotesize wang\\ }{[index]0}, enlarge y limits={value=0.2,upper} % legend pos=north west ] \legend{1\%, 5\%} \addplot table[x expr=\coordindex,y index=0]{1\\2\\3\\4\\4\\2\\}; \addplot table[x expr=\coordindex,y index=0]{3\\2\\8\\4\\4\\2\\}; \pgfplotsinvokeforeach{0,3,4,7,8,11}{\coordinate(l#1)at(axis cs:#1,0);} \end{axis} \coordinate(bbs)at(current bounding box.south); \foreach[count=\i,evaluate={\s=int(4*\i-1)},evaluate={\e=int(4*(\i-1))}] \text in {Axial,Coronial} \draw[decorate,decoration=brace]([xshift=8pt]l\s|-bbs)--node[below=5pt]{\text}([xshift=-8pt]l\e|-bbs); \end{tikzpicture} }} % A blank line here like a new paragraph so next picture is placed below \subfloat[][Sub figure second]{\resizebox{0.5\textwidth}{!}{ \begin{tikzpicture} \begin{axis}[ ybar, ymin=0, width = 12cm, height = 5cm, bar width=12pt, ylabel={$\mathcal{J}$ of WM}, nodes near coords, xticklabel style={rotate=90}, xtick = data, table/header=false, table/row sep=\\, xticklabels from table={\footnotesize wells\\\footnotesize lemput\\\footnotesize wang\\\footnotesize % wells\\\footnotesize lemput\\\footnotesize wang\\\footnotesize proposed\\ % \footnotesize wells\\\footnotesize lemput\\\footnotesize wang\\ }{[index]0}, enlarge y limits={value=0.2,upper} % legend pos=north west ] \legend{1\%, 5\%} \addplot table[x expr=\coordindex,y index=0]{1\\2\\3\\4\\4\\2\\}; \addplot table[x expr=\coordindex,y index=0]{3\\2\\8\\4\\4\\2\\}; \pgfplotsinvokeforeach{0,3,4,7,8,11}{\coordinate(l#1)at(axis cs:#1,0);} \end{axis} \coordinate(bbs)at(current bounding box.south); \foreach[count=\i,evaluate={\s=int(4*\i-1)},evaluate={\e=int(4*(\i-1))}] \text in {Axial,Coronial} \draw[decorate,decoration=brace]([xshift=8pt]l\s|-bbs)--node[below=5pt]{\text}([xshift=-8pt]l\e|-bbs); \end{tikzpicture} }} \caption{Accuracies Comparision} \end{figure} \end{document} Output: To reiterate, please note that I want the percentage on top of every bar; the bar chart should be aligned properly with axial, coronial. Also, it would be great if someone could help me use patterns for each bar.
- How to draw equations (not functions) in LaTeXby Firestar-Reimu on August 10, 2022 at 8:12 am
I want to draw this equation in LaTeX using tikz (maybe with pgfplots): (x^2+y^2) + \frac{0.7}{\sqrt((x-0.3)^2+y^2)} + \frac{0.3}{\sqrt((x+0.7)^2+y^2)} = 2.5 This is from geogebra: I tried gnuplot: \begin{tikzpicture} \draw plot[raw gnuplot] function{ f(x,y) = (x**2+y**2) + 0.7/(sqrt((x-0.3)**2+y**2)) + 0.3/(sqrt((x+0.7)**2+y**2)) - 1.5; set xrange [-4:4]; set yrange [-4:4]; set view 0,0; set isosample 1000, 1000; set sample 1000, 1000; set size square; set contour base; set cntrparam levels incre 0,0.1,0; unset surface; splot f(x,y); }; \end{tikzpicture} I need to turn on -shell-escape: How to enable `shell escape' (or `write18') - Visual Studio Code (Latex Workshop extension) On the other hand, I tried pst-func but it failed to plot my function. I am also willing to find any solution without gnuplot as I do not want to install a new software for one chart
- Alignment of pgfplots inside subfloats when using tikzplotlibby Marvin Noll on December 4, 2020 at 10:58 pm
I'm using the tikzplotlib code below to generate two Plots. I then place them in two subfloats. As you can see in the final latex output, the figure looks rather ugly with the two plots differently sized and not aligned. What can i do to achieve the same size of the plots and to align them properly. Maybe worth noting, i have several of these figures with multiple subfloats in my document. Python: import matplotlib.pyplot as plt import tikzplotlib import numpy as np x1=np.arange(0,10)*10e9 x2=np.arange(0,1000) y1=np.random.randn(1,len(x1))[0] y2=0.01*x2*np.random.randn(1,len(x2))[0] KIT_green=(0/255,150/255,130/255) KIT_blue=(70/255,100/255,170/255) plt.figure() plt.plot(x2,y2,label="second trace",color=KIT_green) plt.xlabel(r"Time $t$ (in \si{\milli\second})") plt.ylabel(r"Amplitude $S_{11}$ \\ (some measurement) \\ (and another meaningless line) (in \si{\volt})"); tikzplotlib.save("subfigs_left.tikz",extra_axis_parameters=["ylabel style={align=center}"],axis_width="5cm",axis_height="5cm") plt.figure() plt.plot(x1,y1,label="first trace",color=KIT_blue) plt.xlabel(r"Time $t$ (in \si{\milli\second})") plt.ylabel(r"Amplitude $S_{11}$, $S_{35}$ (in \si{\volt})"); tikzplotlib.save("subfigs_right.tikz",extra_axis_parameters=["ylabel style={align=center}"],axis_width="5cm",axis_height="5cm") LaTeX: \documentclass[11pt]{article} \usepackage[utf8]{inputenc} \usepackage{graphicx} \usepackage{subfig} \usepackage{siunitx} \usepackage{tikz} \usepackage{pgfplots} \usepackage{tikzscale} \begin{document} \begin{figure} \centering \subfloat[Plot 1: this shows this]{\includegraphics[width=0.4\textwidth]{subfigs_left.tikz}} \qquad \subfloat[Plot 2: and this shows that. But this explanation is quite long. blablabla]{\includegraphics[width=0.4\textwidth]{subfigs_right.tikz}} \caption{Two plots} \label{fig:subfig} \end{figure} \end{document}
- pgfplots: how to display a label next to my plot when the option clip = true cuts out a part of the graph?by Colas on April 8, 2014 at 1:30 pm
Question I want to attach a label to the curves I draw. My current solution is to add a node after the plot of my function (see the code below). But, when I explicitly cut out a part of my graph, with the option clip = true, the label can be completely away from the curve (see the picture below). Do you have an idea on how to resolve this issue, or a different approach to the issue of labeling my curves? I am looking for an automatic solution, if possible. Picture Code \documentclass{article} \usepackage[x11names]{xcolor} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture}[domain=0.01:5] \begin{axis} [grid = major, clip = true, clip mode=individual, axis x line = middle, axis y line = middle, xlabel={$x$}, xlabel style={at=(current axis.right of origin), anchor=west}, ylabel={$y$}, ylabel style={at=(current axis.above origin), anchor=south}, domain = 0.01:5, xmin = 0, xmax = 5, enlarge y limits={rel=0.13}, enlarge x limits={rel=0.07}, ymin = -10, ymax = 10, after end axis/.code={\path (axis cs:0,0) node [anchor=north west,yshift=-0.075cm] {0} node [anchor=south east,xshift=-0.075cm] {0};}] \addplot[color=Firebrick2, samples=100, smooth, ultra thick] {x^2} node(endofplotsquare){} ; \node [right, color=Firebrick2] at (endofplotsquare) {$x^2$}; \addplot[color=DodgerBlue2, samples=100, smooth, ultra thick] {exp(x)}; \addplot[color=Gold3, samples=1000, smooth, ultra thick, unbounded coords=jump, no markers] {ln(x)}; \end{axis} \end{tikzpicture} \end{document}