pgfplots
- PGFPlots / TikZ: Filtering data from a file when the x-axis contains string valuesby joseldsm on June 10, 2026 at 9:57 am
I am generating a plot in PGFPlots/TikZ where the x-axis contains string values and the y-axis contains numerical data. The data is imported from a CSV file, and everything works correctly so far. However, when I use skip coordinates between index, the filtering is applied to the y-values and not to the x-axis categories. In this case, I want to draw only the data with the string value B. Is there a way to correctly apply this filtering to both x-axis ? Thanks! Here is the MWE. Keep in mind that in my case the data are extract from csv file. \documentclass{article} \usepackage{pgfplots} \usepackage{pgfplotstable} \pgfplotsset{compat=1.18} \pgfplotstableread{ String Value A 0 A 6 A 4 B 9 B 5 B 1 B 3 B 7 C 4 C 7 C 9 C 3 }\data \begin{document} \begin{tikzpicture} \begin{axis}[ ybar, ymin=0, xtick=data, xticklabels from table={\data}{String}, nodes near coords ] \addplot table[ x expr=\coordindex, y={Value}, skip coords between index={0}{3}, skip coords between index={8}{100} ]{\data}; \end{axis} \end{tikzpicture} \end{document}
- How to make 3D axes pass above/below a surface in pgfplotsby UnknownW on May 25, 2026 at 11:54 pm
I am trying to draw a 3D graph that looks like the attached picture. However, I cannot make the axes behave in the same way. In the picture, some intervals of the axes appear on top of the surface, while on other intervals the surface appears above the axes. I would also like the axis labels to stay outside the arrow tips. What I have tried so far is shown below, together with the attached picture. I would like a solution that works for arbitrary functions, not only for this particular example. \documentclass[tikz,border=5pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ view={45}{20}, axis lines=center, %axis on top, axis line style={-latex}, xlabel={$x$}, ylabel={$y$}, zlabel={$z$}, ticks=none, xmin=-5, xmax=5, ymin=-5, ymax=5, zmin=-4, zmax=4, width=7cm, height=7cm, colormap/jet, declare function={ f(\x,\y)=10*\y/((\x^2 + 1)*(\y^2 + 2*\y + 4)); }, ] \addplot3[ surf, opacity=0.6, faceted color=black!80, samples=60, samples y=60, domain=-4:4, y domain=-4:4, line width=0.01pt, ] (({x},{y},{f(x,y)}); \end{axis} \end{tikzpicture} \end{document}
- Sequence of functions: easing packageby Sebastiano on May 23, 2026 at 8:20 pm
I was trying to understand how the easing package works and whether it can be useful for plotting a sequence of functions in order to study uniform convergence. I am not sure whether the package only allows plotting a set of predefined functions, or whether it also enables the representation of arbitrary sequences of functions. In particular, I would like to know whether there is a way to use this package (or other similar LaTeX packages) to effectively visualize any sequence of functions. If there is a more suitable tool, I would appreciate it if you could suggest it. Additionally I not understand the reason of a ugly graph for $n=1, 2$. Here an example: \documentclass{article} \usepackage{pgfplots} \usepgflibrary{easing} \pgfplotsset{compat=1.18} \begin{document} \begin{center} \begin{tikzpicture} \begin{axis}[ width=12cm, height=7cm, domain=0:1, axis equal image, samples=300, xmin=0, xmax=1, ymin=0, ymax=1.05, axis lines=left, xlabel={$x$}, ylabel={$x^n$}, legend pos=north west, thick ] \pgfkeys{/easing/pow/exponent=1} \addplot[blue] {poweasein(0,1,x)}; \addlegendentry{$n=1$} \pgfkeys{/easing/pow/exponent=2} \addplot[red] {poweasein(0,1,x)}; \addlegendentry{$n=2$} \pgfkeys{/easing/pow/exponent=4} \addplot[green!60!black] {poweasein(0,1,x)}; \addlegendentry{$n=4$} \pgfkeys{/easing/pow/exponent=8} \addplot[orange] {poweasein(0,1,x)}; \addlegendentry{$n=8$} \addplot[black, dotted] { (x==1 ? 1 : 0) }; \addlegendentry{$\lim f_n$} \end{axis} \end{tikzpicture} \end{center} \end{document}
- (Semi-)Globally set `table` options in `\addplot table`?by Denis Bitouzé on May 21, 2026 at 7:36 am
Suppose I need to plot data from many files using pgfplots, and these files are not properly formatted (8 header lines not prefixed with % or #, and commas instead of periods as decimal separators). This can be managed using the following code: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis} \addplot table [skip first n=8,/pgf/number format/read comma as period] {data1.dat}; \addplot table [skip first n=8,/pgf/number format/read comma as period] {data2.dat}; \end{axis} \end{tikzpicture} \end{document} But it is tedious to have to specify these table options each time \addplot table appears. I haven't found any way in the pgfplots documentation to declare these parameters in a (semi-)global manner. Have I missed something?
- Tangential curve labels with 1D force-based collision avoidance along paths in pgfplotsby cjorssen on May 17, 2026 at 8:44 pm
I am trying to implement a dynamic labeling system for multiple curves within a pgfplots axis environment. The goal is to have curve labels that are both tangential (sloped) to their respective paths and capable of avoiding collisions by utilizing a 1D force-based relaxation mechanism to repel each other along the curves' domains. My Understanding of pgfplots Internals From what I understand of pgfplots internals, and please correct me if my assumption is flawed, the package operates on a deferred drawing (or accumulation) model, conceptually quite similar to how matplotlib handles figures in Python. It seems to split its workflow into distinct steps: A Survey Phase where it reads \addplot data, accumulates coordinates in memory, and computes the global axis limits. A Visualization Phase triggered at \end{axis} where it maps data coordinates to physical dimensions and emits the actual TikZ paths and nodes. Based on this understanding, it feels like the ideal place to inject a label-relaxation algorithm would be right between these two phases (perhaps using hooks like before end axis), after the data is parsed but before the final typesetting occurs. The Technical Bottleneck: The Node Bounding Box Dilemma The core difficulty I am facing is a classic "chicken-and-egg" problem: To know the dimensions (width, height, depth) of a label's bounding box for collision detection, TeX must first typeset the text into a box. However, we cannot definitively position or rotate that node along the path until the force-based algorithm has computed the final, relaxed $t$ parameters for all curves. If a LuaLaTeX-based approach is required to handle the physics/loop, I am completely open to it. But I am unsure how to elegantly pass TeX box dimensions into Lua, or how to query the generated curve paths before the rendering phase. Minimal Working Example (Current State) Here is a basic MWE where the labels are sloped but completely overlap: \documentclass[border=5mm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ domain=0:3.5, restrict y to domain = 0:10, samples=100, axis lines=left ] % Curve 1 \addplot[blue, thick] {x^2} node[pos = 0.2, sloped] {Function $f(x)$}; % Curve 2 \addplot[red, thick] {1/x} node[pos = 0.8, sloped] {Function $g(x)$}; \end{axis} \end{tikzpicture} \end{document} Tentative Logic / Pseudo-code (Force-Based Relaxation) Ideally, the macro or Lua script would perform a spring-embedder / force-directed approach constrained to 1D path coordinates: # Pre-computation phase for each label L_i: Typeset L_i into a temporary TeX box to get its dimensions (W_i, H_i) # Force-directed loop while system_not_in_equilibrium and max_iterations_not_reached: Initialize forces F_i = 0 for all labels for each curve i with label L_i: 1. Get baseline position P_i = curve_i(t_i) 2. Compute tangent angle theta_i at t_i 3. Construct Label Bounding Box B_i (using W_i, H_i) at P_i rotated by theta_i for each pair of labels (L_i, L_j): if Intersect(B_i, B_j): # Compute repulsive force based on overlap magnitude force_magnitude = calculate_repulsive_force(B_i, B_j) # Project force along the 1D direction of the respective curves F_i = F_i - force_magnitude F_j = F_j + force_magnitude # Update positions using a small step size (damping) for each label L_i: t_i = t_i + alpha * F_i ConstraintToValidDomain(t_i) Questions & Directions Is my mental model of the pgfplots accumulation process accurate enough to build upon, or am I missing a fundamental constraint of the package architecture? Is there an existing package or experimental snippet that already handles force-based label placement or relaxation algorithms along TikZ paths? If doing this via LuaLaTeX, what is the cleanest way to intercept the path coordinates generated by pgfplots and pass the TeX box dimensions to a Lua-based physics loop? Any pointers, conceptual corrections, or architectural advice would be highly appreciated. Real-World Use Case (Thermodynamic Diagrams) To provide some concrete context on why this automation is so critical for my workflow, here is a screenshot of the type of complex diagram I am currently generating (with luatex, FFI and the CoolProp shared library). It is a pressure-enthalpy (p-h) diagram widely used in refrigeration and chemical engineering, plotted in the (p, log h) plane for a pure substance. As you can see, the visual density is extremely high because it overlays several distinct families of isolines crossing each other: Isotherms (constant temperature) Isentropes (constant entropy) Isochores (constant specific volume) Vapor quality lines / isotitres (constant dryness fraction) Manually hardcoding and fine-tuning the pos parameter for dozens of labels across these intersecting families of curves is completely unmanageable—especially since the curves shift dramatically depending on the thermodynamic properties of the fluid being modeled. Having a generalized, tangential, force-directed algorithm to let these labels dynamically find their equilibrium along their respective paths would be an absolute game-changer for rendering complex engineering charts natively in pgfplots.
- Tikz: perpendicular line to intersect the x-axisby Tldi You on May 14, 2026 at 10:11 am
I would like to draw a line starting from the point (200, 105.6), perpendicular to the failure envelope, and extending down to intersect the x-axis. I have implemented the following LaTeX/TikZ \documentclass[border=2pt]{standalone} \usepackage{pgfplots,siunitx} \pgfplotsset{compat=1.18} \usetikzlibrary{calc} \begin{document} \centering \begin{tikzpicture} \begin{axis}[ width=15cm, height=9.375cm, xmin=0, xmax=640, ymin=0, ymax=400, xtick={0,80,...,640}, ytick={0,80,...,400}, minor tick num=1, grid=both, grid style={black, thin}, minor grid style={black, thin}, xlabel={Contrainte normale ($\sigma_{nr}$), $kN/m^2$}, ylabel={Contrainte de cisaillement ($\tau_r$), $kN/m^2$}, axis line style={thick}, tick label style={font=\small}, label style={font=\small}, clip=false ] % Regression line: tau = 34 + sigma * tan(20) \addplot [domain=0:590, samples=2, thin, black] {34 + x*tan(20)}; % Data points on the line (open circles) \addplot [only marks, mark=o, mark size=3.5pt, fill=white, thin, black] coordinates { (100, 72.2) (200, 105.6) (300, 144.4) (400,177.7) }; % Solid dot and its label \node [circle, fill, inner sep=1.5pt] (dot) at (axis cs:320, 138) {}; \node [anchor=west, xshift=2pt] at (axis cs:320, 138) {\small (320, 138)}; % Perpendicular line from the 3rd circle (x=300) \coordinate (P) at (axis cs:200, {36 + 200*tan(20)}); \draw [very thick, black] (P) -- (axis cs:252.1, 0); % Right angle symbol \draw [very thick, black] ($(P) + ({-18*cos(20)}, {-18*sin(20)})$) -- ($(P) + ({-18*cos(20) + 18*sin(20)}, {-18*sin(20) - 18*cos(20)})$) -- ($(P) + ({18*sin(20)}, {-18*cos(20)})$); % Angle phi indicator \coordinate (phi_pt) at (axis cs:520, {34 + 520*tan(20)}); \draw [thin, black] (phi_pt) -- +(0.8cm, 0); \draw [thin, black] (phi_pt) +(0.5cm, 0) arc (0:20:0.5cm); % Box in top right \node [draw, thick, fill=white, align=center, inner sep=10pt] at (axis cs:520, 340) { $c = 34 \, kN/m^2$ \\ $\varphi = \ang{20}$ }; % Phi angle \coordinate (V) at (axis cs:520,223); \draw[thin] (V) -- ++(25pt,0); \draw[thin] ($(V)+(15pt,0)$) arc[start angle=0,end angle=20,radius=15pt]; \node[right] at ($(V)+(22pt,2pt)$) {$\varphi$}; \end{axis} \end{tikzpicture} \end{document} Do you have any suggestions or improvements? CURRENT RESULT:
- Troubles with negative numbers on bar graph [duplicate]by Ismael Joaquim on May 12, 2026 at 9:00 am
everyone. I'm having troubles with the negative labels in the first graph.Can someone help me with this? \documentclass{standalone} \usepackage{pgfplots} \usepackage{pgfplotstable} \usepackage{tikz} \usetikzlibrary{pgfplots.groupplots, calc} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{groupplot}[ group style={ group size=2 by 1, horizontal sep=1.2cm }, ybar, width=7.2cm, height=6.2cm, ymode=log, log origin=infty, title style={font=\normal\bfseries}, symbolic x coords={NaCl (B1),TiC (B1),FeSi (B20)}, xtick=data, tick label style={font=\small}, x tick label style={font=\small}, visualization depends on={y \as \originalvalue}, nodes near coords={% \pgfmathprintnumber[fixed,precision=3]{\originalvalue}% }, nodes near coords style={ font=\small, rotate=90, anchor=west }, enlarge x limits=0.20, grid=major, major grid style={dashed, gray!35}, ] % ====================================================== % (a) Regime \pm 10% V0 — DADOS REAIS DOS FICHEIROS % ====================================================== \nextgroupplot[ bar width=6pt, title={(a) Regime $\pm 10\%\,V_0$}, ylabel={RMSE (meV/célula)}, ymin=1e-2, ymax=1e1, legend to name=gruppolegend, legend style={ legend columns=6, draw=black, fill=white, font=\small, column sep=6pt, }, ] % Murnaghan — NaCl: 0.061718, TiC: 0.216179, FeSi: 0.256858 \addplot+[fill=blue!75, draw=blue!75!black] coordinates { (NaCl (B1),0.061718) (TiC (B1),0.216179) (FeSi (B20),0.256858) }; \addlegendentry{Murnaghan} % BM3 — NaCl: 0.027460, TiC: 0.057278, FeSi: 0.072263 \addplot+[fill=red!80, draw=red!80!black] coordinates { (NaCl (B1),0.027460) (TiC (B1),0.057278) (FeSi (B20),0.072263) }; \addlegendentry{BM3} % Vinet — NaCl: 0.037637, TiC: 0.105771, FeSi: 0.125342 \addplot+[fill=purple!75, draw=purple!75!black] coordinates { (NaCl (B1),0.037637) (TiC (B1),0.105771) (FeSi (B20),0.125342) }; \addlegendentry{Vinet} % q-EoS (n=2) — NaCl: 0.027461, TiC: 0.057532, FeSi: 0.072068 \addplot+[fill=green!70!black, draw=green!50!black] coordinates { (NaCl (B1),0.027461) (TiC (B1),0.057532) (FeSi (B20),0.072068) }; \addlegendentry{q-EoS $(n=2)$} % q-EoS (n=3) — NaCl: 0.027537, TiC: 0.058481, FeSi: 0.073480 \addplot+[fill=orange!90, draw=orange!70!black] coordinates { (NaCl (B1),0.027537) (TiC (B1),0.058481) (FeSi (B20),0.073480) }; \addlegendentry{q-EoS $(n=3)$} % ====================================================== % (b) Regime \pm 50% V0 — DADOS REAIS DOS FICHEIROS % ====================================================== \nextgroupplot[ bar width=6pt, title={(b) Regime $\pm 50\%\,V_0$}, ymin=1e0, ymax=1e4, ] % Murnaghan — NaCl: 38.483922, TiC: 179.827163, FeSi: 209.918058 \addplot+[fill=blue!75, draw=blue!75!black] coordinates { (NaCl (B1),38.483922) (TiC (B1),179.827163) (FeSi (B20),209.918058) }; % BM3 — NaCl: 2.118186, TiC: 44.043547, FeSi: 63.469045 \addplot+[fill=red!80, draw=red!80!black] coordinates { (NaCl (B1),2.118186) (TiC (B1),44.043547) (FeSi (B20),63.469045) }; % Vinet — NaCl: 23.998934, TiC: 27.367181, FeSi: 38.077585 \addplot+[fill=purple!75, draw=purple!75!black] coordinates { (NaCl (B1),23.998934) (TiC (B1),27.367181) (FeSi (B20),38.077585) }; % q-EoS (n=2) — NaCl: 1.962260, TiC: 54.617663, FeSi: 61.961751 \addplot+[fill=green!70!black, draw=green!50!black] coordinates { (NaCl (B1),1.962260) (TiC (B1),54.617663) (FeSi (B20),61.961751) }; % q-EoS (n=3) — NaCl: 3.740124, TiC: 59.084828, FeSi: 68.649034 \addplot+[fill=orange!90, draw=orange!70!black] coordinates { (NaCl (B1),3.740124) (TiC (B1),59.084828) (FeSi (B20),68.649034) }; \end{groupplot} % Legenda centralizada acima dos dois painéis \node at ($(group c1r1.south east)!0.5!(group c2r1.south west)+(0,-1.1cm)$) {\pgfplotslegendfromname{gruppolegend}}; \end{tikzpicture} \end{document}
- Adding a steep plane as an `addplot3` in tikzpicture rescales the $z$ axisby Sam on May 5, 2026 at 1:43 pm
In attempting to draw three planes using tikzpicture and addplot3s, I'm encountering the following issue: when adding the a third steep plane, the z axis is rescaled, visually changing the angle between the existing planes. How can I keep the steep plane without causing the z axis to be rescaled? Here is a working code and corresponding picture of three planes, none of which is too steep: \documentclass[border=5pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} % \begin{center} \begin{tikzpicture} \begin{axis}[ width=7cm, height=5.8cm, view={55}{28}, axis lines=center, axis on top=true, axis line style={dashed, gray, thick}, xlabel={$x$}, ylabel={$y$}, zlabel={$z$}, domain=-2:2, y domain=-2:2, samples=28, samples y=28, xtick=\empty, ytick=\empty, ztick=\empty, colormap={blueplane}{ rgb255=(40,90,160) rgb255=(90,140,210) rgb255=(160,200,240) }, colormap={yellowplane}{ rgb255=(230,210,70) rgb255=(245,230,100) rgb255=(255,245,160) }, colormap={greenplane}{ rgb255=(60,130,90) rgb255=(110,180,130) rgb255=(180,230,190) }, point meta min=0, point meta max=1, ] \addplot3[ surf, shader=interp, opacity=1, colormap name=yellowplane, point meta={0.5 + 0.3*z} ] {0.00*x}; \addplot3[ surf, shader=interp, opacity=1, colormap name=blueplane, point meta={0.5 + 0.3*z} ] {-0.3*x}; \addplot3[ surf, shader=interp, opacity=0.8, colormap name=greenplane, point meta={0.5 + 0.1*y} ] {0.10*y}; \end{axis} \end{tikzpicture} %\end{center} \end{document} [![enter image description here][1]][1] Here is a problematic code and corresponding picture, where I have only changed the green plane from {0.10*y} to {0.90*y}, making it rather steep and causing the z axis to be rescaled: \documentclass[border=5pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} %\begin{center} \begin{tikzpicture} \begin{axis}[ width=7cm, height=5.8cm, view={55}{28}, axis lines=center, axis on top=true, axis line style={dashed, gray, thick}, xlabel={$x$}, ylabel={$y$}, zlabel={$z$}, domain=-2:2, y domain=-2:2, samples=28, samples y=28, xtick=\empty, ytick=\empty, ztick=\empty, colormap={blueplane}{ rgb255=(40,90,160) rgb255=(90,140,210) rgb255=(160,200,240) }, colormap={yellowplane}{ rgb255=(230,210,70) rgb255=(245,230,100) rgb255=(255,245,160) }, colormap={greenplane}{ rgb255=(60,130,90) rgb255=(110,180,130) rgb255=(180,230,190) }, point meta min=0, point meta max=1, ] % x < 0: blue is above yellow % Draw yellow first, then blue \addplot3[ surf, shader=interp, opacity=1, colormap name=yellowplane, domain=-2:0, y domain=-2:2, point meta={0.5 + 0.3*z} ] {0.00*x}; \addplot3[ surf, shader=interp, opacity=1, colormap name=blueplane, domain=-2:0, y domain=-2:2, point meta={0.5 + 0.3*z} ] {-0.3*x}; % x > 0: yellow is above blue % Draw blue first, then yellow \addplot3[ surf, shader=interp, opacity=1, colormap name=blueplane, domain=0:2, y domain=-2:2, point meta={0.5 + 0.3*z} ] {-0.3*x}; \addplot3[ surf, shader=interp, opacity=1, colormap name=yellowplane, domain=0:2, y domain=-2:2, point meta={0.5 + 0.3*z} ] {0.00*x}; % Green plane: y = 0 \addplot3[ surf, shader=interp, opacity=0.8, colormap name=greenplane, domain=-2:2, y domain=-2:2, samples=22, samples y=22, point meta={0.5 + 0.1*y} ] {0.90*y}; \end{axis} \end{tikzpicture} % \end{center} \end{document} [![enter image description here][2]][2] [1]: https://i.sstatic.net/3yfLU2lD.png [2]: https://i.sstatic.net/bVjYARUr.png
- is there an easier way to draw a dotplotby Arne Timperman on May 2, 2026 at 7:23 am
I want to draw this dotplot: The only way I could think of is: \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \usepackage{statistics} \usetikzlibrary{patterns} \begin{document} \begin{tikzpicture} \begin{axis}[ width=12cm, height=5cm, ymin=0, ymax=20, xmin=0, xmax=1.3, axis y line=left, axis x line=bottom, ytick=\empty, xlabel={$x$}, tick style={draw=none} ] % Dotplot (voorbeelddata) \addplot[ only marks, mark=*, mark size=2.5pt, green!70!black ] coordinates { % linkerzijde (0.35,1) (0.40,1) (0.45,1) (0.40,2) (0.45,2) (0.50,2) (0.45,3) (0.50,3) (0.55,3) (0.50,4) (0.55,4) (0.60,4) % midden (hoogste stapel) (0.60,1) (0.65,1) (0.70,1) (0.75,1) (0.60,2) (0.65,2) (0.70,2) (0.75,2) (0.60,3) (0.65,3) (0.70,3) (0.75,3) (0.65,4) (0.70,4) (0.65,5) (0.70,5) (0.65,6) (0.65,7) % rechterzijde (0.80,1) (0.85,1) (0.80,2) (0.85,2) (0.85,3) }; \end{axis} \end{tikzpicture} \end{document} Resulting in this not very satisfying result: Any suggestions?
- Use "plot" inside a \draw path in tikzby flawr on April 30, 2026 at 5:36 pm
Is there a way to continue a path we draw using \draw with a plot, just as we do for instance also with arc or similar commands? In the example below I have a straight line, but I'd like the plot to append directly to that line, as indicated by the red dots. I can of course do that e.g. with plot[shift={(1,1)},...], but that means that I have to repeat that second coordinate in the path, which makes it again more cumbersome to use if we want to change something later (and the second straight line segment then points to the original endpoint without the shift). So this is more a question about "ergonomically" using this plot command inside other paths. E.g., I also like using the ++ syntax to precisely extend a path a certain distance horizontally, without having to repeat the previous y-coordinate, and I was wondering whether there is something similar we can do with the plot command inside such a path. \documentclass{standalone} \usepackage{tikz} \usepackage{xcolor} \usepackage{pgfplots} \pgfplotsset{compat=1.17} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture}[domain=0:4] \draw[black!10!white, dashed] (0, 0) grid (4, 2); \draw (0, 1) -- (1, 1) node[left] {} plot[domain=0:1, samples=100] function{sin(6.3*x)} node[right] {} -- ++(1, 0); \end{tikzpicture} \end{document}
- Table header text dropped when including pgfplotstable inside tikzpicture graphby Kevin Zembower on April 26, 2026 at 4:52 pm
I notice a strange phenomenon when trying to create a data table side-by-side with its graph. The header text of the table next to the graph disappears, while a stand-alone table is fine. Here's my MWE: \documentclass[]{article} \usepackage{pgfplots} \pgfplotsset{ scale only axis, compat=1.18, } \usepackage{pgfplotstable} %To read data files once \pgfplotstableset{ %Setting for data table appearance every head row/.style={before row=\hline,after row=\hline}, every last row/.style={after row=\hline} } \begin{document} \pgfplotstableread{ x y 1 2 2 4 3 6 4 8 }\datatable Table standing alone: \pgfplotstabletypeset{\datatable} Table and graph side by side (pfgtabletypeset inside tikzpicture): \begin{figure}[h] \begin{tikzpicture} \begin{axis} \addplot table {\datatable}; \end{axis} \hskip 10cm \pgfplotstabletypeset{\datatable} \end{tikzpicture} \caption{Graph and datatable side-by=side} \end{figure} \end{document} Here's what I see: My two questions are: How to restore the table header text? How to position the table vertically so it's centered on the graph? Thanks so much for your suggestions and advice. -Kevin
- How do I align a pgfplots figure environment to the right side of my document?by tistieom on April 12, 2026 at 2:46 pm
I'm using a two-column extarticle document, without multicol. How do I make these two plots in a {figure} environment right-aligned instead of left-aligned in the column? They are a part of a nested list in my actual document so I did the same in the code here; other than the lorem ipsum, those are the same figures I'm using in my actual document. My goal with making them right-aligned is to align the left-hand side of the plots with the text following them. \documentclass[twocolumn]{extarticle} \usepackage{pgfplots, lipsum} \usepackage[margin=1cm]{geometry} \pgfplotsset{compat=1.18} \begin{document} \lipsum[1-5] \begin{enumerate} \item \begin{enumerate} \item \lipsum[1] \begin{figure} \label{fig:3sinx+2-x} \begin{tikzpicture} \begin{axis}[ xlabel=$x$, ylabel=$f(x)$, xmin=-0.5, xmax=2*pi+0.5, ymin=-6.25, ymax=6.25, xtick={0, pi/4, pi/2, 3*pi/4, pi, 5*pi/4, 3*pi/2, 7*pi/4, 2*pi}, xticklabels={$0$, , $\frac{\pi}{2}$, , $\pi$, , $\frac{3\pi}{2}$, , $2\pi$}, ytick={-6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6}, yticklabels={$-6$, , $-4$, , $-2$, , $0$, , $2$, , $4$, , $6$}, axis lines=middle, width=5.5cm, title={$f(x) = 3\sin(x)+2-x$} ] \addplot[ color=red, domain=0:2*pi, smooth ]{3*sin(deg(x)) + 2 - x}; \end{axis} \end{tikzpicture} \label{fig:3sinx+x-3} \begin{tikzpicture} \begin{axis}[ xlabel=$x$, ylabel=$f(x)$, xmin=-0.5, xmax=2*pi+0.5, ymin=-4.25, ymax=4.25, xtick={0, pi/4, pi/2, 3*pi/4, pi, 5*pi/4, 3*pi/2, 7*pi/4, 2*pi}, xticklabels={$0$, , $\frac{\pi}{2}$, , $\pi$, , $\frac{3\pi}{2}$, , $2\pi$}, ytick={-4, -3, -2, -1, 0, 1, 2, 3, 4}, yticklabels={$-4$, $-3$, $-2$, $-1$, $0$, $1$, $2$, $3$, $4$}, axis lines=middle, width=5.5cm, title={$f(x) = 3\sin(x)+x-3$} ] \addplot[ color=red, domain=0:2*pi, smooth ]{3*sin(deg(x)) + x - 3}; \end{axis} \end{tikzpicture} \end{figure} \item \lipsum[1-2] \end{enumerate} \end{enumerate} \end{document}
- Graphing a system of inequalities in 3 dimensionsby Henry Timmons on April 11, 2026 at 2:14 pm
I am trying to graph a system of 3 inequalities in 3 dimensions. These ineuqalities are: y-z>=1/2x, x-z>=0, and x+y>=3z. Currently I am struggling to get even a basic output. My input is: \documentclass[12pt, a4paper]{article} \usepackage{float, ulem, amsmath, amsthm, amssymb, pgfplots, tikz} \pgfplotsset{width=10cm,compat=1.9} \usepgfplotslibrary{external, fillbetween} \tikzexternalize \begin{document} \begin{tikzpicture} \begin{axis}[domain=0:10,y domain=0:10] \addplot3[surf] {y-(\frac{1}{2}*x)}; \addplot3[surf] {x}; \addplot3[surf] {\frac{x+y}{3}}; \end{axis} \end{tikzpicture} \end{document} I am getting the error: ! Package tikz Error: Sorry, the system call 'pdflatex -halt-on-error -interact ion=batchmode -jobname "mwe-figure0" "\def\tikzexternalrealjob{mwe}\input{mwe}" ' did NOT result in a usable output file 'mwe-figure0' (expected one of .pdf:.j pg:.jpeg:.png:). Please verify that you have enabled system calls. For pdflatex , this is 'pdflatex -shell-escape'. Sometimes it is also named 'write 18' or so mething like that. Or maybe the command simply failed? Error messages can be fo und in 'mwe-figure0.log'. If you continue now, I'll try to typeset the picture. See the tikz package documentation for explanation. Type H <return> for immediate help. ... l.19 \end{tikzpicture} ?
- How to plot y = x^{2/3} + 0.8 cos(kx) √(3-x²) in LaTeX TikZby hola on April 7, 2026 at 1:45 pm
I would like to plot the following function in LaTeX using TikZ or pgfplots: \[ y = x^{2/3} + 0.8 \cdot \cos(kx) \cdot \sqrt{3 - x^2} \] The domain is \( - \sqrt{3} \leq x \leq \sqrt{3} \). I need to create a nice graph where: The curve looks smooth I can easily change the value of \( k \) (number of oscillations) The modulated amplitude (the \( \sqrt{3-x^2} \) part) is clearly visible I have tried basic \addplot but I have problems with the fractional power \( x^{2/3} \) and with making the cosine oscillation look good. MWE (Minimal Working Example): \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis} \addplot {x^(2/3)}; % this part works, but adding the rest is difficult \end{axis} \end{tikzpicture} \end{document} pgfplots tikz-pgf plot functions graphics
- plot the implicit function using Luaby 青山漫步 on April 14, 2025 at 8:23 am
I want to use the built-in Lua language in LuaLaTeX to plot the implicit function x*y^2+2*x^3*y^3-y-1=0. My idea is to plot the points within the rectangular region [−5,5]×[−5,5] that satisfy the above equation. Here is my code, but I didn't get any output. Can you tell me where I went wrong? % !TEX program = Lualatex % !Mode:: "TeX:UTF-8" \DocumentMetadata{} \documentclass[12pt]{article} \usepackage{luacode} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{luacode} function mefun (x,y) return x*y^2+2*x^3*y^3-y-1 end function Imfun(n) --[-5,5]*[-5,5] for i=0, n do ti=-5.0+10.0*i/n for j=0, n do tj=-5.0+10.0*j/n temp=mefun(ti,tj) if (math.abs(temp))<1e-3 then tex.print(string.format('(%2.5f, %2.5f)', ti, tj)," \\par") else break end end end end \end{luacode} \begin{document} \begin{tikzpicture} \begin{axis}[xlabel=$x$, ylabel=$y$] %\addplot coordinates{ \addplot[cyan,smooth,line width=1.0pt] coordinates{ \luadirect{ Imfun(100) } }; \end{axis} \end{tikzpicture} \end{document}
- Fill area between hyperbola and line with pgfplotsby Magnivul on March 29, 2025 at 7:25 pm
This is my first time using TikZ and pgfplots, and I've been trying, to no avail, to color the area enclosed by the graphs of the functions x^2 - y^2 = 9 and y = 4x - 16. My problem is that fillbetween either fills area that isn't enclosed, or doesn't fill area that is enclosed, depending on the domain I try to clip it to. Currently what I've got looks like this: And I want the area at the bottom that is not enclosed by the graphs not to be colored. Any help would be much appreciated. Here is the TeX code: \documentclass{standalone} \usepackage[svgnames]{xcolor} \usepackage{tikz,pgfplots,tkz-euclide,tkz-graph} \pgfplotsset{compat=1.18} \usetikzlibrary{calc,shapes,angles,patterns,shadows,arrows.meta} \usepgfplotslibrary{statistics,fillbetween} \pgfplotsset{ standard/.style={ axis line style = thick, trig format=rad, axis x line=middle, axis y line=middle, xlabel = {\( x \)}, ylabel = {\( y \)}, every axis x label/.style={at={(current axis.right of origin)},anchor=west}, every axis y label/.style={at={(current axis.above origin)},anchor=south} } } \begin{document} \begin{tikzpicture} \begin{axis}[standard, scale only axis, ticklabel style = {font = \tiny}, grid = both, grid style = {dashed, gray!50}, xmin = -1, xmax = 7, ymin = -3, ymax = 5, xtick = {0,...,6}, ytick = {-2,-1,..., 4}, domain = 3:7, samples = 1000] \addplot[name path = f, line width = 0.5mm, Teal]{4*x - 16}; \addplot[name path = g1, line width = 0.5mm, MediumPurple]{sqrt(x^2 - 9)}; \addplot[name path = g2, line width = 0.5mm, MediumPurple]{-sqrt(x^2 - 9)}; \node[Teal] at (5.8, 1.5) {\( y = 4x - 16 \)}; \node[MediumPurple] at (2.2, 2.5) {\( x^2 - y^2 = 9 \)}; \addplot[SteelBlue!50, opacity = 0.8] fill between [of = f and g1, soft clip = {domain = 3:5}]; \end{axis} \end{tikzpicture} \end{document}
- Clip in tikz-3dplotby Angelo Aliano Filho on March 9, 2025 at 9:34 pm
I have the code below working perfectly: \documentclass[tikz,border=0mm]{standalone} \usepackage{tikz-3dplot} \definecolor{vinho}{rgb}{0.0, 0.26, 0.15} \usepackage{xfp} \newcommand{\ar}[1]{\fpeval{round(#1,2)}} \usetikzlibrary{positioning} \begin{document} \tdplotsetmaincoords{75}{120} \foreach \ang in {45}{ \begin{tikzpicture}[tdplot_main_coords,font=\small] \draw[-latex] (0,0,0) -- (4,0,0) node[below left]{$x$}; \draw[-latex] (0,0,0) -- (0,4,0) node[right]{$y$}; \draw[-latex] (0,0,0) -- (0,0,4) node[above]{$z$}; \draw[dashed] (0,0,0) -- (-4,0,0) (0,0,0) -- (0,-4,0) (0,0,0) -- (0,0,-2.5); \draw[fill,gray,opacity=0.1] (-4,-4,0) -- (-4,4,0) -- (4,4,0) -- (4,-4,0) -- cycle; \foreach \Rmax in {0,0.025,...,0.95,1}{ \draw[opacity=0.15,samples=50,smooth,domain=0:360,vinho,line width=0.7pt] plot({2*sqrt(2)*\Rmax*cos(\x)},{sqrt(2)*\Rmax*sin(\x)},{2-2*\Rmax^2}); } \foreach \Tmax in {0,5,...,360}{ \draw[opacity=0.15,samples=50,smooth,domain=0:1,vinho,line width=0.7pt] plot({2*sqrt(2)*\x*cos(\Tmax)},{sqrt(2)*\x*sin(\Tmax)},{2-2*\x^2}); } % \coordinate (P0) at (1,1,0.75); \coordinate (P1) at ({3*cos(\ang)},{3*sin(\ang)},-0.5); \coordinate (P2) at ({-3*cos(\ang)},{-3*sin(\ang)},-0.5); \coordinate (P3) at ({-3*cos(\ang)},{-3*sin(\ang)},1.5); \coordinate (P4) at ({3*cos(\ang)},{3*sin(\ang)},1.5); \draw[vinho,fill,fill opacity=0.05] (P1) -- (P2) -- (P3) -- (P4) -- cycle; % \draw[-latex,blue,thick] (0,0,0) -- ({1.5*cos(\ang)},{1.5*sin(\ang)},{0}) node[below right] {$\mathbf{u}$}; \draw[-latex,red] (P0) -- +({cos(\ang)},{sin(\ang)},{-0.5*cos(\ang)-2*sin(\ang)}) node[right=-2pt] {$\frac{\partial f}{\partial \mathbf{u}}$}; %Cut the parabola with zmin here..... \draw[black,smooth,domain=-2:2,samples=100,thick] plot({\x},{(-sin(\ang)+cos(\ang)+sin(\ang)*(\x))/cos(\ang)},{2-0.25*(\x)^2 -((-sin(\ang)+cos(\ang)+sin(\ang)*(\x))/cos(\ang))^2}); % \fill (P0) node[above] {\scalebox{0.8}{$P_0$}} circle (2pt); \node[name=funcao,anchor=west] at (1,5,3) {$f(x,y) = 2-\frac{x^2}{4} - y^2$}; \node[name=P,below=1cm of funcao.west,anchor=west] {$P_0=(1,1)$ e $\mathbf{u} = (\cos \ar{\ang}º,\sin \ar{\ang}º)$}; \node[,below=1cm of P.west,anchor=west] {$\frac{\partial f}{\partial \mathbf{u}} (P_0) = \ar{-0.5*cos(\ang*pi/180)-2*sin(\ang*pi/180)}$}; \end{tikzpicture} } \end{document} Whose output is the following: However, I would like to cut the image with a given zmin (for example, cut from zmin=-1). How can I do this with tikz-3dplot. I have tried with clip command but I don't get the desired result.
- Adding a diagram to a chartby Nicolas on December 28, 2024 at 12:12 am
I would like to be able to have this type of graph: \documentclass{standalone} \usepackage[dvipsnames,svgnames]{xcolor} \usepackage{lmodern} %\mathcode`\.="013B%virgule décimale en mode math %\usepackage{tikz}% chargé automatiquement par pgfplots \usepackage{pgfplots}\pgfplotsset{compat=newest} \pgfplotsset{/pgf/number format/.cd,1000 sep={~},use comma} \pgfplotsset{compat=newest} % Permet l'affichage de deux axes y \usetikzlibrary{tikzmark} \usepackage[all]{chemmacros} \usepackage{siunitx} \begin{document} \begin{tikzpicture} \begin{axis}[% mise en forme du graphique : xmin=-10,xmax=400, ymin=-2,ymax=50.1, % <<< samples = 100, no markers, axis x line=bottom,axis y line = left, ylabel={$E_p (\unit{\kJ\per\mol})$}, xlabel={$\theta (\unit{\degree})$}, xtick={0,60,120,180,240,300,360}, ytick=\empty, ] \addplot[mark=none, draw=blue] expression[domain=0:360,samples=100]{5*cos(3*x)+25}; \end{axis} \end{tikzpicture}% \newman(0){} \newman(62){} \newman(120){} \newman(180){} \newman(240){} \newman(300){} \end{document}
- pgfplots speed up compilation (filtered rows)by Mathieu on December 4, 2024 at 2:36 pm
I have a csv file with approx 2000 rows and filter 100 rows of the data. However, the compilation time is already approx five seconds. When we filter rows (see below) are there some pertinent settings to speed up the compilation? I already use standalone tikz to only have to compile once, still, I feel there is room for improvement. \documentclass[tikz]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \usepackage{pgfplotstable} \usepackage{xstring} \begin{document} \begin{tikzpicture} %Load csv file \pgfplotstableread[col sep=comma, header=true]{data.csv}\data % Plot the rows where the first column contains Exp18 \begin{axis}[] \addplot[table/x index={1}, table/y index={2}, x filter/.code={ \pgfplotstablegetelem{\coordindex}{Experiment}\of{\data} \IfStrEq{\pgfplotsretval}{Exp18} {} {\def\pgfmathresult{}} }] table {\data}; \end{axis} \end{tikzpicture} \end{document} Here is the file content of data.csv. (I had to delete some rows to input less than 30000 characters.) # Exp1, Some meta info..., # Exp2, ..., # Exp3, ..., # Exp4, ..., # Exp5, ..., # Exp6, ..., # Exp7, ..., # Exp8, ..., # Exp9, ..., # Exp10, ..., # Exp11, ..., # Exp12, ..., # Exp13, ..., # Exp14, ..., # Exp15, ..., # Exp16, ..., # Exp17, ..., # Exp18, ..., Experiment,X,Y Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp1,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp5,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp6,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp7,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp8,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp9,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp10,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp11,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp12,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp13,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp14,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp15,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp16,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp17,nan,nan Exp18,nan,nan Exp18,nan,nan Exp18,1.758,0.1279 Exp18,2.7777,0.1718 Exp18,3.7679,0.212 Exp18,4.7874,0.2447 Exp18,5.8074,0.2752 Exp18,6.8276,0.2997 Exp18,7.8479,0.3194 Exp18,8.8679,0.3362 Exp18,9.8874,0.3562 Exp18,10.9074,0.3726 Exp18,11.8975,0.3856 Exp18,12.918,0.4001 Exp18,13.9378,0.4135 Exp18,14.9578,0.4284 Exp18,15.9773,0.4392 Exp18,16.9974,0.4492 Exp18,18.0179,0.4578 Exp18,19.0378,0.4685 Exp18,20.0276,0.4834 Exp18,21.0478,0.4923 Exp18,22.0674,0.5009 Exp18,23.0875,0.5102 Exp18,24.1079,0.521 Exp18,25.1276,0.5325 Exp18,26.1479,0.5425 Exp18,27.1377,0.5478 Exp18,28.1574,0.5582 Exp18,29.1775,0.569 Exp18,30.2278,0.579 Exp18,31.2479,0.589 Exp18,32.2672,0.5961 Exp18,33.2874,0.6032 Exp18,34.3079,0.6113 Exp18,35.298,0.6236 Exp18,36.3177,0.6314 Exp18,37.3377,0.6389 Exp18,38.3573,0.6452 Exp18,39.3776,0.6549 Exp18,40.3981,0.6668 Exp18,41.4176,0.6753 Exp18,42.408,0.6809 Exp18,43.4274,0.6894 Exp18,44.4474,0.7017 Exp18,45.4675,0.7117 Exp18,46.488,0.7184 Exp18,47.5079,0.727 Exp18,48.5275,0.7352 Exp18,49.5473,0.7456 Exp18,50.5374,0.7556 Exp18,51.5579,0.7642 Exp18,52.5778,0.772 Exp18,53.5981,0.7846 Exp18,54.6173,0.7958 Exp18,55.6373,0.8051 Exp18,56.6578,0.8125 Exp18,57.6781,0.8214 Exp18,58.6678,0.8356 Exp18,59.6879,0.8467 Exp18,60.7072,0.8549 Exp18,61.7275,0.8623 Exp18,62.7479,0.8724 Exp18,63.7676,0.8861 Exp18,64.7878,0.898 Exp18,65.7776,0.9059 Exp18,66.7974,0.9159 Exp18,67.8175,0.93 Exp18,68.8381,0.9427 Exp18,69.8576,0.9531 Exp18,70.8778,0.9627 Exp18,71.8974,0.9724 Exp18,72.9175,0.9843 Exp18,73.9076,0.9988 Exp18,74.928,1.0089 Exp18,75.9479,1.0185 Exp18,76.9676,1.0319 Exp18,77.9872,1.0464 Exp18,79.0074,1.0591 Exp18,80.0281,1.0717 Exp18,81.0179,1.0821 Exp18,82.0378,1.0974 Exp18,83.0571,1.1122 Exp18,84.0774,1.1253 Exp18,85.0978,1.1364 Exp18,86.1179,1.1502 Exp18,87.1379,1.1658 Exp18,88.1575,1.1833 Exp18,89.1472,1.1933 Exp18,90.1675,1.2074 Exp18,91.188,1.2245 Exp18,92.2077,1.2416 Exp18,93.2279,1.2595 Exp18,94.2472,1.2733 Exp18,95.2675,1.2889 Exp18,96.2881,1.3056 Exp18,97.2781,1.3249 Exp18,98.2974,1.3413 Exp18,99.3177,1.3569 Exp18,100,1.3551
- types of systems of linear equations and intersection of planes, with tikzby Juan Leal on July 22, 2023 at 2:57 pm
Is there a simple way using tikz to graph a plane from its equation (like those of the systems on the right side, e.g. 2x +3y -z = 11), and that allows me to represent the intersection of two or three of them (even four)? If possible, I additionally need it to allow me to have flat colors in each of the planes involved and not to be represented by pieces as suggested by some of the solutions I have seen. I want to represent graphically to my students all the possibilities that can be presented with a system of linear equations with three unknowns, in a way similar to the one in the image I include. I have been reading the material related to this topic for three days and I have not found a completely satisfactory solution (or maybe there is one, but I have not appreciated it properly). I know a bit about tikz, pgfplots and tikz-3dplot (and I come from the old school of pstricks).
- 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
- How to plot the 3D graph of the following three inequalities in latex (e.g., tikz/pgf)?by learner on July 9, 2021 at 9:27 am
How to plot the 3D graph of the following three inequalities in latex (tikz/pgf) ? z <= x+y+1, z <= 4x, z <= 5y. My attempt: \documentclass[12pt,leqno]{amsart} \usepackage{pgfplots} \usepackage{tikz} \begin{document} \begin{tikzpicture} \begin{axis} \addplot3 [ domain=-5:20, domain y = -3:10, samples = 20, samples y = 8, surf] {x+y+1}; \addplot3[domain=-5:20, domain y = -3:10, samples = 20, samples y = 8, surf, opacity=0.25]{4*x}; \addplot3[domain=-5:20, domain y = -3:10, samples = 20, samples y = 8, surf, opacity=0.25]{5*y}; \end{axis} \end{tikzpicture} \end{document} The above Latex code produces the above figure: But the above graph is not clear, the intersecting line of the three half-planes are not clear. Any help to draw clear image with clear intersection. Any help both with the 3D graph of the given 3 inequalities. Thanks Edit: The 2D projection of the above 3 inequalities becomes: and this is justified by the answer of @Juan Castaño.
- Alignment of pgfplots inside subfloats when using tikzplotlibby Marvin Noll on December 4, 2020 at 10:58 pm
I'm using the tikzplotlib code below to generate two Plots. I then place them in two subfloats. As you can see in the final latex output, the figure looks rather ugly with the two plots differently sized and not aligned. What can i do to achieve the same size of the plots and to align them properly. Maybe worth noting, i have several of these figures with multiple subfloats in my document. Python: import matplotlib.pyplot as plt import tikzplotlib import numpy as np x1=np.arange(0,10)*10e9 x2=np.arange(0,1000) y1=np.random.randn(1,len(x1))[0] y2=0.01*x2*np.random.randn(1,len(x2))[0] KIT_green=(0/255,150/255,130/255) KIT_blue=(70/255,100/255,170/255) plt.figure() plt.plot(x2,y2,label="second trace",color=KIT_green) plt.xlabel(r"Time $t$ (in \si{\milli\second})") plt.ylabel(r"Amplitude $S_{11}$ \\ (some measurement) \\ (and another meaningless line) (in \si{\volt})"); tikzplotlib.save("subfigs_left.tikz",extra_axis_parameters=["ylabel style={align=center}"],axis_width="5cm",axis_height="5cm") plt.figure() plt.plot(x1,y1,label="first trace",color=KIT_blue) plt.xlabel(r"Time $t$ (in \si{\milli\second})") plt.ylabel(r"Amplitude $S_{11}$, $S_{35}$ (in \si{\volt})"); tikzplotlib.save("subfigs_right.tikz",extra_axis_parameters=["ylabel style={align=center}"],axis_width="5cm",axis_height="5cm") LaTeX: \documentclass[11pt]{article} \usepackage[utf8]{inputenc} \usepackage{graphicx} \usepackage{subfig} \usepackage{siunitx} \usepackage{tikz} \usepackage{pgfplots} \usepackage{tikzscale} \begin{document} \begin{figure} \centering \subfloat[Plot 1: this shows this]{\includegraphics[width=0.4\textwidth]{subfigs_left.tikz}} \qquad \subfloat[Plot 2: and this shows that. But this explanation is quite long. blablabla]{\includegraphics[width=0.4\textwidth]{subfigs_right.tikz}} \caption{Two plots} \label{fig:subfig} \end{figure} \end{document}
- TikZ plot for Enneper's minimal surface?by Yiannis I on November 9, 2020 at 12:41 pm
Is there a way to plot Enneper's minimal surface in TikZ either using its implicit equation or its parameterized form? ref:https://mathworld.wolfram.com/EnnepersMinimalSurface.html
- Beamer: Overlay with `pgfplots` that read data from a tableby tvk on May 2, 2019 at 1:30 am
I want to show a chart by the package pgfplots only on a subsequent slide of a frame. However using \uncover or \visible on the chart generates an error: Package pgfplots Error: Could not read table file '" {Other Categories} 0 0 . } with the MWE below. If I remove the \uncover, the file compiles and produces a static frame as I show below. How can I display the chart only on certain slides? MWE: \documentclass{beamer} \setbeamercovered{dynamic} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.16} \begin{document} \begin{frame}[fragile] \uncover<2->{ \begin{figure} \caption{A Stacked Bar Chart} \smallskip {\centering \begin{tikzpicture}[scale=0.7] \begin{axis}[ ybar stacked, xlabel={Category}, ylabel={Quantity}, ymin=0, symbolic x coords={A,B/C,D,Other Categories}, xtick=data, legend style={ at={(0.5,-0.3)}, anchor=north, }, axis lines=left, enlarge x limits=true, enlarge y limits={true,upper}, ] \addplot[fill=white] table [header=false,x index = {0}, y index = {1}] { {Other Categories} 24.4417 18.9708 28.7252 28.7150 A 27.1738 2.9262 28.9467 14.5613 B/C 3.8096 8.3549 4.7284 24.0084 D 27.4013 16.4064 29.1178 4.2566 }; \addplot[fill=red] table [header=false,x index = {0}, y index = {1}] { {Other Categories} 0 0 . . A 8.4352 19.1898 . . B/C 18.3147 13.1148 . . D 15.8441 0.7142 . . }; \legend{White part, Red part} \end{axis} \end{tikzpicture} \par} \end{figure} } \end{frame} \end{document} Static frame:
- Multiple 2D Gaussian ellipses in 3D plotby dodi on March 19, 2019 at 12:30 pm
I'd like to plot different bivariate Gaussian distributions as shaded 2D ellipses at different points in 3D space. The 2D ellipses I would plot like Jake suggests in Gaussian ellipsoids using tikz, but technically that is already a 3D plot. Is there a possibility to extend this method? I came up with the following example (left: example how I like the ellipses to be orientated, taken from https://arxiv.org/abs/1611.03986, right: my ansatz): Two main points are that the colormap is not actually transparent and one cannot see the axis of the outer coordinate system any more, and that I would like to have the ellipses at a fixed point y in the xz-plane (this means that the bottom line of the black rectangles should be parallel to the x-axis and compressed accordingly). \documentclass{standalone} \usepackage{tikz,pgfplots} \usepgfplotslibrary{patchplots} \pgfplotsset{% colormap={whitered}{color(0cm)=(transparent); color(1.cm)=(red)}% } \begin{document} \begin{tikzpicture}[baseline, declare function={bivar(\ma,\sa,\mb,\sb)= 1/(2*pi*\sa*\sb) * exp(-((x-\ma)^2/\sa^2 + (y-\mb)^2/\sb^2))/2;}] % Outer coordinate system \begin{axis}[ unit vector ratio*=1 1 1, axis lines = middle, view={120}{30}, domain = -10:10, zmin = -5, zmax = 5, xlabel = $x$, ylabel = $y$, zlabel = $z$, x label style={at={(ticklabel* cs:1.)},anchor=north east}, y label style={at={(ticklabel* cs:1.)},anchor=north west}, z label style={at={(ticklabel* cs:1.)},anchor=south}, ] \coordinate (origin1) at (axis cs:0,-10,0); \coordinate (origin2) at (axis cs:0,10,0); \addplot3[no markers,opacity=0]{0}; % <- without this pseudo plot, the outer coordinate system does not work \end{axis} % Bivariate distribution 1 \begin{axis}[ at={(origin1)}, anchor={center}, width=3cm, height=3cm, scale only axis, axis equal image, hide axis, colormap name=whitered, view={0}{90}, enlargelimits=false, domain=-1.5:1.5, y domain=-1.5:1.5, ] \addplot3 [surf, draw=none, samples=19, shader=interp, patch type=bilinear] {bivar(0,.1,0,.6)}; \end{axis} % Bivariate distribution 2 \begin{axis}[ at={(origin2)}, anchor={center}, width=3cm, height=3cm, scale only axis, axis equal image, hide axis, colormap name=whitered, view={0}{90}, enlargelimits=false, domain=-1.5:1.5, y domain=-1.5:1.5, ] \addplot3 [surf, draw=none, samples=19, shader=interp, patch type=bilinear] {bivar(0,.2,0,.3)}; \end{axis} \end{tikzpicture} \end{document}
- PGFPlot 3D opacity and appearanceby Gabriel Pino on January 11, 2018 at 10:02 pm
I used MATLAB to generate some 3D figures and I would like to show two surfaces in one graphic using PGFPlots. In order to better illustrate the surface differences, I set opacity = 0.5 for both of them. The matlab figure perfectly shows the spots where the blue function is greater than the red one, as you can see below. The PGFplot is a little bit different: I have already tried matlab2tikz and it did not work very well. What can I do to improve my TeX code? \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{decorations.text,arrows} \usepackage{pgfplots} \usepackage{animate} \pgfplotsset{compat=1.15} \usepgfplotslibrary{colormaps} \pgfplotsset{colormap={prop}{ rgb255=(1,1,255) rgb255=(10, 10, 255) }} \pgfplotsset{colormap={berg}{ rgb255=(255,1,1) rgb255=(255, 10, 10) }} \begin{filecontents}{TPTC.dat} -5.0000000e+00 -5.0000000e+00 0.0000000e+00 8.3333333e-02 -5.0000000e+00 -4.0000000e+00 0.0000000e+00 1.6666667e-01 -5.0000000e+00 -3.0000000e+00 8.3333333e-02 8.3333333e-02 -5.0000000e+00 -2.0000000e+00 0.0000000e+00 1.6666667e-01 -5.0000000e+00 -1.0000000e+00 8.3333333e-02 2.5000000e-01 -5.0000000e+00 0.0000000e+00 1.6666667e-01 2.5000000e-01 -5.0000000e+00 1.0000000e+00 8.3333333e-02 8.3333333e-02 -5.0000000e+00 2.0000000e+00 8.3333333e-02 1.6666667e-01 -5.0000000e+00 3.0000000e+00 8.3333333e-02 3.3333333e-01 -5.0000000e+00 4.0000000e+00 2.5000000e-01 8.3333333e-02 -5.0000000e+00 5.0000000e+00 3.3333333e-01 2.5000000e-01 -4.0000000e+00 -5.0000000e+00 1.6666667e-01 1.6666667e-01 -4.0000000e+00 -4.0000000e+00 1.6666667e-01 1.6666667e-01 -4.0000000e+00 -3.0000000e+00 8.3333333e-02 8.3333333e-02 -4.0000000e+00 -2.0000000e+00 8.3333333e-02 2.5000000e-01 -4.0000000e+00 -1.0000000e+00 2.5000000e-01 3.3333333e-01 -4.0000000e+00 0.0000000e+00 8.3333333e-02 1.6666667e-01 -4.0000000e+00 1.0000000e+00 8.3333333e-02 2.5000000e-01 -4.0000000e+00 2.0000000e+00 0.0000000e+00 1.6666667e-01 -4.0000000e+00 3.0000000e+00 2.5000000e-01 8.3333333e-02 -4.0000000e+00 4.0000000e+00 2.5000000e-01 4.1666667e-01 -4.0000000e+00 5.0000000e+00 2.5000000e-01 4.1666667e-01 -3.0000000e+00 -5.0000000e+00 8.3333333e-02 8.3333333e-02 -3.0000000e+00 -4.0000000e+00 8.3333333e-02 0.0000000e+00 -3.0000000e+00 -3.0000000e+00 8.3333333e-02 2.5000000e-01 -3.0000000e+00 -2.0000000e+00 8.3333333e-02 8.3333333e-02 -3.0000000e+00 -1.0000000e+00 8.3333333e-02 2.5000000e-01 -3.0000000e+00 0.0000000e+00 8.3333333e-02 8.3333333e-02 -3.0000000e+00 1.0000000e+00 2.5000000e-01 8.3333333e-02 -3.0000000e+00 2.0000000e+00 2.5000000e-01 1.6666667e-01 -3.0000000e+00 3.0000000e+00 2.5000000e-01 2.5000000e-01 -3.0000000e+00 4.0000000e+00 3.3333333e-01 3.3333333e-01 -3.0000000e+00 5.0000000e+00 4.1666667e-01 7.5000000e-01 -2.0000000e+00 -5.0000000e+00 8.3333333e-02 0.0000000e+00 -2.0000000e+00 -4.0000000e+00 1.6666667e-01 8.3333333e-02 -2.0000000e+00 -3.0000000e+00 8.3333333e-02 3.3333333e-01 -2.0000000e+00 -2.0000000e+00 8.3333333e-02 1.6666667e-01 -2.0000000e+00 -1.0000000e+00 3.3333333e-01 1.6666667e-01 -2.0000000e+00 0.0000000e+00 1.6666667e-01 1.6666667e-01 -2.0000000e+00 1.0000000e+00 4.1666667e-01 3.3333333e-01 -2.0000000e+00 2.0000000e+00 3.3333333e-01 1.6666667e-01 -2.0000000e+00 3.0000000e+00 4.1666667e-01 4.1666667e-01 -2.0000000e+00 4.0000000e+00 8.3333333e-02 4.1666667e-01 -2.0000000e+00 5.0000000e+00 3.3333333e-01 1.0000000e+00 -1.0000000e+00 -5.0000000e+00 1.6666667e-01 1.6666667e-01 -1.0000000e+00 -4.0000000e+00 8.3333333e-02 1.6666667e-01 -1.0000000e+00 -3.0000000e+00 8.3333333e-02 2.5000000e-01 -1.0000000e+00 -2.0000000e+00 2.5000000e-01 8.3333333e-02 -1.0000000e+00 -1.0000000e+00 8.3333333e-02 3.3333333e-01 -1.0000000e+00 0.0000000e+00 3.3333333e-01 3.3333333e-01 -1.0000000e+00 1.0000000e+00 2.5000000e-01 4.1666667e-01 -1.0000000e+00 2.0000000e+00 2.5000000e-01 5.8333333e-01 -1.0000000e+00 3.0000000e+00 5.0000000e-01 1.6666667e-01 -1.0000000e+00 4.0000000e+00 2.5000000e-01 9.1666667e-01 -1.0000000e+00 5.0000000e+00 2.5000000e-01 1.0833333e+00 0.0000000e+00 -5.0000000e+00 8.3333333e-02 0.0000000e+00 0.0000000e+00 -4.0000000e+00 8.3333333e-02 2.5000000e-01 0.0000000e+00 -3.0000000e+00 3.3333333e-01 2.5000000e-01 0.0000000e+00 -2.0000000e+00 1.6666667e-01 1.6666667e-01 0.0000000e+00 -1.0000000e+00 5.8333333e-01 8.3333333e-02 0.0000000e+00 0.0000000e+00 2.5000000e-01 3.3333333e-01 0.0000000e+00 1.0000000e+00 3.3333333e-01 5.8333333e-01 0.0000000e+00 2.0000000e+00 2.5000000e-01 5.8333333e-01 0.0000000e+00 3.0000000e+00 8.3333333e-02 2.5000000e-01 0.0000000e+00 4.0000000e+00 1.0833333e+00 9.1666667e-01 0.0000000e+00 5.0000000e+00 7.5000000e-01 1.2500000e+00 1.0000000e+00 -5.0000000e+00 8.3333333e-02 1.6666667e-01 1.0000000e+00 -4.0000000e+00 8.3333333e-02 2.5000000e-01 1.0000000e+00 -3.0000000e+00 2.5000000e-01 2.5000000e-01 1.0000000e+00 -2.0000000e+00 2.5000000e-01 2.5000000e-01 1.0000000e+00 -1.0000000e+00 3.3333333e-01 1.6666667e-01 1.0000000e+00 0.0000000e+00 5.0000000e-01 6.6666667e-01 1.0000000e+00 1.0000000e+00 3.3333333e-01 4.1666667e-01 1.0000000e+00 2.0000000e+00 2.5000000e-01 1.0833333e+00 1.0000000e+00 3.0000000e+00 5.8333333e-01 9.1666667e-01 1.0000000e+00 4.0000000e+00 2.5000000e-01 1.4166667e+00 1.0000000e+00 5.0000000e+00 9.1666667e-01 9.1666667e-01 2.0000000e+00 -5.0000000e+00 8.3333333e-02 8.3333333e-02 2.0000000e+00 -4.0000000e+00 2.5000000e-01 2.5000000e-01 2.0000000e+00 -3.0000000e+00 2.5000000e-01 2.5000000e-01 2.0000000e+00 -2.0000000e+00 2.5000000e-01 8.3333333e-02 2.0000000e+00 -1.0000000e+00 2.5000000e-01 5.8333333e-01 2.0000000e+00 0.0000000e+00 4.1666667e-01 4.1666667e-01 2.0000000e+00 1.0000000e+00 7.5000000e-01 8.3333333e-01 2.0000000e+00 2.0000000e+00 8.3333333e-01 7.5000000e-01 2.0000000e+00 3.0000000e+00 2.5000000e-01 1.1666667e+00 2.0000000e+00 4.0000000e+00 4.1666667e-01 1.2500000e+00 2.0000000e+00 5.0000000e+00 7.5000000e-01 1.4166667e+00 3.0000000e+00 -5.0000000e+00 3.3333333e-01 1.6666667e-01 3.0000000e+00 -4.0000000e+00 1.6666667e-01 4.1666667e-01 3.0000000e+00 -3.0000000e+00 3.3333333e-01 5.8333333e-01 3.0000000e+00 -2.0000000e+00 1.6666667e-01 4.1666667e-01 3.0000000e+00 -1.0000000e+00 1.6666667e-01 2.5000000e-01 3.0000000e+00 0.0000000e+00 4.1666667e-01 1.0833333e+00 3.0000000e+00 1.0000000e+00 4.1666667e-01 9.1666667e-01 3.0000000e+00 2.0000000e+00 4.1666667e-01 7.5000000e-01 3.0000000e+00 3.0000000e+00 5.0000000e-01 1.2500000e+00 3.0000000e+00 4.0000000e+00 6.6666667e-01 1.0833333e+00 3.0000000e+00 5.0000000e+00 1.4166667e+00 1.2500000e+00 4.0000000e+00 -5.0000000e+00 2.5000000e-01 1.6666667e-01 4.0000000e+00 -4.0000000e+00 2.5000000e-01 2.5000000e-01 4.0000000e+00 -3.0000000e+00 8.3333333e-02 2.5000000e-01 4.0000000e+00 -2.0000000e+00 2.5000000e-01 4.1666667e-01 4.0000000e+00 -1.0000000e+00 2.5000000e-01 8.3333333e-01 4.0000000e+00 0.0000000e+00 2.5000000e-01 9.1666667e-01 4.0000000e+00 1.0000000e+00 4.1666667e-01 4.1666667e-01 4.0000000e+00 2.0000000e+00 4.1666667e-01 1.2500000e+00 4.0000000e+00 3.0000000e+00 2.5000000e-01 1.2500000e+00 4.0000000e+00 4.0000000e+00 9.1666667e-01 1.5833333e+00 4.0000000e+00 5.0000000e+00 1.2500000e+00 1.4166667e+00 5.0000000e+00 -5.0000000e+00 2.5000000e-01 0.0000000e+00 5.0000000e+00 -4.0000000e+00 2.5000000e-01 7.5000000e-01 5.0000000e+00 -3.0000000e+00 3.3333333e-01 8.3333333e-01 5.0000000e+00 -2.0000000e+00 8.3333333e-02 2.5000000e-01 5.0000000e+00 -1.0000000e+00 2.5000000e-01 6.6666667e-01 5.0000000e+00 0.0000000e+00 2.5000000e-01 5.8333333e-01 5.0000000e+00 1.0000000e+00 2.5000000e-01 9.1666667e-01 5.0000000e+00 2.0000000e+00 5.8333333e-01 1.5000000e+00 5.0000000e+00 3.0000000e+00 1.2500000e+00 1.2500000e+00 5.0000000e+00 4.0000000e+00 1.0833333e+00 1.4166667e+00 5.0000000e+00 5.0000000e+00 1.0833333e+00 1.0833333e+00 \end{filecontents} \begin{document} \begin{animateinline}[autoplay, loop, controls, %viewport=0 0 110 153, %scale = 0.9; buttonsize=3ex, buttonfg=1.0:1.0:1.0, buttonbg=0.5]{0.4} % frames por segundo \multiframe{4}{i=1+1}{ \begin{tikzpicture} \begin{axis}[% %3d box, width=0.9\textwidth, height=0.75\textwidth, xmin=-5, xmax=5, xtick={-2.5,0,2.5}, tick align=outside, extra x ticks={-5,5}, extra tick style={ grid=none, }, xlabel={erro TP [\%]}, ymin=-5, ymax=5, ytick={-2.5,0,2.5}, extra y ticks={-5,5}, extra tick style={ grid=none, }, ylabel={erro TC [\%]}, zmin=0, zmax=2, ztick={0,0.5,1,1.5}, extra z ticks={2}, extra tick style={ grid=none, }, zlabel={erro relativo [\%]}, view={-15+360*(\i-1)/4}{47}, grid = major, grid style=dashed ] \addplot3[% surf, draw = black, line width = 0.05pt, %shader= flat corner, colormap name=prop, fill opacity = 0.5, z buffer=auto, unbounded coords=jump, mesh/rows=11] table[x index=0,y index=1,z index=2] {TPTC.dat}; \addlegendentry{proposto} \addplot3[% surf, draw = black, line width = 0.05pt, %shader= flat corner, colormap name=berg, fill opacity = 0.5, z buffer=auto, unbounded coords=jump, mesh/rows=11] table[x index=0,y index=1,z index=3] {TPTC.dat}; \addlegendentry{\textit{Bergeron}} \end{axis} \end{tikzpicture}% } \end{animateinline} \end{document}
- Truncated cylinder in PGFPlotsby Cragfelt on December 15, 2017 at 9:03 am
I would like the surface of the cylinder to reach the blue arcs towards left (y-axis) but not passing through them. How can I achieve that? \documentclass[border=3mm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.15} \begin{document} \begin{tikzpicture} \begin{axis}[% axis lines=middle, ticks=none, zmin=-2, zmax=2, xmin=-3, xmax=3, ymin=-1, ymax=3, view/h=125, view/v=25 ] \addplot3[% opacity = 0.02, fill opacity=0.5, mesh/interior colormap name=hot, surf, colormap/hot, faceted color=black, z buffer = sort, samples = 50, variable = \u, variable y = \v, domain = 0:360, y domain = -3:3, ] ({cos(u)}, {max(v,cos(v))}, {sin(u)}); % ARCS \addplot3[% variable= \t, mesh, blue!80!, semithick, samples=30, opacity = 0.025, z buffer = sort, domain= 0:180, ] ({sin(t)}, {sin(t)}, {cos(t)}); \addplot3[% variable= \t, mesh, blue!80!, semithick, samples=30, opacity = 0.025, z buffer = sort, domain= 0:-180, ] ({sin(t)}, {-sin(t)}, {cos(t)}); \end{axis} \end{tikzpicture} \end{document}
- Draw a 2D functions in tikzby Dipole on August 4, 2015 at 10:58 am
I want to be able to plot in a 3D environment any type of function of two variables z = f(x,y), where x and y are specified within a given range. For instance plot f(x,y) = x^2 + y^2 where x in [-2,2] and y in [-2,2] as a "wireframe" surface plot. I want this plot to go on the rectangle (defined in the same coordinate system) that I have drawn, without the axis labels. How can this be done \documentclass[border=10pt,varwidth]{standalone} \usepackage{tikz,tikz-3dplot} \usepackage{pgfplots} \pgfplotsset{ every axis/.append style = {thick},tick style = {thick,black}, % % #1 = x, y, or z % #2 = the shift value /tikz/normal shift/.code 2 args = {% \pgftransformshift{% \pgfpointscale{#2}{\pgfplotspointouternormalvectorofticklabelaxis{#1}}% }% },% % range3frame/.style = { tick align = outside, scaled ticks = false, enlargelimits = false, ticklabel shift = {10pt}, axis lines* = left, line cap = round, clip = false, xtick style = {normal shift={x}{10pt}}, ytick style = {normal shift={y}{10pt}}, ztick style = {normal shift={z}{10pt}}, x axis line style = {normal shift={x}{10pt}}, y axis line style = {normal shift={y}{10pt}}, z axis line style = {normal shift={z}{10pt}}, } } \begin{document} % ----- First plot \tdplotsetmaincoords{70}{155} \begin{tikzpicture} [scale=3, tdplot_main_coords, axis/.style={->,blue,thick}, vector/.style={-stealth,black,very thick}, vector guide/.style={dotted,black,thick}, ] %standard tikz coordinate definition using x, y, z coords \coordinate (O) at (0,-0.5,0); %tikz-3dplot coordinate definition using r, theta, phi coords \pgfmathsetmacro{\ax}{1} \pgfmathsetmacro{\ay}{-1} \pgfmathsetmacro{\az}{0.5} \coordinate (P) at (\ax,\ay,\az){}; %draw axes \draw[axis] (0,-0.5,0) -- (2,-0.5,0) node[anchor=north east]{$y$}; % x-axis becomes y axis \draw[axis] (0,-0.5,0) -- (0,-2,0) node[anchor=south]{$x$}; %minius y-axis becomes positive x axis \draw[axis] (0,-0.5,0) -- (0,-0.5,2) node[anchor=south]{$z$}; \draw[thick,tdplot_main_coords] (1.5,0.5,0)-- (1.5,-0.5,0) -- (-1.5,-0.5,0)--(-1.5,0.5,0)--cycle; \begin{axis}[range3frame, view={55}{45}] \addplot3[surf, colormap/hot2, samples=41, domain=0:2] {0.1*(x^2+y^2)}; \end{axis} \end{tikzpicture} \end{document}
- Flip x and y axis of ternary graphby Raphael on July 18, 2014 at 4:27 am
I am trying to reproduce the USDA Soil Triangle. To do so, I would need to flip the x and y axis of the default pgfplots-ternary. I understand, that I could switch my inputs (don't really want to do that), but I would need to change the directions as well, and I not even having any success with that. In the default ternary axis, the y axis is on the left and the x axis is on the right, and x runs from 0 (bottom right) to 100 (top) and y runs from top to bottom left. However, according to the USDA Soil Triangle, x needs to run from bottom left to top, y needs to run from top to bottom right, and z from bottom right to bottom left. Also, the x axis (and ticks) need to be horizontal (parallel to z), whereas y needs to be parallel to x and z should be parallel to y. I tried the x dir=reverse and axis on top commands, as I thought I could simply flip my coordinates, but I had no luck. Did anybody ever have a similar problem or knows an answer to this? I did what I could to at least have all the data and such. Here is what I got: \documentclass[]{standalone} \usepackage[dvipsnames]{xcolor} % color handling \usepackage{tikz} % draw pictures and diagrams \usepackage{pgfplots} % proper plotting \usepackage{file contents} % writing reading of data files \usepgfplotslibrary{ternary, units} \begin{filecontents*}{USDASoils.csv} name,clay,silt,sand Sand,0,0,100 Sand,10,0,90 Sand,0,15,85 Loamy Sand,0,15,85 Loamy Sand,10,0,90 Loamy Sand,15,0,85 Loamy Sand,0,30,70 Clay,55,0,45 Clay,100,0,0 Clay,60,40,0 Clay,40,40,20 Clay,40,15,45 Sandy Clay,35,0,65 Sandy Clay,55,0,45 Sandy Clay,35,20,45 Silty Clay,40,40,20 Silty Clay,60,40,0 Silty Clay,40,60,0 Loam,8,40,52 Loam,20,27,53 Loam,27,28,45 Loam,27,50,23 Loam,8,50,42 Sandy Loam,0,30,70 Sandy Loam,15,0,85 Sandy Loam,20,0,80 Sandy Loam,20,27,53 Sandy Loam,8,40,52 Sandy Loam,8,50,42 Sandy Loam,0,50,50 Clay Loam,27,28,45 Clay Loam,40,15,45 Clay Loam,40,40,20 Clay Loam,27,53,20 Sandy Clay Loam,20,0,80 Sandy Clay Loam,35,0,65 Sandy Clay Loam,35,20,45 Sandy Clay Loam,27,28,45 Sandy Clay Loam,20,27,53 Silty Loam,0,50,50 Silty Loam,27,50,23 Silty Loam,27,73,0 Silty Loam,13,87,0 Silty Loam,13,80,7 Silty Loam,0,80,20 Silty Clay Loam,27,53,20 Silty Clay Loam,40,40,20 Silty Clay Loam,40,60,0 Silty Clay Loam,27,73,0 Silt,0,80,20 Silt,13,80,7 Silt,13,87,0 Silt,0,100,0 \end{filecontents*} \pgfplotsset{ discard if not/.style 2 args={ x filter/.code={ \edef\tempa{\thisrow{#1}} \edef\tempb{#2} \ifx\tempa\tempb \else \def\pgfmathresult{inf} \fi } } } \begin{document} \begin{tikzpicture}[scale=0.9] \begin{ternaryaxis}[ xmax=100, ymax=100, zmax=100, ternary limits relative, xlabel=x (Clay), ylabel=y (Silt), zlabel=z (Sand), xtick={0,10,...,100}, ytick={0,10,...,100}, ztick={0,10,...,100}, minor tick num=1, grid=both, ] \def\myopacity{0.5} % Sands \addplot3 [fill=yellow, fill opacity=\myopacity, discard if not={name}{Sand}] table [x=clay,y=silt,z=sand, col sep=comma] {USDASoils.csv}; \addplot3 [fill=Melon, fill opacity=\myopacity,discard if not={name}{Loamy Sand}] table [x=clay,y=silt,z=sand, col sep=comma] {USDASoils.csv}; % Sand Text \node at (axis cs:3,5,) {\tiny Sand}; \node at (axis cs:5,13) {\tiny Loamy}; \node at (axis cs:2,18) {\tiny Sand}; % Clays \addplot3 [fill=yellow, fill opacity=\myopacity, discard if not={name}{Clay}] table [x=clay,y=silt,z=sand, col sep=comma] {USDASoils.csv}; \addplot3 [fill=red, fill opacity=\myopacity, discard if not={name}{Sandy Clay}] table [x=clay,y=silt,z=sand, col sep=comma] {USDASoils.csv}; \addplot3 [fill=Aquamarine!50, fill opacity=\myopacity, discard if not={name}{Silty Clay}] table [x=clay,y=silt,z=sand, col sep=comma] {USDASoils.csv}; %Clay Text \node at (axis cs:65,16) {\tiny Clay}; \node at (axis cs:43,6) {\tiny Sandy}; \node at (axis cs:38,8) {\tiny Clay}; \node at (axis cs:48,47) {\tiny Silty}; \node at (axis cs:44,49) {\tiny Clay}; % Loams \addplot3 [fill=brown, fill opacity=\myopacity, discard if not={name}{Loam}] table [x=clay,y=silt,z=sand, col sep=comma] {USDASoils.csv}; \addplot3 [fill=purple!50, fill opacity=\myopacity, discard if not={name}{Sandy Loam}] table [x=clay,y=silt,z=sand, col sep=comma] {USDASoils.csv}; \addplot3 [fill=purple!25, fill opacity=\myopacity, discard if not={name}{Sandy Clay Loam}] table [x=clay,y=silt,z=sand, col sep=comma] {USDASoils.csv}; \addplot3 [fill=SpringGreen, fill opacity=\myopacity, discard if not={name}{Clay Loam}] table [x=clay,y=silt,z=sand, col sep=comma] {USDASoils.csv}; \addplot3 [fill=Green, fill opacity=\myopacity, discard if not={name}{Silty Loam}] table [x=clay,y=silt,z=sand, col sep=comma] {USDASoils.csv}; \addplot3 [fill=Aquamarine, fill opacity=\myopacity, discard if not={name}{Silty Clay Loam}] table [x=clay,y=silt,z=sand, col sep=comma] {USDASoils.csv}; % Loams Text \node at (axis cs:19,40) {\tiny Loam}; \node at (axis cs:12,23) {\tiny Sandy Loam}; \node at (axis cs:28,13) {\tiny Sandy Clay Loam}; \node at (axis cs:33,35) {\tiny Clay Loam}; \node at (axis cs:13,65) {\tiny Silty Loam}; \node at (axis cs:36,55) {\tiny Silty}; \node at (axis cs:31,58) {\tiny Clay Loam}; % Silts \addplot3 [fill=green, fill opacity=\myopacity, discard if not={name}{Silt}] table [x=clay,y=silt,z=sand, col sep=comma] {USDASoils.csv}; % Silt Text \node at (axis cs:6,88) {\tiny Silt}; \end{ternaryaxis} \end{tikzpicture} \end{document} Which looks like this: I am considerably happy with my result, but I would like to: Switch the axis (as explained above), Remove the minor ticks (but keep the minor grid - I could not get that to work), and have the axis labels sloped along the triangle sides (as in the original picture above)