pgfplots
- 3D plot "hide axis" produces spurious spaceby adn on September 14, 2025 at 11:34 am
Setup I'm following the answer about parameterized curves in a sphere from https://tex.stackexchange.com/a/199715/7561. I'm inserting these spheres in a bigger diagram and noticed the extra space around the axis plots. I was under the impression that hide axis inside the axis environment should remove all the extra white space around the ticks and axis labels, but it doesn't seem the case. See the extra space in the output image below. Question What am I doing wrong? I think that the culprit may be the disabledatascaling which I still need if I want to insert the spheres and their plots next to another nodes, don't I? MWE \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \usetikzlibrary{ calc, positioning, } \usepgfplotslibrary{ colorbrewer, } \pgfplotsset{compat=1.18, cycle list/Dark2, } % sphere stuff: https://tex.stackexchange.com/a/199715/7561 % Declare nice sphere shading: http://tex.stackexchange.com/a/54239/12440 \pgfdeclareradialshading[tikz@ball]{ball}{\pgfqpoint{0bp}{0bp}}{% color(0bp)=(tikz@ball!0!white); color(7bp)=(tikz@ball!0!white); color(15bp)=(tikz@ball!70!black); color(20bp)=(black!70); color(30bp)=(black!70)} \makeatother % Style to set TikZ camera angle, like PGFPlots `view` \tikzset{viewport/.style n args={3}{ x={({cos(-#1)*#3},{sin(-#1)*sin(#2)*#3})}, y={({-sin(-#1)*#3},{cos(-#1)*sin(#2)*#3})}, z={(0,{cos(#2)*#3})} }} % Styles to plot only points that are before or behind the sphere. \pgfplotsset{only foreground/.style={ restrict expr to domain={rawx*\CameraX + rawy*\CameraY + rawz*\CameraZ}{-0.05:100}, }} \pgfplotsset{only background/.style={ restrict expr to domain={rawx*\CameraX + rawy*\CameraY + rawz*\CameraZ}{-100:0.05} }} % Automatically plot transparent lines in background and solid lines in foreground \def\addFGBGplot[#1]#2;{% \addplot3[#1,only background, opacity=0.25] #2;% \addplot3[#1,only foreground] #2;% } \newcommand{\ViewAzimuth}{-30} \newcommand{\ViewElevation}{30} \begin{document} \begin{tikzpicture} \def\radius{2.5cm} \pgfmathsetmacro{\diameter}{2*\radius} % Compute camera unit vector for calculating depth \pgfmathsetmacro{\CameraX}{sin(\ViewAzimuth)*cos(\ViewElevation)} \pgfmathsetmacro{\CameraY}{-cos(\ViewAzimuth)*cos(\ViewElevation)} \pgfmathsetmacro{\CameraZ}{sin(\ViewElevation)} \begin{scope}[] \node[fill=Dark2-C!35, circle, minimum size=\diameter, outer sep=0pt] (ps) {}; \clip (ps.center) circle (\radius); % tweak the shift to move the ellipse that simulates the lighting \begin{scope}[transform canvas={rotate around={45:(ps.center)}, shift={(-5pt,15pt)}}] \shade [ball color=white, fill opacity=0.5] (ps.center) ellipse ({1.9*\radius} and {1.5*\radius}); \end{scope} \end{scope} \begin{axis}[ name=ps-axis, at={(ps.center)}, view={\ViewAzimuth}{\ViewElevation}, % Set view angle disabledatascaling, % Align PGFPlots coordinates with TikZ anchor=origin, % Align PGFPlots coordinates with TikZ viewport={\ViewAzimuth}{\ViewElevation}{\radius}, % Align PGFPlots coordinates with TikZ hide axis,% this is not working completely ] % Plot equator and two longitude lines with occlusion \addFGBGplot[domain=0:2*pi, samples=100, samples y=1, dashed, Dark2-C!75] ({cos(deg(x))}, {sin(deg(x))}, 0); \end{axis} % there is this spurious space that hid axis is not removing \draw[red] (ps-axis.north west) rectangle (ps-axis.south east); \draw[orange] (ps.north west) rectangle (ps.south east); \end{tikzpicture} \end{document}
- Highlight a range of y-values in a pgfplot dateplotby J...S on September 14, 2025 at 7:14 am
I have a set of values that I am plotting with the dateplot library of pgfplots. But I also need to indicate the desired range within which those values ideally should lie in. How can we highlight such a range in a plot? This is the plot that I have got (a modified form of the example in this post): \begin{filecontents}{mwe.csv} Time,a,b 2020-1-1 10:30,6,4 2020-1-1 11:30,5,5 2020-1-1 12:30,3,7 2020-1-1 13:30,2,8 \end{filecontents} \documentclass{article} \usepackage{filecontents} \usepackage{pgfplots} \usepgfplotslibrary{dateplot} \begin{document} \begin{tikzpicture} \begin{axis}[ date coordinates in=x, xtick=data, xticklabel={\hour.\minute}, x tick label style={align=center,rotate=45}, ymajorgrids, legend pos=north west ] \addplot [ycomb,color=blue] table [col sep=comma,y=a] {mwe.csv}; \addlegendentry{a} \addplot [ycomb,color=red] table [col sep=comma,y=b] {mwe.csv}; \addlegendentry{b} \end{axis} \end{tikzpicture} \end{document} It gives the following plot: I need to give a visual indication of the desired range of values in this plot. I am thinking of highlighting a part of the plot by adding a rectangle that stretches throughout the plot horizontally, but spanning only the desired range of y-values. For instance, I wish to draw a rectangle bounded by y=3 and y=5 in the above plot. How can this be done? I thought of doing this: % \usepgfplotslibrary{fillbetween} \path [name path=A] (\pgfkeysvalueof{/pgfplots/xmin},3) -- (\pgfkeysvalueof{/pgfplots/xmax},3); \path [name path=B] (\pgfkeysvalueof{/pgfplots/xmin},5) -- (\pgfkeysvalueof{/pgfplots/xmax},5); \addplot [green] fill between [ of=A and B ]; But that doesn't work. It gives errors like: ./inp.tex: Argument of \pgfcalendar@datetojulian has an extra }. I wanted something like this: (I am not sure why the legend doesn't show up properly.)
- pgfpolar-plot is shifted rightby Matthias on September 12, 2025 at 9:02 am
The plot is shifted to the right -- it should be centered. Any ideas why? I assume it comes from my coordinate transformation, since I plot nothing, the coordinate system is centered. \documentclass{standalone} \usepackage{pgfplots} \usetikzlibrary{pgfplots.polar} \begin{document} \begin{filecontents*}{test_world.dat} 13.4050 52.5200 151.2093 -33.8688 -74.0060 40.7128 \end{filecontents*} % Berlin \def\latO{52.5200} \def\lonO{13.4050} \pgfmathdeclarefunction{aeqdr}{4}{% \pgfmathsetmacro\dlon{#1-#3} \pgfmathsetmacro\argtmp{sin(#4)*sin(#2)+cos(#4)*cos(#2)*cos(\dlon)} \pgfmathsetmacro\arg{min(1,max(-1,\argtmp))} \pgfmathsetmacro\cdeg{acos(\arg)} \pgfmathparse{\cdeg/180} } \pgfmathdeclarefunction{aeqdtheta}{4}{% \pgfmathsetmacro\dlon{#1-#3} \pgfmathparse{mod(atan2(sin(\dlon)*cos(#2),cos(#4)*sin(#2)-sin(#4)*cos(#2)*cos(\dlon)),360)} } \centering \begin{tikzpicture} \begin{polaraxis}[ width=8cm, height=8cm, y axis line style={draw=none}, separate axis lines, ymin=0, ymax=1, xtick distance=10, xticklabel={% \pgfmathparse{% int(mod(450-\tick,360))% }% \pgfmathprintnumber{% \pgfmathresult }\textdegree% }, yticklabels={}, ] \addplot+[only marks, mark=*, mark size=1.6pt] table[ x expr = {mod(450 - aeqdtheta(\thisrowno{0},\thisrowno{1},\lonO,\latO), 360)}, y expr = {aeqdr(\thisrowno{0},\thisrowno{1},\lonO,\latO)}, col sep=space, ] {test_world.dat}; \end{polaraxis} \end{tikzpicture} \end{document}
- Adding a point at the end of a graph and labeling the function [duplicate]by Twink on September 5, 2025 at 8:18 pm
I am trying to add a black circle to the next picture at (-1,0), to indicate that the graph starts there. I tried using \filldraw[black] (-1,0) circle (2pt) but it did not work. Also, how can I add a label of the function $f$ above the graph of the function? Here is my code: \documentclass[letterpaper,11pt]{article} %%tikz drawing \usepackage{tikz} \usetikzlibrary{arrows} \usepackage{pgfplots} \pgfplotsset{width=7cm,compat=1.8} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture}[>=triangle 45,] \hspace{200pt} \begin{axis}[width=10cm, axis lines=center, grid=both, grid style={line width=.1pt, draw=gray!10}, major grid style={line width=.2pt,draw=gray!50}, unit vector ratio*=1 1 1, xlabel={$x$}, ylabel={$y$}, xlabel style={below right}, ylabel style={above left}, xmin=-2,xmax=5, ymin=-1,ymax=3, axis line style={->}, xtick={-2,-1,0,1,2,3,4,5}, xticklabels={,-1,0,1,2,3,4,}, ytick={-1,0,1,2,3}, yticklabels={,0,1,2,}, ticklabel style = {font=\scriptsize}] \coordinate (O) at (0,0); \addplot+[->,mark=none,line width=1.3pt,domain=-1:5][samples=100,color=black]{(x+1)^(1/2)}; \filldraw[black] (-1,0) circle (2pt); \end{axis} \end{tikzpicture} \end{document}
- Viewing angles in pgfplot's axisby noparadise on August 29, 2025 at 2:34 pm
I am starting to work with pgfplots and I'm struggling to get my axes right. I know that choosing the two angles in the view={}{} option of the axis environment can change the setup of your axes. Momentarily I have the following code. \documentclass[crop=false]{standalone} \usepackage{pgfplots} \pgfplotsset{width=10cm,compat=1.9} \begin{document} \begin{figure}[!ht] \centering \begin{tikzpicture} \begin{axis}[ view={-45}{45}, xlabel={$x$}, ylabel={$y$}, zlabel={$z$}, axis lines=center, axis on top, samples=5, domain=-4:4, xtick=data, ytick=data, ztick=\empty, % no z ticks here ] \addplot3 [surf] {x*y}; \end{axis} \end{tikzpicture} \end{figure} \end{document} However, I would like my axes to look like in the figure below. Is there anyone who can help me in finding the right angles to get to this axis configuration? Thanks in advance!
- Memorizing inconsistent key names in pgfplotsby Paul Paulsen on August 25, 2025 at 6:13 pm
I absolutely love tikz and pgfplots, and I am really thankful for what their authors have built. I regularly am surprised and in awe by what people can accomplish in them. Also, both of them have among the best documentation I have ever come across, and the online versions (tikz and pgfplots) are so smooth to use that I even find myself wanting to learn new functionalities for fun. However, I have one big frustration with pgfplots: I am seemingly unable to ever memorize any of the keys I can use. I always need to look up how to fine tune my plots, no matter how recently I did the same thing - either in the documentation or a file I made earlier. That most code editors can't come up with suggestions for tikz and pgfplots commands doesn't make things easier (I currently mostly use overleaf). And I think the inconsistent naming for keys plays a big role in my difficulties. For example: xtick distance but extra x ticks - why not extra xticks? extra x ticks but extra x tick labels - why not extra x ticks labels? Does anyone have any tips and tricks how to work around this and how to remember the most important of the many, many, many possible options? And out of curiosity, are there any technical reasons for these inconsistencies?
- Pgfplot Heatmap building fails due to ```\pgfmath@dimen@ ...men@@ #1=0.0pt\relax \pgfmath@```by Matthias on August 24, 2025 at 11:30 am
I want to plot a heat map of our earth (it's actually SNR of HF-Propagation). This works fine, however, if enable the colorbar in my axis definition I run into this issue: ! Undefined control sequence. \pgfmath@dimen@ ...men@@ #1=0.0pt\relax \pgfmath@ This is the Result without colorbar: Here the latex code, as a full example: \begin{tikzpicture} \begin{axis}[ view={0}{90}, colormap/jet, %colorbar, %point meta min=-61.54, %point meta max=29.21, width=10cm, height=6cm, ] \addplot3[ surf, shader=interp, point meta=z ] table [ x index=1, %Long y index=0, %Lat z index=2, col sep=space ] {tote-zone.csv}; % \addplot [] table [] {world.dat}; \end{axis} \end{tikzpicture} tote-zone.csv: https://nopaste.net/logp5oV4Rr world.dat: https://nopaste.net/FK4vcztqXY EDIT: After some chat with ChatGPT-5 I come up with a minimal example: \documentclass{article} \usepackage{circuitikz} \makeatletter \let\empty\relax \makeatother \usepackage{pgfplots} \usepackage{pgfmath} \usepackage{pgfplotstable} \begin{document} \begin{tikzpicture} \begin{axis}[view={0}{90}, colormap/viridis, colorbar, width=10cm, height=6cm] \addplot3[surf, domain=0:1, y domain=0:1, point meta=z]{x*y}; \end{axis} \end{tikzpicture} \end{document} that fails with the same error: ! Undefined control sequence. \pgfmath@dimen@ ...men@@ #1=0.0pt\relax \pgfmath@ So the problem is \makeatletter \let\empty\relax \makeatother It seems that this is somewhere required in my project (I don't remember why). Has anyone a solution?
- PGFPlots and the gradient of a functionby Sebastiano on August 21, 2025 at 8:37 pm
Tonight, I discovered that pgfplots can generate automatic vortices (gradient), i.e., level curves, using the contour lua= option when compiling with LuaLaTeX. I made some modifications to the code found on page 90 of the latest updated PGFPlots documentation. \documentclass[a4paper]{article} \usepackage{amsmath,amssymb} \usepackage{pgfplots} \pgfplotsset{width=7cm,compat=1.18} \usetikzlibrary{arrows.meta} \usepackage{tikz-3dplot} \usetikzlibrary{shapes.geometric} \begin{document} \begin{tikzpicture} \begin{axis}[ title={$x \exp(-x^2-y^2)$ and its gradient}, domain=-2:2, %view={0}{90}, 2D view={35}{35}, %3D axis background/.style={fill=white}, domain = -2:2 ,y domain = -2:2 ,xmin = -2 ,xmax = 2 ,ymin = -2 ,ymax = 2 ,zmin = -2 ,zmax = 2, xlabel=$x$, ylabel=$y$, zlabel=$z$, ] \addplot3 [ contour lua={number=10,labels=false},thick,samples=100 ] {exp(0-x^2-y^2)*x}; \addplot3 [ blue,-stealth,samples=15, quiver={ u={exp(0-x^2-y^2)*(1-2*x^2)},%<----------- ∂ f / ∂x v={exp(0-x^2-y^2)*(-2*x*y)},%<----------- ∂ f / ∂y scale arrows=0.3, }, y domain=-2:2 ] {exp(0-x^2-y^2)*x}; \end{axis} \begin{scope}[canvas is xy plane at z=0,transform shape] \node at (0,0) [rotate=90,scale=2] {$x$}; \node at (1,1) [rotate=90,scale=2] {$y$}; \node at (-2,2) [rotate=90,scale=2] {$z$}; \end{scope} \end{tikzpicture} \end{document} The questions are as follows: How can I modify the code to compute the gradient of the function using the contour lua option, but compiling with pdfLaTeX instead of LuaLaTeX? In the 3D plot, it seems that the vortices or spirals extend (gradient of the function) into the three-dimensional space. How can I fix the display to make it appear more accurate? Additionally, how can I modify the labels to achieve this desired effect of the image below? Related my previous questions: Managing vortex and spiral behavior in PGFPlots Drawing a 3D vector field with vortices and perspective axis labels
- Wrong axis label position in PGFPlots with extra ticksby B Legrand on August 19, 2025 at 2:24 pm
I noticed an issue with the placement of axis labels in PGFPlots when all of the following conditions are met: tick align=center or tick align=outside is used (not with tick align=inside), there is at least one extra tick, and the compat setting is 1.3 or higher. In this situation, the axis label gets shifted further away from the axis than expected, as if the label position were incorrectly computed based on the tick length. The following image illustrates the problem: First row: tick align=inside (x label placed correctly). Second row: tick align=center, with an extra tick in the second plot You can see that an unwanted extra space between axis and label is added. Third and fourth rows: tick align=outside. The issue becomes worse, and in the last row where I doubled the tick length, the axis label appears to have been shifted by twice that extra tick length (instead of one). This makes me think there is a bug in how PGFPlots calculates the label position when extra ticks are present in these alignments. How can I fix this in PGFPlots without having to apply a manual “hack” for each individual plot? The MWE: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[tick align=inside, width = 0.5\textwidth, height=3cm, xlabel={Bla bla bla}] \addplot coordinates {(0,0) (10,10)}; \end{axis} \end{tikzpicture} \begin{tikzpicture} \begin{axis}[tick align=inside, width = 0.5\textwidth, height=3cm, xlabel={Bla bla bla}, extra x ticks={7}, extra x tick labels={\(\alpha\)}] \addplot coordinates {(0,0) (10,10)}; \end{axis} \end{tikzpicture} \hrule\bigbreak \begin{tikzpicture} \begin{axis}[tick align=center, width = 0.5\textwidth, height=3cm, xlabel={Bla bla bla}] \addplot coordinates {(0,0) (10,10)}; \end{axis} \end{tikzpicture} \begin{tikzpicture} \begin{axis}[tick align=center, width = 0.5\textwidth, height=3cm, xlabel={Bla bla bla}, extra x ticks={7}, extra x tick labels={\(\alpha\)}] \addplot coordinates {(0,0) (10,10)}; \end{axis} \end{tikzpicture} \hrule\bigbreak \begin{tikzpicture} \begin{axis}[tick align=outside, width = 0.5\textwidth, height=3cm, xlabel={Bla bla bla}, xticklabel shift=10pt] \addplot coordinates {(0,0) (10,10)}; \end{axis} \end{tikzpicture} \begin{tikzpicture} \begin{axis}[tick align=outside, width = 0.5\textwidth, height=3cm, xlabel={Bla bla bla}, extra x ticks={7}, extra x tick labels={\(\alpha\)}, xticklabel shift=10pt] \addplot coordinates {(0,0) (10,10)}; \end{axis} \end{tikzpicture} \hrule\bigbreak \begin{tikzpicture} \begin{axis}[tick align=outside, width = 0.5\textwidth, height=3cm, major tick length=0.3cm, xlabel={Bla bla bla}] \addplot coordinates {(0,0) (10,10)}; \end{axis} \end{tikzpicture} \begin{tikzpicture} \begin{axis}[tick align=outside, width = 0.5\textwidth, height=3cm, major tick length=0.3cm, xlabel={Bla bla bla}, extra x ticks={7}, extra x tick labels={\(\alpha\)},] \addplot coordinates {(0,0) (10,10)}; \end{axis} \end{tikzpicture} \hrule\bigbreak \begin{tikzpicture} \begin{axis}[tick align=outside, width = 0.5\textwidth, height=3cm, major tick length=0.3cm, xlabel={Bla bla bla}] \addplot coordinates {(0,0) (10,10)}; \end{axis} \end{tikzpicture} \begin{tikzpicture} \begin{axis}[tick align=outside, width = 0.5\textwidth, height=3cm, major tick length=0.3cm, xlabel={Bla bla bla}, extra x ticks={7}, extra x tick labels={\(\beta_{\beta_{\beta_{\beta}}}\)}] \addplot coordinates {(0,0) (10,10)}; \end{axis} \end{tikzpicture} \hrule\bigbreak \begin{tikzpicture} \begin{axis}[tick align=inside, width = 0.5\textwidth, height=3cm, xlabel={Bla bla bla}] \addplot coordinates {(0,0) (10,10)}; \end{axis} \end{tikzpicture} \begin{tikzpicture} \begin{axis}[tick align=inside, width = 0.5\textwidth, height=3cm, xlabel={Bla bla bla}, extra x ticks={7}, extra x tick labels={\(\beta_{\beta_{\beta_{\beta}}}\)}] \addplot coordinates {(0,0) (10,10)}; \end{axis} \end{tikzpicture} \hrule\bigbreak \begin{tikzpicture} \begin{axis}[tick align=outside, width = 0.5\textwidth, height=3cm, major tick length=0.3cm, xlabel={Bla bla bla},] \addplot coordinates {(0,0) (10,10)}; \end{axis} \end{tikzpicture} \begin{tikzpicture} \begin{axis}[tick align=outside, width = 0.5\textwidth, height=3cm, major tick length=0.3cm, xlabel={Bla bla bla}, extra x ticks={7}, extra x tick labels={\(\beta_{\beta_{\beta_{\beta}}}\)}, extra x tick style={xticklabel pos=top}] \addplot coordinates {(0,0) (10,10)}; \end{axis} \end{tikzpicture} \end{document} Maybe related: Pgfplots y label and extra ticks positioning problem. Edit 1: As suggested in kabenyuk’s answer, I tried using the xlabel absolute and ylabel absolute keys, but this creates other issues since the position of the axis labels is no longer computed dynamically based on the size of the tick labels. Below is an example of the problem encountered: Edit 2: I tried to dive into the PGFPlots code, in particular the files pgfplotsticks.code.tex and pgfplots.code.tex, but the code is too complex and far beyond my skills. By trial and error, I did try some modifications, but they don’t solve the problem in the particular case where ticks labels, extra ticks labels, and the axis label are not all on the same side (bottom/top for the x-axis, left/right for the y-axis), as in the last example of the MWE. On the contrary, they make it worse! Moreover, it also doesn’t work when ticklabel shift is nonzero. In any case, I suspect that a length (probably the ticks length) is being counted twice when using an extra tick. But I couldn’t find at which level this double counting happens. Perhaps a conditional structure would need to be implemented to handle the different possible combinations of ticks labels, extra ticks labels, and axis label positions, but I don’t know how to implement such a thing. The modifications in question: \usepackage{etoolbox} \makeatletter \patchcmd{\pgfplots@ticklabel@maxtickdimen@finish} {% \pgf@xa=\csname pgfplots@maxtickdimen@extrashift@#1\endcsname\relax \advance\pgf@xa by \csname pgfplots@maxtickdimen@#1\endcsname\relax }{% \pgf@xa=\csname pgfplots@maxtickdimen@extrashift@#1\endcsname\relax \pgf@xb=\csname pgfplots@maxtickdimen@#1\endcsname\relax \ifdim\pgf@xb>\pgf@xa\relax % max(pgfplots@maxtickdimen@ ; pgfplots@maxtickdimen@extrashift@) instead of pgfplots@maxtickdimen@ + pgfplots@maxtickdimen@extrashift@ \pgf@xa=\pgf@xb\relax \fi }{}{} \patchcmd{\pgfplots@show@ticklabel@@} {% \node at (\pgfplots@ticklabel@at@x,\pgfplots@ticklabel@at@y) {\csname pgfplots@#1ticklabel\endcsname};% \pgfplots@ticklabel@maxtickdimen@updateforcurrentpath {#1} {\pgf@x=\pgfplots@ticklabel@at@x\space\pgf@y=\pgfplots@ticklabel@at@y\space}% }{% \node at (\pgfplots@ticklabel@at@x,\pgfplots@ticklabel@at@y) {\csname pgfplots@#1ticklabel\endcsname};% \begingroup \pgf@x=\pgfplots@ticklabel@at@x\relax \pgf@y=\pgfplots@ticklabel@at@y\relax \pgf@xa=\pgfplots@tick@offset pt\relax \pgfplotsqpointoutsideofticklabelaxistransformed{#1}{\pgf@x,\pgf@y}{\the\pgf@xa}% \pgfplots@ticklabel@maxtickdimen@updateforcurrentpath {#1} {\pgf@x=\pgf@x\space\pgf@y=\pgf@y\space}% \endgroup }{}{} \makeatother
- Change point according to shapes and colours independently from csv tableby Miloop on August 18, 2025 at 9:32 pm
I am trying to make a scatter (in a group plot) with data taken from a reference csv file. The x values are in the column PC1, y values are in the column PC2. I wanted the mark / shape to change according to "species" and the colour to change according to "Group". Here is my current working minimal code where I can change the colour according to "Group", but I am unable to find a way to change the marker shape according to species. Here is my current code: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usepgfplotslibrary{groupplots} \begin{document} \begin{tikzpicture} \begin{groupplot}[% group style={group size=2 by 3, horizontal sep=50pt, vertical sep=70pt}, grid=major, grid style={dotted}, ] \nextgroupplot[% legend columns=-1, legend style={% draw=none,% font=\scriptsize, at={(0.5,-0.25)}, anchor=center, /tikz/every even column/.append style={column sep=0.5cm}}, xlabel= Dimension 1 (Variance: A), ylabel= Dimension 2 (Variance: B), scatter/classes={% Cluster1={black},% Cluster2={red},% Cluster3={orange},% Cluster4={brown}% }, scatter, only marks,% scatter src=explicit symbolic,% nodes near coords*={\color{black}{\tiny{\Label}}}, visualization depends on={value \thisrow{Phase} \as \Label}, title={Attempting plots}, ] \addplot [coordinate style/.from= \thisrow{style1} ] table[header=true, x=PC1, y=PC2,% col sep=comma, meta=Group ]% {Dataplots.csv}; % \legend{Cluster1, Cluster2, Cluster3, Cluster4} \end{groupplot} \end{tikzpicture} \end{document} here is the current output: and here is a snippet of my .csv file: Phase,species,Group,PC1,PC2,style1 1,Nannochloropsis sp.,Cluster1,-0.734450557719584,-0.0847134464097437,above 2,Nannochloropsis sp.,Cluster2,0.773295775967202,-1.66661307804925, 3,Nannochloropsis sp.,Cluster2,1.42698922050584,-0.388625246873419,right 4,Nannochloropsis sp.,Cluster2,0.762295941365682,-0.774238159403132,left 5,Nannochloropsis sp.,Cluster1,-1.6843212010837,-0.653047537913571, 6,Nannochloropsis sp.,Cluster2,1.57671153631581,0.176441969080513, 7,Nannochloropsis sp.,Cluster2,1.50418892016015,0.00830684847118905, 8,Nannochloropsis sp.,Cluster2,1.55668508185563,0.210127153121995, 9,Nannochloropsis sp.,Cluster2,1.12792941666917,-0.446037673614503, 10,Nannochloropsis sp.,Cluster1,-0.926556289159005,0.0669778004986934, 11,Nannochloropsis sp.,Cluster1,-1.51145943166273,-0.148218826593831, 12,Nannochloropsis sp.,Cluster1,-0.783668659075298,-0.333785592897085, 13,Nannochloropsis sp.,Cluster3,-2.04013934967114,-3.38635094179644, 14,Nannochloropsis sp.,Cluster3,-1.78347563822441,-2.86473893532614, 15,Nannochloropsis oculata,Cluster3,-2.20963153164226,-1.48222984126996, 16,Nannochloropsis oculata,Cluster1,-0.804260251840743,0.343532567678808, 17,Nannochloropsis oculata,Cluster1,-2.21242673684293,0.968433445806657, 18,Nannochloropsis oculata,Cluster3,-2.15590880212213,-0.00137825576226731, 19,Nannochloropsis oculata,Cluster2,1.01072360007777,1.5768720013781,
- How to make the font of standalone graphics with pgfplots the same as the beamertheme in use such as moloch or metropolisby Natal Pires on August 15, 2025 at 11:25 pm
I would like to achieve font consistency between graphics created using the standalone class and those rendered directly in Beamer using the metropolis or moloch themes. I'm creating plots with pgfplots for my lectures, and to simplify compilation, I'm generating the plots as separate PDF files using the standalone class and including them in the presentation. However, I'm having trouble matching the fonts used in the standalone figures to the ones used by Beamer when using themes like metropolis or moloch. In other words, I want the standalone-generated figures to use exactly the same font as if the plot were generated directly within a Beamer frame using those themes. \documentclass[border=1pt,tikz]{standalone} \usepackage{siunitx} \usepackage{fontspec} \setsansfont[ ItalicFont={Fira Sans Light Italic}, BoldFont={Fira Sans}, BoldItalicFont={Fira Sans Italic} ]{Fira Sans Extra Light} \setmonofont{Fira Mono} \usepackage{unicode-math} \setmathfont{FiraMath-Regular} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \pgfmathsetmacro{\R}{0.0821} \begin{tikzpicture} \footnotesize \begin{axis}[ xlabel={$T (\si{\degreeCelsius})$}, ylabel={$V (L)$}, xmin=-273.15, xmax=310, ymin=0, ymax=50, grid=both, width=12cm, axis background/.style={fill=teal!5}, height=7cm, enlargelimits=0.05, samples=200, xlabel style={right}, ylabel style={above}, xtick={-273.15, -200, -100, 0, 100, 200, 300}, ytick distance=5, legend pos=south east ] % Linha tracejada: de -273.15 a -100 \addplot[ domain=-273.15:-100, densely dashed, thick, black, line width= 0.5pt ] {0.0821*(x + 273.15)}; % Linha sólida: de -100 a 300 \addplot[ domain=-100:300, solid, thick, teal, ] {0.0821*(x + 273.15)}; % Ponto de interseção com o eixo y (x=0) \addplot[ only marks, mark=*, mark size=2pt, red, fill=yellow ] coordinates {(0,22.438215)}; % Ponto de interseção com o eixo y (x=0) \addplot[ only marks, mark=*, mark size=2pt, teal, fill=yellow ] coordinates {(-273.15,0)}; \node[rectangle,fill=cyan!20,align=center,rounded corners,font=\scriptsize] (A) at (axis cs:0,35) {22.4 L\\ Molar volume}; \draw[red,-stealth] (axis cs:0,23) -- (A); \draw[line width=0.8pt, rounded corners, -stealth] (axis cs:-273.15,0) |- (axis cs:-230,25) node[fill=cyan!20,rounded corners,right,align=center,font=\scriptsize] at (axis cs:-230,25){Thermodynamic\\ zero = -273.15 \si{\degreeCelsius}}; \end{axis} \end{tikzpicture} \end{document} Here is the code for the chart generated in the metropolis theme frame environment. \documentclass[tikz]{beamer} \usepackage{siunitx} \usetheme{metropolis} \usepackage[no-math]{fontspec} \usepackage{tabularray} \usepackage{tikz} \usepackage{pgfplots} \usetikzlibrary{arrows.meta} \begin{document} \begin{frame}{Graph made with code in the frame.} \pgfmathsetmacro{\R}{0.0821} \begin{tikzpicture} \footnotesize \begin{axis}[ xlabel={$T (\si{\degreeCelsius})$}, ylabel={$V (L)$}, xmin=-273.15, xmax=310, ymin=0, ymax=50, grid=both, width=12cm, axis background/.style={fill=teal!5}, height=7cm, enlargelimits=0.05, samples=200, xlabel style={right}, ylabel style={above}, xtick={-273.15, -200, -100, 0, 100, 200, 300}, ytick distance=5, legend pos=south east ] % Linha tracejada: de -273.15 a -100 \addplot[ domain=-273.15:-100, densely dashed, thick, black, line width= 0.5pt ] {0.0821*(x + 273.15)}; % Linha sólida: de -100 a 300 \addplot[ domain=-100:300, solid, thick, teal, ] {0.0821*(x + 273.15)}; % Ponto de interseção com o eixo y (x=0) \addplot[ only marks, mark=*, mark size=2pt, red, fill=yellow ] coordinates {(0,22.438215)}; % Ponto de interseção com o eixo y (x=0) \addplot[ only marks, mark=*, mark size=2pt, teal, fill=yellow ] coordinates {(-273.15,0)}; \node[rectangle,fill=cyan!20,align=center,rounded corners,font=\scriptsize] (A) at (axis cs:0,35) {22.4 L\\ Molar volume}; \draw[red,-stealth] (axis cs:0,23) -- (A); \draw[line width=0.8pt, rounded corners, -stealth] (axis cs:-273.15,0) |- (axis cs:-230,25) node[fill=cyan!20,rounded corners,right,align=center,font=\scriptsize] at (axis cs:-230,25){Thermodynamic\\ zero = -273.15 \si{\degreeCelsius}}; \end{axis} \end{tikzpicture} \end{frame} \end{document}```
- Managing vortex and spiral behavior in PGFPlotsby Sebastiano on August 15, 2025 at 10:59 am
I am trying to draw a vector field in pgfplots, but I am encountering issues that I can't solve despite various attempts. Specifically, I want the vortices or spirals to be dependent by the vector field, but when I change the value of parameters of the vector field F(u,v,w) or the vortex function H, the figure is completely wrong. Every time I need to draw the field, I have to make manual adjustments, such as with the shift={(-2.5, -2)}. How can I solve this problem and make the spirals and vortices dependent by vector field? For example, if I consider the function in two variables: F(u,v,w) = (x²y - xy², x²y - yx, 0) the Geogebra output is: I should to see, in my code, a correct description or visualization of the vector field, as expected. But if I use this \addplot3[ quiver={ u={x^2*y-x*y^2}, % x-component = 0 v={x^2*y-y*x}, % y-component w={0}, % z-component = 0 scale arrows=0.2 }, -stealth, blue, samples=16, domain=-5.01:5.01, y domain=-2.45:5 ] (x,y,0); I will obtain, as output, this bad graph: The comments in the code are due to the many tests and improvements. The .tex code is related to the vector field F(x,y,0) = 0 x̂ +(-2y² + y) ŷ + 0 ẑ and two independent vortices: \documentclass[a4paper]{article} \usepackage{pgfplots} \usepackage[dvipsnames]{xcolor} \pgfplotsset{compat=newest} \begin{document} \begin{figure}[h] \centering \begin{tikzpicture} \begin{axis}[% % grid=major, colormap/cool, view={35}{35}, shader=flat, xlabel=$x$, ylabel=$y$, zlabel=$z$, axis equal, ] \addplot3[surf,gray!60, opacity=0.5]{0}; % Orange plane at z=0 without grid lines %\addplot3[ % draw=none, % fill=orange!40, % opacity=0.5 %] coordinates { % (-2,-2,0) % ( 2,-2,0) % ( 2, 2,0) % (-2, 2,0) %}; % Vector field F(x,y) = (-2y^2 + y) \hat{y} \addplot3[ quiver={ u={0}, % x-component = 0 v={-2*y^2 + y}, % y-component w={0}, % z-component = 0 scale arrows=0.2 }, -stealth, blue, samples=16, domain=-5.01:5.01, y domain=-2.45:5 ] (x,y,0); % Disegno della spirale di Archimede in coordinate polari, applicando uno shift nel piano cartesiano %\pgfmathdeclarefunction{G}{2}{\pgfmathparse{#1*#2}} %\addplot [samples=1000, solid, thick, data cs=polarrad, domain=0:5*pi, shift={(-2.5, -2)}] % {G(0.05, x)}; % G(a=0.1, θ=x) è la spirale di Archimede %Definizione della funzione F(a, b, θ, c, θ0) = a e^(b * (θ - θ0)) + c \pgfmathdeclarefunction{H}{5}{\pgfmathparse{#1*exp(#2*(#3-#5))+#4}} % Disegno della curva in coordinate polari, applicando uno shift \addplot [red,samples=1000, solid, thick, data cs=polarrad, domain=0:10*pi, shift={(-2.5, -2)}] {H(1,-0.1,x,0.1,4)}; % r(θ) = 2 e^(-0.1*(θ + 2.5)) - 0.1 \addplot [ForestGreen,samples=1000, solid, thick, data cs=polarrad, domain=0:10*pi, shift={(-8, -8)}] {H(1,-0.1,x,0.1,4)}; % r(θ) = 2 e^(-0.1*(θ + 2.5)) - 0.1 \end{axis} \end{tikzpicture} \caption{Vector field $\mathbf{F}(x,y) = (-2y^2 + y)\,\mathbf{\hat{y}}$ on the plane $z=0$} \end{figure} \end{document} Related my previous question: Drawing a 3D vector field with vortices and perspective axis labels
- I want to put the image in place of the logo written above In this posterby bakhta marouf on August 13, 2025 at 12:21 am
I want to put the image in place of the logo and the name of the university that is in poster \documentclass[20pt,margin=1in,innermargin=-4.5in,blockverticalspace=-0.25in]{tikzposter} \geometry{paperwidth=33.11in,paperheight=46.81in} %A0 % \geometry{paperheight=33.11in,paperwidth=23.4in} %A1 \usepackage[utf8]{inputenc} \usepackage{csquotes} %\usepackage[estonian]{babel} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amsthm} \usepackage{amssymb} \usepackage{mathrsfs} \usepackage{graphicx} \usepackage{lipsum} \usepackage[export]{adjustbox} \usepackage{enumitem} \usepackage[backend=biber,style=numeric]{biblatex} \usepackage{unitartu-theme} \makeatletter \setlength{\TP@visibletextwidth}{31.0in} \setlength{ \TP@visibletextheight}{45in} \makeatother \usepackage{mwe} % for placeholder images \usepackage{bm} \usepackage{bbm} \addbibresource{refs.bib} % set theme parameters \tikzposterlatexaffectionproofoff \usetheme{UniTartuTheme} \usecolorstyle{UniTartuStyle} \usepackage[scaled]{helvet} \renewcommand\familydefault{\sfdefault} \renewcommand{\vec}[1]{\bm{#1}} \newcommand{\Tr}{\text{Tr}} \usepackage[T1]{fontenc} \title{\parbox{0.8\linewidth}{UniTartuCS Poster Template - Example of a long title for a poster}} \author{\textbf{John Smith}\textsuperscript{1}} \institute{\textsuperscript{1}Institute of Computer Science, University of Tartu} \titlegraphic{\includegraphics[width=0.35\linewidth]{unitartu_compact.png}} % begin document \begin{document} \maketitle \centering \begin{columns} \column{0.5} \block{Section 1}{ \lipsum[30] \begin{align*} \includegraphics[width=0.1\textwidth,valign=c]{kitten.jpg} \end{align*} \lipsum[10] \begin{align*} x = \frac{-b \pm\sqrtsign{b^2 - 4ac}}{2a}. \end{align*} \lipsum[20] } \block{Section 2}{ \lipsum[100] \lipsum[100] \lipsum[100] \lipsum[100] \lipsum[100] \lipsum[100] \lipsum[100] \lipsum[100] \lipsum[100] \lipsum[100] } \column{0.5} \block{Section 3}{ \lipsum[100] \lipsum[100] \lipsum[100] \lipsum[100] \lipsum[100] \textcolor{MainBlue}{\lipsum[100]} \lipsum[100] \lipsum[100] \lipsum[100] \lipsum[100] } \block{Conclusions}{ \lipsum[100] \cite{dirac} \cite{knuthwebsite} \lipsum[100] \lipsum[100] } \block{References}{ \begin{center} \mbox{}\vspace{-1\baselineskip} \printbibliography[heading=none] \end{center} } \end{columns} \end{document}
- pgfplots: yticklabel positioning in partial polar plotby pawq on August 12, 2025 at 11:46 am
I'm drawing polar plots covering only half of the full 360° (the right half of the circle) using pgfplots, and I can't figure out how to shift yticklabels to the top part of the plot (+90° in the plot below). I looked in both the pgfplots documentation and the forum and none of the options I found helped. MWE: \documentclass{article} %\usepackage{graphicx} \usepackage{textcomp, gensymb} % \degree command in gensymb, textcomp to avoid warnings \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.17} \usepgfplotslibrary{polar} \begin{document} \begin{figure} \begin{center} \begin{tikzpicture} \small \begin{polaraxis}[ width = 10cm, height = 10cm, grid = major, xmin = -90, xmax = 90, xtick distance = 20, xticklabel = $\pgfmathprintnumber{\tick}\degree$, xlabel = {Polar angle}, xlabel style = {rotate = 45, xshift = -13mm, yshift = -5mm, anchor = north}, ymin = 52, ymax = 72, y coord trafo/.code=\pgfmathparse{#1-52}, y coord inv trafo/.code=\pgfmathparse{#1+52}, ytick distance = 4, ytick pos = right, yticklabel pos = top, yticklabel style = {anchor = east}, ylabel = {Value [unit]}, ylabel style = {rotate = 90, xshift = 9mm, yshift = 7mm, anchor = east} ] \addplot+ coordinates { (40, 66) (20, 63) (0, 59) (-20, 63) (-40, 67) }; \end{polaraxis} \end{tikzpicture} \end{center} \caption{Polar plot.} \end{figure} \end{document} What the code produces and what I'm trying to achieve: I know that the ytick pos option moves the ticks between the top and bottom halves of the plot, but the yticklabel pos option doesn't do anything for me. Thanks in advance!
- Size of chemical formulas on a chartby Nicolas on August 12, 2025 at 6:45 am
I need to add equations to some parts of the curves: I'm using the chemmacros package. I'm having trouble because the size of the chemical formulas seems too large compared to the curves: I therefore need to reduce their size. My problem is that when using the \tiny command, I find the formulas look unattractive and crowded (and for the positive charge, I find the + sign is way too large compared to the rest). \documentclass[10pt,border=1mm,tikz]{standalone} \usepackage[french]{babel} \usepackage{lmodern} \usepackage{pgfplots}\pgfplotsset{compat=newest} \usepackage{siunitx}% unités et écriture de valeurs \usepackage{chemmacros} \begin{document} \footnotesize \begin{tikzpicture} \begin{axis}[% mise en forme du graphique : xmin=-0.51,xmax=2.1, ymin=-30,ymax=41, axis lines = middle, xlabel=$\Delta E (\unit{\V})$, ylabel=$i (\unit{\micro \A}$), ytick=\empty, xtick distance=1, ] \addplot [blue,samples=100,domain=-0.25:0.1] {-11.55+0.062*(1-exp(-(x-0.0194)/0.0499))}; \addplot [blue,samples=100,domain=0.1:1.6] {-11.5+19.1/(0.658+exp(-62.6*(x-0.507)))}; \draw[densely dotted] (0,1)node[above left]{\tiny $i_a$} -- (0.515,1)--(0.515,-15); \draw[densely dotted] (0,-1)node[below left]{\tiny $i_c$} -- (0.50,-1) -- (0.50,-15); \draw[very thin,{Stealth[length=0.75mm,reversed]}-{Stealth[length=0.75mm,reversed]}](0.47,-15)--(0.545,-15); \node(a) at (0.53,-16.5){$\Delta E_a$}; \node(b) at (-0.25,-20){\ch{H2 <-{} H+}}; \end{axis} \end{tikzpicture} \end{document} I tried changing the overall font size in the preamble, but it doesn't change anything. What is the best method to adapt the size of the chemical equations to the size of the curves?
- Mathematical path or approximation for a curly brace usable in 3D projective diagramsby Jasper on August 9, 2025 at 12:52 am
I’m not sure if this is the best approach, but I’ve been trying to create a curly brace using an explicit mathematical function. So far, I’ve combined a couple of curves to approximate the shape, but I’m concerned this might not be the right method. My goal is to include a properly occluded curly brace in a 3D diagram (possibly in projective space), which is why I need a precise mathematical definition rather than a decorative path. Ideally, I’d like either: an exact path definition for a curly brace, or a good mathematical approximation (even one obtained by tracing an existing brace and turning it into a path). Here is my attempt: \documentclass[ tikz ,border = 1cm ]{standalone} \usetikzlibrary{decorations.pathreplacing} \pgfmathdeclarefunction{f}{1}{% \pgfmathparse{ (1/32) / ( (#1+2.05)*(#1-2.05) ) + (1/4) }% } \pgfmathdeclarefunction{g}{1}{% \pgfmathparse{ (1/8) / ( (32*#1)^2 + 1 ) }% } \begin{document} \begin{tikzpicture} \path[ preaction = { draw ,thick ,blue } ,postaction = { draw ,red ,decorate ,decoration = { brace ,raise = 2ex } } ] (0,0) -- (4,0) ; \draw[ domain = -2:2 ,samples = 500 ,green ] plot ( {\x+2} ,{-(f(\x)+g(\x)+1/4)} ); \end{tikzpicture} \end{document}
- Proper display of markers in legend of ternary plot when using area style in pgfplots?by Buck Thorn on August 3, 2025 at 5:13 pm
I'm trying to combine patches and individual marker symbols in a ternary diagram, but not able to display the markers in the legend. The following is my attempt with two different ways of adding points, neither resulting in symbols appearing properly in the legend. Evidently there is a conflict due to use of area style, which enforces the display of patches but overrides later definitions (without area style the markers show up properly in the legend). Any ideas how to implement this so that the marker symbols show up in the legend? \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18, tick label style={font=\sffamily\small}, label style={font=\sffamily\small}, xticklabel={$\mathsf{\pgfmathprintnumber{\tick}}$}, yticklabel={$\mathsf{\pgfmathprintnumber{\tick}}$}, zticklabel={$\mathsf{\pgfmathprintnumber{\tick}}$}, } \renewcommand{\familydefault}{\sfdefault} \begin{document} \usepgfplotslibrary{ternary} \begin{tikzpicture} \begin{ternaryaxis}[ xscale=-1, clip=false, disabledatascaling, y label style={rotate=-60,anchor=south,yshift=3ex}, y tick label style={anchor=west}, x label style = {rotate=60,anchor=south,yshift=3ex}, x tick label style={anchor=east}, xlabel=\% 1, ylabel=\% 2, zlabel=\% 3, label style={font={\sffamily\small}}, tick label style={font=\sffamily\footnotesize}, area style, minor tick num=1, grid=both, ] % try adding points to the ternary plot. Use addlegendentry to add legend entries. % method 1: addplot \addplot [mark=o,solid,mark size=3,only marks] coordinates { (0.2,0.3) }; \addlegendentry{sample} % method 2: addplot3 \addplot3 [mark=*,solid,mark size=3,only marks] coordinates { (0.1,0.4,0.5) }; \addlegendentry{sample2} \end{ternaryaxis} \end{tikzpicture} \end{document} Output:
- pgfplots: Using set layers in an overlay pictureby schtandard on July 5, 2025 at 1:58 pm
Using pgfplots, I want to draw a plot as an overlay picture, making use of layers inside that plot. However, when I say \begin{tikzpicture} [overlay] \pgfplotsset{set layers} \begin{axis} \end{axis} \end{tikzpicture} I get two ! Dimension too large. errors. pgfplots seems to attempt to set both unit lengths (\pgf@x and \pgf@y) to -32000.0pt. Why is that and how can I avoid it? For tinkering, here is a slightly more useful MWE. Interestingly, the result looks fine in this example. (In larger pictures, the errors do cause havoc, though.) \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} [remember picture] \draw [green] coordinate (test) circle [radius=5cm]; \end{tikzpicture} \begin{tikzpicture} [remember picture, overlay] \pgfplotsset{set layers} \begin{axis} [at=(test), anchor=center, ymajorgrids] \addplot+ {x^2}; \begin{pgfonlayer}{axis grid} \fill [red] (axis cs:3,20) circle [radius=2cm]; \end{pgfonlayer} \end{axis} \end{tikzpicture} \end{document}
- Plotting a cylinder, and a plane and their intersectionby latex_is_pain on June 10, 2025 at 1:36 pm
Hello great Tex experts. I want to draw the following plot(from desmos) which is a cylinder, a plane and their intersection. And here is my code: \begin{tikzpicture} \begin{axis}[ view={47}{47}, axis lines=center, xlabel={$x$}, ylabel={$y$}, zlabel={$z$}, xmin=-3, xmax=3, ymin=-3, ymax=3, zmin=-2, zmax=6, legend style={font=\scriptsize}, axis line style={gray!50!black}, tick style={gray!50!black}, tick label style={gray!50!black}, label style={font=\tiny,color=gray!50}, set layers ] % plane \addplot3[surf, % domain=-2:2, domain y=-2:2, opacity=1, colormap/gray,fill=violet] {4 - x}; \addlegendentry{$z+x=4$} % cylinder \addplot3[surf, % domain y=-2:6, domain=0:360, opacity=0.5, colormap/greenyellow,fill=yellow!70] ({sqrt(2)*cos(x)}, {sqrt(2)*sin(x)}, {y}); \addlegendentry{$x^2+y^2=2$} % ellipse \addplot3[thick, blue, domain=0:360,smooth] ({sqrt(2)*cos(x)}, {sqrt(2)*sin(x)}, {4-sqrt(2)*cos(x)}); \addlegendentry{$f(t)$} \end{axis} \end{tikzpicture} And the result: Notice the lower part (below the ellipse) of the cylinder is drawn which is the problem. How to fix that? Also if I reorder the plot commands to draw the cylinder, then plane, then the result will have the plane only (cylinder won't be drawn). Thank you for your time and consideration.
- 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}
- 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
- Plotting a Discontinuous Function with pgfplots in LaTeXby Fractal on March 18, 2025 at 11:06 pm
I am trying to plot the function $F(x) = \int_{\ln(x)}^{\ln(2x)} \dfrac{e^t}{t} dt \quad \text{if } x \neq 0 \quad ; \quad F(0) = 0$ using TikZ/pgfplots in LaTeX. The function is well-defined for $x \in ]0, 1/2[ and x \in ]1, +\infty[ but is undefined for x \in ]1/2, 1[ You can see his variations table : What I have tried I attempted to use \addplot in pgfplots with gnuplot to compute the integral numerically. However, nothing is displayed. I also tried breaking the plot into two separate parts: one for x \in ]0, 1/2[ and another for x \in ]1, +\infty[ but the graph does not appear. I suspect the issue might come from pgfplots struggling with numerical integration involving logarithmic limits. What I need How can I properly plot this function while handling the discontinuity using pgfplots ? Is there a better way to evaluate the integral numerically in LaTeX (without requiring external scripts)? Would it be more appropriate to precompute the function values in Python/Matlab and import them into LaTeX? Here is my latest attempt \documentclass{article} \usepackage{pgfplots} \usepackage{amsmath} \begin{document} \begin{tikzpicture} \begin{axis}[ axis x line=center, axis y line=center, xlabel={$x$}, ylabel={$F(x)$}, samples=100, domain=0.01:0.49, % First part restrict y to domain=-5:5, grid=major, thick ] \addplot[ blue, thick ] gnuplot [ raw gnuplot ] { f(x) = real(quad(exp(t)/t, log(x), log(2*x))); plot [x=0.01:0.49] f(x); }; \end{axis} \end{tikzpicture} \end{document} Update : This is what I have using gnuplot : The code : set terminal pngcairo size 800,600 set output "F_plot.png" set title "Graph of F(x)" set xlabel "x" set ylabel "F(x)" set grid plot "F_data.dat" using 1:2 with lines title "F(x)" For having F_data.dat I used this python code : import numpy as np import scipy.integrate as spi def F(x): if x == 0 or x < 0: return np.nan # Eviter les valeurs négatives if x < 0.5 or x > 1: integral, _ = spi.quad(lambda t: 1 / np.log(t), x, 2*x) return integral else: return np.nan # Evite l'intervalle ]1/2,1[ x_vals = np.linspace(0.01, 3, 100) # Valeurs de x y_vals = [F(x) for x in x_vals] np.savetxt("F_data.dat", np.column_stack((x_vals, y_vals)), fmt="%.6f") print("Données enregistrées dans F_data.dat")
- Is there any way that pgfplots and tkz-euclide use the same coordinate system without misplacements?by miltos on March 5, 2025 at 7:16 am
I use pgfplots and tkz-euclide to make a graph as this shown below. When the scaling of the tikzpicture is 1 everything is on place as in image 1. When I change this (e.g scale=1.5) I have misplacements (the point C and the mark of right angle) as you can see in the second image. I tried to move the last two commands of tkz-euclide inside the pgfplots code but I get error (thinking anyway the packages are tikz-based). Is there any way to make these excellent packages to work together? My MWE is: \documentclass[12pt]{exam} \usepackage[a4paper, total={180mm,257mm},left=15mm,top=17mm]{geometry} \usepackage[LGR,T1]{fontenc} \usepackage[greek,english]{babel} \usepackage{tkz-euclide}\tkzSetUpPoint[size=3,color=black,fill=white] \usetikzlibrary{arrows,calc,shapes,patterns,decorations.pathmorphing,shadows.blur,shadings,angles,quotes} \usepackage[most]{tcolorbox} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{center} \textbf{BLA bLA} \textbf{Systems} \end{center} \begin{questions} \question This is first question $\varepsilon_1\;\varepsilon_2\ \text{and}\ \varepsilon_3$. \begin{minipage}[b][][t]{\textwidth} \begin{minipage}[b][11cm][t]{0.4\linewidth} \question Second question $\varepsilon_1,\;\varepsilon_2$ $\varepsilon_3$. \begin{parts} \part part1 $\varepsilon_1,\; \text{and}\ \varepsilon_2$ \fillwithdottedlines{4cm} \end{parts} \end{minipage} \hfill \begin{minipage}[b][11cm][t]{0.58\linewidth} \raisebox{2mm}{% \begin{tikzpicture}[scale=1.5,transform shape] \pgfplotsset{every axis/.append style={tick label style={font=\tiny},label style={font=\tiny}}} \begin{axis}[ axis lines=middle, xlabel = {\tiny $x$}, ylabel = {\tiny $y$}, xmin = -3.5, xmax = 5.5, ymin = -2.5, ymax = 5.5, xtick style={line width=0.5pt,black}, major tick length=1mm, ytick style={line width=0.5pt,black}, ytick = {-2,-1,0,1,...,5}, xtick = {-3,-2,...,5}, xticklabel shift=-3pt, yticklabel shift=-3pt, grid style={line width=0.15pt,gray!30}, grid = both, axis equal image, % <-- added inner axis line style={<->,>=Stealth}, after end axis/.code={% \path (axis cs:0,0) node [anchor=north west,yshift=1.6pt,xshift=-1.8pt] {\tiny $0$} node [anchor=south east,xshift=1.8pt,yshift=-1.6pt] {\tiny $0$ };} ] \addplot [domain=-6.5:6,samples=100] {2*x+3}; \addplot [domain=-6.5:8,samples=100] {-0.5*x+2}; \addplot [domain=-6.5:8,samples=100] {x-1}; \node[above] at (-2,3.4) {\tiny $\varepsilon_1:x+2y=4$}; \node[below] at (1.1,5) {\tiny $\varepsilon_3$};%\node[below right=-3pt and -3pt] at (0,4) {\tiny $A$}; \node[above] at (3,2) {\tiny $\varepsilon_2$}; \coordinate (A) at (axis cs: 2,1);\coordinate (B) at (axis cs: 0,3); \coordinate (C) at (axis cs: -0.4,2.2);\coordinate (D) at (-2,3); \tkzDrawPoint[](A) \tkzLabelPoint[](A){\tiny$A$} \end{axis} \tkzMarkRightAngle[size=0.15](D,C,B)\tkzDrawPoint[](C) \end{tikzpicture}} \end{minipage} \end{minipage} \end{questions} \end{document} Image 1: Image2:
- Future of the pgfplots packageby Dr. Manuel Kuehner on January 1, 2025 at 2:22 pm
I assume that the question might get closed because it does not fit the scope of this site. But I want to give it a try anyway, because I believe that many naïve users may look for such a question on this site :). Motivation: I really like the pgfplots package and used it a lot in the past and still use it today. I always use the package via a distribution like TeX Live or MiKTeX. Issue: Sadly, the pgfplots package on CTAN wasn't updated in some years, on CTAN the current version is 1.18.1 from 2021-05-17. On Github it is somehow different: Latest version is 1.17 from 2020-02-01. Question: Are there any plans for the future for pgfplots from the community, e. g. someting like for the pgf package, i. e. something like the "The PGF/TikZ Team"? Happy new year, by the way :).
- 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
- 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.
- Why does this MWE not compile (heatmap with contour lines)? [closed]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 ***********
- How can I remove the Labels of the blue dots on the left plot and change the position of label nr16 in the right plot?by dan1365 on March 30, 2023 at 9:46 am
\documentclass[11pt]{report} \usepackage{pgfplots, pgfplotstable} \pgfplotsset{width=10cm,compat=1.18} \usepackage{graphicx} \usepackage{caption} \usepackage{subcaption} \begin{document} \begin{figure} \centering \begin{subfigure}[tb]{0.48\linewidth} \begin{tikzpicture} \begin{axis}[height=7cm, width=\linewidth, xlabel={}, ylabel={}, ytick={0,500,...,1700}, xtick={0,500,...,1700}, ymin=-170, ymax=1700, xmin=-170, xmax=1700, ymajorgrids, xmajorgrids] \addplot[ scatter/classes={0={blue}, 1={red}}, scatter, mark=*, only marks, scatter src=explicit symbolic, nodes near coords*={\Label}, visualization depends on={value \thisrow{label} \as \Label} %<- added value ] table [meta=class] { x y class label 0.3788 8.1653 0 - 6.3716 4.0196 0 - 0.4225 0.1447 0 - 14.8118 6.6124 0 - 2.7433 2.544 0 - 152.0046 30.6336 1 5 1375 428.5714 1 6 20.51 5.1280 0 - 38.8548 1492.8425 1 8 0.1409 0.000196 0 - }; \end{axis} \end{tikzpicture} \caption{} \label{} \end{subfigure}\hfill \begin{subfigure}[tb]{0.48\linewidth} \begin{tikzpicture} \begin{axis}[height=7cm, width=\linewidth, xlabel={}, ylabel={}, ytick={0,2,...,10}, xtick={0,5,...,20}, ymin=-1.133, ymax=11.333, xmin=-2.266, xmax=22.666, ymajorgrids, xmajorgrids] \addplot[ scatter/classes={0={blue}, 1={red}}, scatter, mark=*, only marks, scatter src=explicit symbolic, nodes near coords*={\Label}, visualization depends on={value \thisrow{label} \as \Label} %<- added value ] table [meta=class] { x y class label 0.3788 8.1653 0 9 6.3716 4.0196 0 10 0.4225 0.1447 0 12 14.8118 6.6124 0 13 2.7433 2.544 0 14 20.51 5.1280 0 15 0.1409 0.000196 0 16 }; \end{axis} \end{tikzpicture} \caption{} \label{} \end{subfigure}\hfill \caption{} \end{figure} \end{document} > Blockquote
- Problem with PGFPots wrt labeling both axesby Puck on December 30, 2022 at 12:18 am
I have a problem with this code: \documentclass{article} \usepackage[margin=0.25in]{geometry} \usepackage{pgfplots} \pgfplotsset{width=10cm,compat=1.9} \begin{document} \begin{center} \begin{tikzpicture} \begin{axis}[ %xtick={0,1,...,10}, ytick={0,1*pi,...,3*pi}, domain=0:3*pi, %scaled y ticks={real:3.1415}, ytick scale label code/.code={$\cdot Q$},] \addplot[domain=0:1, samples=100, color=blue]({x},{2*pi}); \addplot[domain=1:10, samples=100, color=red]({x},{2*pi/x}); \end{axis} \end{tikzpicture} \end{center} \end{document} I'd like to have something like this: I'd like to cancel 3.14 and 6.28 values on y axis and substitute the 6.28-value with "$Q$", Moreover I'd like to cancel all values on x-axis and insert a "$R$" in correspondence with the end of blue line at the start of red function. I'd also like improve the space in the graph, I mean, the space between 3.14 and 6.28 is too wide. Is it possible? First Edit: I tried to edit my code so \documentclass{article} \usepackage[margin=0.25in]{geometry} \usepackage{pgfplots} \pgfplotsset{width=10cm,compat=1.9} \usepackage{mathtools} \begin{document} \begin{center} \begin{tikzpicture} \begin{axis}[ axis lines = center, xlabel = $r$, ylabel = $u$, xtick={5}, xticklabel={$R$}, ytick={0,2*pi}, domain=0:3, y domain=0:10, %scaled y ticks={real:3.1415}, %ytick scale label code/.code={$\cdot \pi$}, yticklabel={$\dfrac{Q}{R}$}] \addplot[domain=0:5, samples=100, color=blue]({x},{2*pi}); \addlegendentry{$\dfrac{Q}{R}$} \addplot[domain=0:10, samples=100, color=white]({x},{x}); \addlegendentry{} \addplot[domain=5:15, samples=100, color=red]({x},{10*pi/x}); \addlegendentry{$\dfrac{Q}{r}$} \addplot[domain=0:10, samples=100, color=white]({x},{x}); \addlegendentry{} \end{axis} \end{tikzpicture} \end{center} \end{document} Now, my final problem is how to shorten the vertical axis and extend the horizontal where possible. How could I do? Thx again
- Drawing a XY axis with categoriesby BuenoGrande on August 5, 2020 at 10:19 pm
Can anybody help me reproduce such a figure: I succesfully reproduced most of it. But I would need to help with one small detail: How can I put: "High, Medium and Low" in the middle of each square of the grid? (As you can see on my original drawing) Here is what I have done so far: \documentclass[border=2mm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.11} \begin{document} \begin{tikzpicture} \begin{axis}[grid=both,ymin=0,ymax=8,xmax=8,xmin=0,xtick={2,4,6},xticklabels={Low,Middle, High},ytick={2,4,6}, yticklabels={Low,Middle, High},xlabel= Classical counterpart,ylabel=Quantization] \end{axis} \end{tikzpicture} \end{document}