pgfplots
- 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 ...
- Plot two fuctions and the region between them: Axis labels at wrong positionby Dimitrios ANAGNOSTOU on April 30, 2025 at 4:08 pm
I cannot understand what I am doing wrong with the following plot: \documentclass{standalone} \usepackage{pgfplots} \usepackage{amsmath} \usepgfplotslibrary{fillbetween} \begin{document} \begin{tikzpicture}[ declare function={ f(\x) = ln(\x); g(\x) = (ln(\x))^2; }, scale=0.8, ] \begin{axis}[ axis lines=middle, xmin=0.1, xmax=5, % Plage x de 0.1 à 5 (éviter x=0 pour log(x)) ymin=-2, ymax=5, % Plage y pour bien voir les deux courbes xlabel={$x$}, ylabel={$y$}, % Etiquettes des axes xlabel style={right}, % Position de l'étiquette x à droite ylabel style={above}, % Position de l'étiquette y au-dessus xtick={0.5,1,2,3,4,5}, % Graduations sur l'axe des abscisses ytick={-2,-1,0,1,2,3,4,5}, % Graduations sur l'axe des ordonnées axis line style=->, ticklabel style={font=\footnotesize}, label style={font=\footnotesize}, legend style={font=\footnotesize}, % Style de légende ] % Plot de la fonction f(x) = ln(x) \addplot[ domain=0.1:5, samples=100, color=blue, thick,name path=f ] {f(x)}; \addlegendentry{$f(x) = \ln(x)$} % Plot de la fonction g(x) = (ln(x))^2 \addplot[ domain=0.1:5, samples=100, color=red, thick,name path=g ] {g(x)}; \addlegendentry{$g(x) = (\ln(x))^2$} \addplot[gray!80, opacity=0.4] fill between[of=f and g, soft clip={domain=1:2.71828}]; \end{axis} \end{tikzpicture} \end{document} Axis labels appears to not be positionned in the proper places. Also I got the following warning message: 'Package pgfplots Warning: running in backwards compatibility mode (unsuitable...' Any ideas? Thanks a lot!
- Filling above a functionby Patricio on April 27, 2025 at 12:21 pm
I want to fill both the area below and above a function in different shades of gray. I thought it would be easier to first fill a rectangle in the lighter gray, then draw the function on top of it and finally fill the region above with the darker gray. However, the last part doesn't seem to be working, as I get I believe the problem is that the lighter rectangle gets drawn on top of the darker area. I thought elements in the figure were stacked in the same order as the corresponding instructions, but somehow the darker fill gets to be the first layer and then the rectangle and lastly the function are printed. My code follows \documentclass[a4paper]{book} \usepackage{pgfplots} \pgfplotsset{compat = 1.17} \usepgfplotslibrary{fillbetween} \begin{document} \begin{figure} \centering \footnotesize \begin{tikzpicture} \begin{axis}[ ticks=none, axis x line=bottom, axis y line=left, axis on top, xmin=0,xmax=10, ymin=0,ymax=10] \fill[gray!25] (0,0) rectangle (10,10); \path[name path = x] { (1.6,10) -- (10,10) }; \addplot[ name path=c, black, samples=200, smooth, thick, domain=1.6:10] {16/x}; \addplot[gray!50] fill between [of = c and x]; \end{axis} \end{tikzpicture} \end{figure} \end{document}
- How do I plot graphs like these? [closed]by Grady_TheCoder_Js123 on April 27, 2025 at 1:46 am
I wish to know how to plot graphs like these. How can I choose which points to label, how to write the dotted lines there, positioning the axes, and the filled circles and unfilled circle used in the Heaviside step function. Also, how can I make the graph of the function dotted? Are these possible with the pgfplots package? \begin{tikzpicture}[domain=-2:2] \begin{axis}[ xmin=-2.2, xmax=2.2, ymin=-2.2, ymax=2.2, axis line style={thin}, axis lines=middle ] \addplot[thick,black]{0.232-1.728 \x-0.096 \x^2+0.576 \x^3}; \end{axis} \end{tikzpicture}
- Aligning TikZ plotsby Armaan Mohammed on April 26, 2025 at 3:05 pm
I don't have much experience with Latex, so I need some help here please. In my thesis, I have to show a lot of plots. But since the numbers on the Y axis of different plots differ, some have a negative sign, some don't, some have a decimal point, some are just a single digit and so on, the vertical lines of the boxes of plots aren't aligned. I want them to be aligned so they look more neat and tidy. Here is a small example: \begin{figure}[htbp] \centering \begin{tikzpicture} \begin{axis}[ xmin=0, xmax=15, xlabel={$\mathrm{Time\ [s]}$}, ymin=-0.5, ymax=3.5, ylabel={$\mathrm{V_{TAS}\;[kt]}$}, height=0.25\textwidth, width=\textwidth, grid=both, grid style={dotted, gray!60}, ] \addplot[black, thick] table {templates/thesis/LaTeX/Desktop Simulation/On Ground/VTAS.txt}; \end{axis} \end{tikzpicture} \caption{Falling on the ground test: True airspeed vs. time} \label{f_vtas1} \end{figure} \begin{figure}[htbp] \centering \begin{tikzpicture} \begin{axis}[ xmin=0, xmax=15, xlabel={$\mathrm{Time\ [s]}$}, ylabel={$h_{\mathrm{AGL}}\ [m]$}, ymin=2.4, ymax=3, height=0.25\textwidth, width=\textwidth, grid=both, grid style={dotted, gray!60} ] \addplot[black, thick] table {templates/thesis/LaTeX/Desktop Simulation/On Ground/h_AGL.txt}; \end{axis} \end{tikzpicture} \caption{Falling on the ground test: Height Above Ground Level of the Aircraft's \gls{COG} vs. time} \label{f_agl1} \end{figure} \begin{figure}[htbp] \centering \begin{tikzpicture} \begin{axis}[ xmin=0, xmax=15, xlabel={$\mathrm{Time\ [s]}$}, ylabel={$\mathrm{Standstill\ [-]}$}, ymin=-0.5, ymax=1.5, ytick={0,1}, height=0.25\textwidth, width=\textwidth, grid=both, grid style={dotted, gray!60} ] \addplot[black, thick] table {templates/thesis/LaTeX/Desktop Simulation/On Ground/ssflag.txt}; \end{axis} \end{tikzpicture} \caption{Falling on the ground test: Standstill flag vs. time} \label{f_ssflag1} \end{figure} \begin{figure}[htbp] \centering \begin{tikzpicture} \begin{axis}[ xmin=0, xmax=15, xlabel={$\mathrm{Time\ [s]}$}, ylabel={$s_B\ [m]$}, ymin=-0.6, ymax=0.2, height=0.25\textwidth, width=\textwidth, grid=both, grid style={dotted, gray!60}, legend style={at={(1,1)}, anchor=north east, legend columns=1} ] \addplot[black, thick] table {templates/thesis/LaTeX/Desktop Simulation/On Ground/NoseDefl.txt}; \addlegendentry{Nose Gear Deflection} \addplot[greenColour, thick, mark=o, mark size=2, mark repeat=100] table {templates/thesis/LaTeX/Desktop Simulation/On Ground/LeftDefl.txt}; \addlegendentry{Main Gear Deflection} \end{axis} \end{tikzpicture} \caption{Falling on the ground test: Gear deflections vs. time} \label{f_gear1} \end{figure} Here is the output: In reality, there are atleast 8-9 such plots one after another going across different pages, so it the plots should also float over the pages. Each plot should have its own caption and label too. The files can be found here: https://limewire.com/d/zJYZW#xBV3ouLX3i It would great if someone could help me figure this out.
- `restrict y to domain` behaviour and setting it automatically to `ymin:ymax`by Merger on April 26, 2025 at 3:00 pm
I have the following code to produce a plot with the use of custom Axis command: \documentclass[tikz, margin=3mm]{standalone} \usetikzlibrary{ arrows.meta, shapes.geometric, trees, shapes, positioning, backgrounds, intersections, patterns, decorations.markings, angles, quotes, 3d, calc, tikzmark } \usepackage{pgfplots} \usepgfplotslibrary{units} \usepgfplotslibrary{fillbetween} \usepackage[dvipsnames,table]{xcolor} \usepackage{polski} \pgfplotsset{compat=1.18} \NewDocumentCommand{\Axis}{ O{} +m }{% \begin{axis}[ xmin=-4.5, xmax=4.99, ymin=-3.5, ymax=4.99, xtick distance=1, ytick distance=1, tick label style={font=\tiny}, % domain= % xticklabels=\empty, % yticklabels=\empty, % extra y ticks={1}, % extra y tick labels={$1$}, % extra x ticks={1}, % extra x tick labels={$1$}, axis lines=middle, axis line style={-Stealth}, xlabel={$X$}, ylabel={$Y$}, xlabel style={at={(ticklabel* cs:1)}, anchor=north east, font=\footnotesize, shift={(2mm, 0mm)}}, ylabel style={at={(ticklabel* cs:1)}, anchor=north west, font=\footnotesize, shift={(0pt, 1pt)}}, grid=both, grid style={dotted, gray!50}, set layers, clip mode=individual, axis equal image=true, % scale only axis, % unit vector ratio=2,1, #1 ] #2 \end{axis} } \tikzset{background grid/.append style={step=.5cm, ultra thin, dashed, gray!50}, >=Stealth} \begin{document} \begin{tikzpicture}[ >=Stealth, remember picture, ] \Axis[ xmin=-5.5, xmax=3.99, ymin=-3.5, ymax=5.9, tick label style={font=\footnotesize}, domain=-5.5:3.99, restrict y to domain=-3.5:5.9 ]{ \addplot [name path = plot, samples=100, thick, color=Red] {3^x} node[pos=0.15, above, font=\footnotesize] {$f(x)=3^x$}; \addplot [name path = g, samples=100, thick, color=Cerulean] {3^x-2} node[pos=0.15, above, font=\footnotesize] {$g(x)=3^x-2$}; } \end{tikzpicture} \end{document} The output looks like this: so its almost fine despite the fact the red plot does not reach the top y axis. Now, I want to set both domain and restrict y to domain automatically to passed xmin, xmax, ymin and ymax. I tried like this: \documentclass[tikz, margin=3mm]{standalone} \usetikzlibrary{ arrows.meta, shapes.geometric, trees, shapes, positioning, backgrounds, intersections, patterns, decorations.markings, angles, quotes, 3d, calc, tikzmark } \usepackage{pgfplots} \usepgfplotslibrary{units} \usepgfplotslibrary{fillbetween} \usepackage[dvipsnames,table]{xcolor} \usepackage{polski} \pgfplotsset{compat=1.18} \NewDocumentCommand{\Axis}{ O{} +m }{% \pgfkeys{/pgfplots/domain/.initial=\pgfkeysvalueof{/pgfplots/xmin}:\pgfkeysvalueof{/pgfplots/xmax}} % Domyślna wartość \pgfkeys{/pgfplots/restrict y to domain/.initial=\pgfkeysvalueof{/pgfplots/ymin}:\pgfkeysvalueof{/pgfplots/ymax}} % Domyślna wartość \begin{axis}[ xmin=-4.5, xmax=4.99, ymin=-3.5, ymax=4.99, xtick distance=1, ytick distance=1, tick label style={font=\tiny}, % domain= % xticklabels=\empty, % yticklabels=\empty, % extra y ticks={1}, % extra y tick labels={$1$}, % extra x ticks={1}, % extra x tick labels={$1$}, axis lines=middle, axis line style={-Stealth}, xlabel={$X$}, ylabel={$Y$}, xlabel style={at={(ticklabel* cs:1)}, anchor=north east, font=\footnotesize, shift={(2mm, 0mm)}}, ylabel style={at={(ticklabel* cs:1)}, anchor=north west, font=\footnotesize, shift={(0pt, 1pt)}}, grid=both, grid style={dotted, gray!50}, set layers, clip mode=individual, axis equal image=true, % scale only axis, % unit vector ratio=2,1, #1 ] #2 \end{axis} } \tikzset{background grid/.append style={step=.5cm, ultra thin, dashed, gray!50}, >=Stealth} \begin{document} \begin{tikzpicture}[ >=Stealth, remember picture, ] \Axis[ xmin=-5.5, xmax=3.99, ymin=-3.5, ymax=5.9, tick label style={font=\footnotesize}, ]{ \addplot [name path = plot, samples=100, thick, color=Red] {3^x} node[pos=0.15, above, font=\footnotesize] {$f(x)=3^x$}; \addplot [name path = g, samples=100, thick, color=Cerulean] {3^x-2} node[pos=0.15, above, font=\footnotesize] {$g(x)=3^x-2$}; } \end{tikzpicture} \end{document} but someething is wrong because the labels disappeared completely so I guess the restrict y to domain does not work correctly which move the labels otuside the image. What should I change to both set y restriction autmatically and fix the problem of red plot not reaching the top of y axis? Note that in my Axis command I have defulat xmin etc values but I update them with #1 argument so these new values should be used for domain and y axis restriction setting
- Unexpected border in legend with bar interval plotsby B Legrand on April 24, 2025 at 3:44 pm
I'm encountering unexpected behavior when using xbar interval or ybar interval plot styles with pgfplots. When I use the option draw=none, I expect no border to appear around the bars, including in the legend. However, a border still appears in the legend (see the blue borders in the example below), even though it is suppressed in the plot itself. Looking for the definitions of the legend image code is not helping much... /pgfplots/xbar interval legend/.style={ /pgfplots/legend image code/.code={ \draw [##1,/tikz/.cd,yshift=-0.2em,bar interval width=0.7,bar interval shift=0.5] plot coordinates {(0cm,0.8em) (5pt,0.6em) (10pt,0.6em)}; }, }, I don't know if I am missusing xbar interval or if it is a bug in pgfplots. Interestingly, adding draw opacity=0 does prevent the borders from showing up in the legend. Possibly related to Unexpected borders on legends of stacked bars in pgfplots. Here is a MWE : \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ybar interval, legend entries={A legend}] \addplot+[fill=red!50!white, draw=none, % draw opacity=0, ] coordinates {(0,2) (0.1,1) (0.3,0.5) (0.35,4) (0.5,3) (0.6,2) (0.7,1.5) (1,1.5)}; \end{axis} \end{tikzpicture} \end{document}
- How to automatically adjust the x-axis spacing in a bar chart with pgfplots?by B Legrand on April 24, 2025 at 2:59 pm
I'm trying to define a reusable style in pgfplots to improve the spacing of the x-axis (or y-axis) in bar plots. By default, pgfplots adds a significant horizontal margin to the left and right of the bar chart (see orange arrows in the following image), which I would like to reduce. However, when I set enlarge x limits=false, the bars at the first and last x positions get cropped (see arrows in the following image). To fix this, I attempted to compute a custom value for enlarge x limits based on the number of bar series: enlarge x limits={abs={\numplotsofactualtype/2*\pgfplotbarwidth+(\numplotsofactualtype/2-0.5)*\pgfplotbarshift}} But it seems that \numplotsofactualtype is not defined yet when used inside the axis options, causing errors. Is there a way to delay this evaluation or otherwise work around this issue so I can create a clean, reusable style that automatically adjusts the spacing based on the number of bar series? Here is the expected rendering (I manually set the value of enlarge x limits) where the x-axis runs from the first to the last bar, no more and no less. : Here is a MWE: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{ /pgfplots/ybar axis/.style={% enlarge x limits={abs={\numplotsofactualtype/2*\pgfplotbarwidth+(\numplotsofactualtype/2-0.5)*\pgfplotbarshift}}, } } \begin{document} \begin{tikzpicture} \begin{axis}[width=15cm, ybar, bar width=4pt, bar shift auto=1pt, ymin=0, ybar axis] \addplot+[red] coordinates {(0,2.6) (1,2.5) (2,2.6) (3,2.7) (4,2.5) (5,2.7) (6,3.1) (7,3.3) (8,3.4) (9,3.8) (11,4.2) (12,4.8) (13,5) (14,5.7) (15,6.2) (16,6.8) (17,7.1) (18,7.6) (19,7.7) (20,7.2)}; \addplot+[blue] coordinates {(0,10.1) (1,9.8) (2,9.6) (3,8.8) (4,8.6) (5,8.8) (6,7.8) (7,6.9) (8,6) (9,5.3) (10,4.2) (11,3.6) (12,2.9) (13,3.1) (14,3.9) (15,4.7) (16,5.8) (17,7.2) (18,8.4) (19,9.3) (20,9.7)}; \addplot+[green] coordinates {(0,7.8) (1,8.8) (2,9.1) (3,8.0) (4,9.6) (5,9.8) (6,8.5) (7,6.7) (8,6.5) (9,5.9) (10,4.8) (11,4.6) (12,3.3) (13,3.0) (14,2.7) (15,2.7) (16,1.8) (17,1.2) (18,1.4) (19,1.3) (20,0.7)}; \end{axis} \end{tikzpicture} \end{document}
- Economic plots one below the otherby José on April 23, 2025 at 3:35 pm
How can I plot this two charts together, one below the other, to see better the relationship between total, average and marginal product?
- PGF plot mark half circle in two colorsby Kernier on April 23, 2025 at 1:29 pm
I have the following code to add a point to my plot: \addplot [only marks, mark=halfcircle*,mark options={rotate=-90, fill=Red},mark size=1pt, Green, on layer=axis foreground, % Rysuj na warstwie nad osiami ] coordinates {(-3,1)}; the output is: The left half of the circle is fine - the edge is green and fill is white. But how can I make the edge of right right od the circle red, to fit the red fill of that half? MWE \documentclass[tikz, margin=3mm]{standalone} \usepackage{tikz} \usetikzlibrary{shapes, backgrounds, arrows.meta, fit} \usepackage[dvipsnames]{xcolor} \usepackage{pgfplots} \usepgfplotslibrary{fillbetween} \pgfplotsset{compat=1.18} \begin{document} \tikzset{declare function={ f1(\x)=3; f2(\x)=\x<0 ? -\x-2 : (x<3 ? \x-2 : 1); } } \pgfdeclareplotmark{halfcircle+}{% \pgfpathcircle{\pgfpointorigin}{\pgfplotmarksize}% \pgfusepathqstroke \pgfpathmoveto{\pgfqpoint{\dimexpr\pgfplotmarksize+0.5\pgflinewidth}{0pt}} \pgfpatharcto{\dimexpr\pgfplotmarksize+0.5\pgflinewidth} {\dimexpr\pgfplotmarksize+0.5\pgflinewidth}{0}{0}{0} {\pgfqpoint{\dimexpr-\pgfplotmarksize-0.5\pgflinewidth}{0pt}} \pgfpathclose \pgfusepathqfill } \begin{tikzpicture}[ background grid/.style={thin, dotted, draw=gray,step=.5cm}, >=Stealth, remember picture, ] \begin{axis}[ xmin=-4.5, xmax=4.99, ymin=-3.5, ymax=4.99, xtick distance=1, ytick distance=1, grid=both, grid style={dotted, gray!50}, set layers, clip mode=individual, axis equal image=true ] \path[name path=xaxis] (axis cs:-6, 0) -- (axis cs:5, 0); \addplot[domain=-6:-3, color=Red, thick] {f1(x)}; \addplot[domain=-3:5, color=Red, thick] {f2(x)} node[pos=0.9, above, font=\footnotesize] {$f(x)$}; \addplot[domain=-6:-3, color=Green, thick] {f1(x)-2}; \addplot[domain=-3:5, color=Green, thick] {f2(x)-2} node[pos=0.9, below, font=\footnotesize] {$g(x)$}; \def\filledPoints{(-6, 1) (-3,-1) (5,-1)} \def\emptyPoints{(-3, 1)} \addplot [only marks, mark=*, mark size=1pt, color=Green, on layer=axis foreground, % Rysuj na warstwie nad osiami ] coordinates {\filledPoints}; \addplot [only marks, mark=*, mark size=1pt, color=Green, fill=white, on layer=axis foreground, % Rysuj na warstwie nad osiami ] coordinates {\emptyPoints}; \def\filledPoints{(-6, 3) (-3,1) (5,1)} \def\emptyPoints{(-3, 3)} \addplot [only marks, mark=*, mark size=1pt, color=Red, on layer=axis foreground, % Rysuj na warstwie nad osiami ] coordinates {\filledPoints}; \addplot [only marks, mark=*, mark size=1pt, color=Red, fill=white, on layer=axis foreground, % Rysuj na warstwie nad osiami ] coordinates {\emptyPoints}; \addplot[ only marks, mark=halfcircle+, mark options={rotate=-90, fill=Red}, mark size=1pt, Green, on layer=axis foreground, % Rysuj na warstwie nad osiami ] coordinates {(-3,1)}; \end{axis} \end{tikzpicture} \end{document}
- Fill Between Polar Graphs Intersected Segmentsby Nick B on March 13, 2025 at 6:11 pm
From a previous post of mine: Polar Graph Intersection I am trying (and failing to shade the crescent moon area of Path B on my Polar Curve. I have tried FillBetween, and combinations of L1--R2, etc with two and three segments. I have read the material and just can't seem to figure it out. If anyone can help, that would be appreciated. \documentclass[border=5mm]{article} \usepackage{tikz,asymptote,ragged2e} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \usetikzlibrary{arrows.meta} \usetikzlibrary{backgrounds} \pgfplotsset{compat=newest} \usetikzlibrary{calc} \usepgfplotslibrary{fillbetween} \pgfplotsset{ interpret as polar/.style={ x filter/.code=\pgfmathparse{cos(rawx)*rawy}, y filter/.code=\pgfmathparse{sin(rawx)*rawy} } } \begin{document} \begin{tikzpicture}[>=Triangle] \begin{axis}[ xtick distance=1, ytick distance=1, axis lines=center, axis equal image, enlargelimits=true, ] \addplot[name path=A, very thick, domain=0:180, samples=360, smooth, interpret as polar ] (x,{1-2*cos(x)}); \addplot[name path=B, very thick, domain=0:360, samples=360, smooth, interpret as polar ] (x,{1}); \path[name path=axis] (axis cs:0,0) -- (axis cs:1,0); \begin{scope}[on background layer] \fill[blue!30, opacity=0.5, intersection segments={ of=A and B, sequence={R2 -- L2} }] -- cycle; \end{scope} \node[anchor=center,label=north west:$O$] at (0,0){}; \end{axis} \end{tikzpicture} \end{Center} \end{document}
- Horizontal dot plot for frequencyby codingliketheresnoyesterday on February 12, 2025 at 10:35 pm
How can these tables be replicated? Here's what I have so far \documentclass{article} \usepackage{pgfplots} \usepackage{subcaption} \usepackage{tikz} \begin{document} \begin{figure} \centering % Handling \begin{subfigure}{0.3\textwidth} \centering \begin{tikzpicture} \begin{axis}[ width=5cm, height=5cm, title={Handling}, title style={at={(axis description cs:0.5,-0.1)}, anchor=north}, ytick={0,1,2,3,4,5,6}, yticklabels={Very Hard,1,2,3,4,5,Very Easy}, xticklabels={}, xtick=\empty, ymin=0, ymax=6, xmin=0, xmax=3, grid=major, % Add horizontal grid lines axis y line*=left, % Remove right vertical axis axis x line=bottom, % Ensure only the bottom horizontal axis is present axis line style= - ] % Blue dots (Operating Microscope) \addplot[only marks, mark=*, color=blue] coordinates {(1,4) (1.12,4) (0.88,4) (1,3)}; % Red dots (3D Camera) \addplot[only marks, mark=*, color=red] coordinates {(2,5) (2,4) (2,3)}; \end{axis} \end{tikzpicture} \end{subfigure} \end{figure} \end{document} Which results in this: I feel like there must be an easier way than to manipulate the x value.
- 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.
- 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.
- Bar chart values are overlapped, slice is very small to show these valuesby Muhammad Habib on November 1, 2022 at 5:36 am
\documentclass{article} \usepackage{pgfplotstable} \pgfplotsset{compat=newest} \usetikzlibrary{patterns} \begin{document} \caption{Existing Scenario: Mode Wise Percentage Share} \centering \begin{tikzpicture} \pgfplotsset{ width=8cm, height=6cm, enlarge x limits=0.25, % <--- xtick style = {draw=none}, % <--- x tick label style={yshift=-2.2em}, % <--- ytick={0,20,...,200}, ylabel=label, % coordinates xtick distance=1, symbolic x coords={KAR-MMK, MMK-MCK, MCK-TJB}, yticklabel=\pgfmathprintnumber{\tick}\,$\%$, ymin=0, ymax=200, ybar stacked, axis on top, % <--- % nodes nodes near coords, every node near coord/.append style={font=\footnotesize,rotate=90}, % <--- modified stacked ignores zero=false, nnc_ticklabels/.style={ % <-- new style point meta=explicit symbolic, every node near coord/.style={ font=\footnotesize, below, rotate=40, anchor=north east, % <- changed from east inner sep=1pt % <- added } } % <=== } %%%% diagram body \begin{axis}[ylabel=Percentage Share,bar width=8pt, bar shift=-15pt] \addplot [xshift=-15pt, nnc_ticklabels] coordinates % <-- added the new style for all the "ticklabel" plots {(KAR-MMK,0) [Road] (MMK-MCK,0) [Road] (MCK-TJB,0) [Road] }; \addplot [fill=none,mark=Black,postaction={pattern=north east lines}] coordinates {(KAR-MMK,69) (MMK-MCK,28) (MCK-TJB,28)}; \addplot [fill=none,mark=Black,postaction={pattern=dots}] coordinates {(KAR-MMK,98) (MMK-MCK,98) (MCK-TJB,43)}; \end{axis} \begin{axis}[ylabel=Percentage Share, bar width=8pt, bar shift=-5pt] \addplot [xshift=-5pt, nnc_ticklabels] coordinates {(KAR-MMK,0) [Railway] (MMK-MCK,0) [Railway] (MCK-TJB,0) [Railway] }; \addplot [fill=none,mark=Black,postaction={pattern=north east lines}] coordinates {(KAR-MMK,052) (MMK-MCK,28) (MCK-TJB,02)}; \addplot[fill=none,mark=Black,postaction={pattern=dots}] coordinates {(KAR-MMK,30) (MMK-MCK,2) (MCK-TJB,02)}; \end{axis} \begin{axis}[ylabel=Percentage Share, bar width=8pt, bar shift=5pt] \addplot [xshift=5pt, nnc_ticklabels] coordinates {(KAR-MMK,0) [Pipeline] (MMK-MCK,0) [Pipeline] (MCK-TJB,0) [Pipeline] }; \addplot [fill=none,mark=Black,postaction={pattern=north east lines}] coordinates {(KAR-MMK,42) (MMK-MCK,25) (MCK-TJB,33)}; \legend {,HSD,MS}, \addplot [fill=none,mark=Black,postaction={pattern=dots}] coordinates {(KAR-MMK,39) (MMK-MCK,48) (MCK-TJB,47)}; ] \end{axis} \end{tikzpicture} \end{document}
- 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
- Graph in pgfplots: global style for all node labelsby Alika97 on October 22, 2021 at 10:26 am
I have this graph rendering three functions: \documentclass[12pt,a4paper]{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ width=10cm, height=10cm, axis lines=center, xmin=-1, xmax=100, ymin=-1, ymax=1000, ] \addplot[ domain=0:25, ] {x^2} node[label={\(x^2\)}] {}; \addplot[ domain=0:9.8, ] {2^x} node[label={\(2^n\)}] {}; \addplot[ domain=0:90, ] {x} node[label={\(n\)}] {}; \end{axis} \end{tikzpicture} \end{document} I want to set the style of the node labels globally. Lets say that I want them with yellow background: I know I can do it locally, but if the style get complex the code becomes hard to read. \begin{tikzpicture} \begin{axis}[ width=10cm, height=10cm, axis lines=center, xmin=-1, xmax=100, ymin=-1, ymax=1000, label style={font=\small} ] \addplot[ domain=0:25, ] {x^2} node[label={[fill=yellow]:{\(x^2\)}}] {}; \addplot[ domain=0:9.8, ] {2^x} node[label={[fill=yellow]:{\(2^n\)}}] {}; \addplot[ domain=0:90, ] {x} node[label={[fill=yellow]:{\(n\)}}] {}; \end{axis} \end{tikzpicture} \end{document} How can I add the styles for the node labels only once in the header?
- Pgf - (hack?) jump markby JeT on October 22, 2021 at 9:52 am
Despite my readings (in the manual, or in the posts here), I did not find much on how to change the style of the jump mark, to have, for instance, an arrow. Edit : Is there a way to influence the behavior of jump mark ? The closest I found was this answer by Jake but with quivers I'd like to get something like MWE \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[samples=8] \addplot+[jump mark left,domain=-5:5] {x*x}; \end{axis} \end{tikzpicture} \end{document}