{pgfplots} is a package for creating 2D and 3D plots of mathematical functions and numerical data, using the PGF graphics framework. For questions about the inbuilt plotting functionality of TikZ/PGF, use {tikz-pgf} instead.

learn more… | top users | synonyms

1
vote
0answers
33 views

How do I uniformly change bar thickness, box width and add error bars?

I need help with a few adjustments on this group plot. I managed to solved my previous problem but now I´m searching for a needle in a haystack. 1. How do I make the bars thinner so they may fit ...
1
vote
1answer
60 views

How to do the following graph in LaTeX with pgfplots?

is there anybody who can help me with graph in graph pictures?
1
vote
0answers
105 views

draw a function in Latex

I'm a beginner to latex and tikz, I've learned some basics but I still don't have a clue to draw functions in latex or tikz. Could anyone provide me with the codes for the two functions shown in the ...
4
votes
1answer
95 views

Filter in PGFPlots by x coordinate value

I've been trying to springboard off of the answer I got from percusse here, but I'm drowning in the PGFPlots manual. I wanted to plot a smooth region in the middle, given the x coordinate values ...
1
vote
0answers
27 views

Something like \tikzexternalize[prefix=tikztmp/] for LuaLaTeX

My aim is to compile a *.tex file that contains quite a number of tikz-environments and to create for every tikz-environment one pdf-file. Under LaTeX I would use something like ...
4
votes
1answer
56 views

Style args syntax for negative/not/except to make this cleaner code

I asked another question and not only did percusse explain the code, but went even farther and wrote my code for me. That is beyond awesome. All I need to do is switch the part of the plot that the ...
3
votes
1answer
79 views

Plot every nth point except for a region in the middle

I found these neat little additions here, but I'm having a hard time reading the code: \makeatletter \def\pgfplotsutil@decstringcounter#1{% \begingroup \c@pgf@counta=#1\relax ...
1
vote
1answer
63 views

Improving a tikz plot

I have drawn the following picture with tikz: Code for MWE: \documentclass[a4paper,12pt,notitlepage,oneside,reqno]{scrbook} \usepackage[T1]{fontenc} \usepackage{kpfonts} \usepackage{libertine} ...
6
votes
1answer
88 views

Two different axis labels in one pgfplots graph

Is there any way in pgfplots describe the positive part of the x-axis labels above the axis and the negative part of the x-axis label below the axis? The point is that if the graph of the function is ...
0
votes
0answers
89 views

Option payoff diagrams in LaTeX

How can I generate an option payoff diagram such as this in LaTeX with PGFPlots or TikZ?
3
votes
1answer
35 views

Align legend label to text

I have this MWE. \documentclass{article} \usepackage{pgfplots} \usetikzlibrary{patterns} \definecolor{nrgray}{HTML}{F0F0F0} \newcommand{\graphTripleData}[4]{ \begin{tikzpicture} \begin{axis}[ ...
5
votes
1answer
107 views

3d surface plot with logarithmic x and y axis

What I need the surface of the function $(1/x)^(1/y)$ in the range of x:10^1 - 10^8 and y:10^1 - 10^5. The x and y axes are preferred to be in logarithmic scale. I tried different approaches, but none ...
10
votes
1answer
166 views

ybar stacked: Position of labels

I want to display some results of a performance test in a diagram as ybar stacked, but as you can see, some labels are printed over others and are hard to read (because of colors). Now I want labels ...
7
votes
4answers
195 views

tikz/pgfplot — always same distance between marks

Is there a way to get for all tikz-plots in one LaTeX document the same distance between the plot marks, ie the distance between the marks should be independent of sample size. It would be really ...
4
votes
1answer
56 views

One more skipping jump discontinuity in pgfplots

Trying to draw graphs using pgfplots (regarding this library, I am a beginner). I tried to find a solution to my problem (in even offered links), but I was not successful. Is it possible to achieve ...
2
votes
1answer
41 views

pgfplots: How can I write square brackets in xlabel or ylabel?

The following works fine: \begin{tikzpicture} \begin{axis}[xlabel=$k$, ylabel=$x(k)$] \addplot coordinates {(0,1) (1,4) (2,2) (3,-1) (4,2)}; \end{axis} \end{tikzpicture} But as soon as I ...
3
votes
1answer
102 views

How to remove automatic exponential coordinate value (Polystyrene Foam in this case) in tikz?

\documentclass{standalone} \usepackage{tikz,pgf,pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ xbar, xmin=0, xlabel={\textbf{Unit Weight (in $\mathbf{kN/m^3}$)}}, symbolic y ...
4
votes
1answer
56 views

pgfplots and subfigure

I'm using Springer LNCS template to create a paper, so that I can't use subcaption Using subfigure with pgfplots results in no aligning at all. The code I use to draw plots: \begin{figure} ...
6
votes
0answers
132 views

Special effects in TikZ leads to unprintable PDF

So I recently made a picture of the Mexican Hat Potential (related to the Brout-Englert-Higgs Mechanism of particle physics). I am more than satisfied with the graph and everything, but I noticed ...
6
votes
1answer
94 views

Calculate axis limits depending on depicted data

In a pgfplots axis environment, I want to make the axis limits dependent on the depicted data or some other data. Consider the minimum working example \documentclass{standalone} ...
4
votes
1answer
85 views

pgfplots complains path is empty

I'm trying to fill an area under a curve drew with pgfplots. I've tried the solution outlined in this answer: \documentclass{article} \usepackage{amsmath} \usepackage[usenames,dvipsnames]{xcolor} ...
3
votes
1answer
35 views

Changing the properties of only one plot in a ybar

Sorry I am sure there is a simple answer to this but I just can't find it! All I am trying to do is turn off the labels (I think they are called nodes near coords) on the second set of data, ie. the ...
15
votes
6answers
477 views

Draw a smooth surface

I would like to draw a smooth surface like http://mathematica.stackexchange.com/questions/20912/how-to-draw-a-higher-genus-surface but using Asymptote, TikZ, Metapost, PStricks, or other TeX friendly ...
1
vote
0answers
67 views

Memory overload due to pgfplots / tikz

first of all, I need to mention that there are 2 related threads, that I found usefull: 1, 2. I am working with TeXstudio 2.8.8 on Win 7 64bit (i5 @3.3GHz, 8GB RAM - if this matters). My goal is to ...
3
votes
1answer
60 views

Nodes Near coords hide when 0

Is it possible to hide nodes near coords in pgfplots when value = 0 ? I have something like this. And axis setting \begin{axis}[ ybar, bar width=3pt, nodes near coords ]
1
vote
0answers
29 views

pgfplots(table) protect ##1 when in a `\newcommand` with optional arguments

I am using the excellent answer from @percusse to the question How to rotate head row cell entries of pgfplotstable which works great if you always want rotated headers. I am calling ...
2
votes
1answer
38 views

Log mode of short X-axis pfgplots

I'm trying to obtain this graph (made in Origin): Both axes in log scale. This is MWE: \documentclass{standalone} \usepackage{pgfplots} \usepgfplotslibrary{units} \begin{document} ...
2
votes
1answer
39 views

Fill between on top of axis background

How can I draw the fill between area on top of another fill area that is drawn in the axis background preaction? MWE: \documentclass{article} \usepackage{pgfplots, pgfplotstable} ...
3
votes
3answers
111 views

Sizing a pgfplot so it fits in a multicol column

I'm very new to TeX but I'm trying to put together a document that has a multicol layout with a chart inline in the column. The chart always seems to overflow the width of the column and I can't ...
2
votes
1answer
240 views

Plotting f(x) = sin x and f(x) = cos x on pgf/tikz

I'm new to graphing on TikZ/pgf and have been trying to figure this out but can't seem to find any helpful info for what I want. I want to plot the above functions over one period, i.e. on the ...
1
vote
0answers
59 views

Conflict tikzscale and matrix group plot

I want two axis environments next to each other in one figure environment. I want them to be vertically aligned and scaled to the width of the text. I am trying to achieve this by means of the ...
0
votes
1answer
42 views

two tables of same size tikz

I am creating two tables with the following code (tikz package} \documentclass[twoside,11pt]{article} \usepackage{tikz} \usepackage{url} \usepackage[T1]{fontenc} \usetikzlibrary{positioning} ...
0
votes
0answers
97 views

Tikz scientific notation vs. decimal number on x and y axis

I found an interesting potential glitch in tikzpicture in that the arbitrary placement of scaled ticks = false, tick label style ={/pgf/number format/fixed} within the \begin{axis}[] makes a real ...
2
votes
1answer
61 views

Problem with legend on a 2 y-axis line & ybar figure

I cannot seem to figure out a way to switch the legend symbol to the ybar symbol in a two y-axis plot. Here is a minimal working example of my problem Which yields this: So the only problem with ...
2
votes
1answer
73 views

Pgfplots: Placing legends individually to the end of lines

I have a few days of experience with LaTeX. It seems almost everything is possible if you just find out how. So, here is a challenge... If a plot has many lines it is much more readable to have ...
4
votes
2answers
183 views

High degree polynomial plotting with Tikz/pgfplot

I am new to tikz/pgfplots...so sorry if my question has been asked... I am trying to plot the tanh function using pgplots, then add a set of N points and plot the (n-1) degree polynomial passing ...
2
votes
0answers
88 views

Comparison of the plots of the same line on the Cartesian plane using pgfplots and TikZ

I have the plot of a line using pgfplots and the plot of the same line using TikZ. I would like them to be identical. I need to correct a mistake in the plot of a line using pgfplots. The point ...
4
votes
1answer
59 views

Invert axis using pgfplots and TiKz

I am trying to do a stacked histogram, and I am trying to start from the code provided in this question : Tikz Stacked Bar Chart with Text Yet, I would like to invert the axis, so that the A,B,C... ...
6
votes
2answers
80 views

How to draw line through group plots in pgfplots?

This issue has been driving me crazy for the past 10-20h. I have a group plot (pgfplots) where I have 2 plots one under another. I'd like to draw a vertical line (e.g. a helpline at x=150e-6) that ...
2
votes
0answers
40 views

Automatically positioning a legend relative to multiple plots in groupplots

This question deals with centered legend placement in a set of plots aligned with groupplots. However, as the OP stated in a comment, the (accepted) solution requires some hand tweaking. I suspect ...
4
votes
1answer
237 views

Best program for 3D plotting for LaTeX [closed]

I'm cross-posting this (also on Mathematics stack exchange, but not really getting the answers I'm looking for, so thinking I may have posted in the wrong community originally). I've hit a roadblock ...
3
votes
2answers
59 views

row index of first non-zero element in pgfplotstable

I am using the "functions" \findmin and findmax from here quite much to dynamical format and set plots from CSV data I read in. In the same vein, I want a function \findFirstNonZeroIndex, which ...
8
votes
1answer
96 views

Plotting several 2d curves (with different colors) in a 3d graph

I'm trying to reproduce 3D plots with several 2d curves, like in Plotting several 2D functions in a 3D graph. The end result looks like this: The questions are: I would like to change X labels ...
2
votes
1answer
141 views

Electromagnetic Wave Propagation with TikZ [closed]

I'm looking for a code drawing the below picture with TikZ if it is possible: I just need the graph in the middle, i.e. there is no need to also include the text and/or equations. Simply the plot ...
2
votes
1answer
46 views

Why does pgfplots's “current plot style” throw an error even when it works?

I managed to produce the following diagram with pgfplots and TikZ: This is exactly how I want it to look. The following M(-ish)WE reproduces the diagram: \documentclass{article} ...
6
votes
0answers
68 views

Enlarge limits to nearest tick

I'm using pgfplots to auto-plot a number of datasets. The x-axis is in this case not to be enlarged. I'm using enlarge y limits, to get a clearer view of the data, but i would like it to scale to the ...
4
votes
2answers
112 views

Fill intersection between two parametric paths (e.g. circles) in pgfplots

I tried to use the fillbetween library of pgfplots to fill the intersection of two circles. However I get it with "inverted" colors: \documentclass{standalone} \usepackage{pgfplots} ...
2
votes
0answers
38 views

Misaligned text strings in pgfplots with view option set [closed]

Please see this post for more background. The problem is that tick mark labels explicitly specified by code of the form: text(x(k),y(k),labs{k},'horizontalalignment',horizk,... ...
1
vote
1answer
96 views

Make visible node text outside of pgfplot axes range

I'm using matlab2tikz in order to generate pgfplots .tex code to create a figure with pdflatex. The matlab function I'm using to create the figure creates each of it's tickmark labels explicitly, so ...
1
vote
1answer
42 views

Tikzexternal capturing crop marks when externalizing pgfplots?

Consider this MWE: % to rebuild: % rm test-testplot.pdf ; pdflatex -shell-escape test.tex \RequirePackage{filecontents} \begin{filecontents*}{testplot.tikz} \begin{tikzpicture} \begin{axis}[ ...