{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

5
votes
1answer
79 views

How to add arrows near the plot path and fill the area under this path?

I'd like to draw a closed plot path filled with pattern and surrounded by arrows: When I used @Jake's solution to add arrows (Decorate a path with little arrows parallel to it) then the pattern ...
7
votes
1answer
94 views

Macro for pgfplots/gnuplot exponential regression line

I am trying to create a series of plots with exponential regression that are automatically generated from comma/tab separated .csv files and pgfplots with help from gnuplot. When not using macros I ...
1
vote
2answers
119 views

make parametrised surface graphic with annotated features using Tikz or PGFplots

I'm looking to recreate that image for a LaTeX document. I am a novice at tikz and pgfplots. Please help!
5
votes
1answer
48 views

Creating different coordinates with the same macro

I am creating a 3d image using pgfplots. To specify certain coordinates, I created a macro \newcommand{\setpolarcoord}[4]{ % {Name}{r}{theta}{phi} \pgfmathsetmacro{\tx}{#2*sin(#3)*cos(#4)} ...
5
votes
1answer
83 views

Repeat geometry / body / object / shape in PGFplots

I depicted a pentahedron by means of the code \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset { plotOptsA/.style={surf,patch,patch type=triangle,shader=faceted interp}, ...
2
votes
1answer
46 views

Problems plotting histograms as a line graph?

I would like to plot some percentages as a line graph, so I tried this: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=2.12} \begin{document} \begin{tikzpicture} ...
2
votes
1answer
69 views

How to plot with TiKz the following performance?

I would like to plot some percentages as lines. So I tried the following: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.12} \begin{document} \begin{tikzpicture} ...
5
votes
2answers
123 views

Bar graph-PGFPlots

first sorry for my English. I wonder how to make a bar graph like figure. I tried with this code PGFPlots package, but is not good. Someone knows how to do this? \begin{tikzpicture} \begin{axis}[ ...
1
vote
0answers
32 views

Part of surface plot missing

I have created the following plot using pgfplots I'd like to remove the white patches (marked in red). Here's my code \begin{tikzpicture} \begin{axis}[grid = major, grid style={dotted}, ...
1
vote
1answer
37 views

How can I plot error bars on the first and last points in pgfplots?

I have a number of data series to plot with error bars, but since they might overlap in the middle, I'd like to show error bars for only the first and last points. All the data points will have the ...
2
votes
1answer
39 views

Apply same options to multiple `addplot` in pgfplots

Can I apply the same options to all addplot's in a single axis environment in pgfplots? For example: \begin{tikzpicture} \begin{axis} \addplot[%plot 1 color = red, ...
1
vote
1answer
107 views

Plotting a 2D slice of a 3D data set

I am plotting 3D data sets as surface plots, but sometimes I need to show a slice of the surface plot by restricting either the x-value or the y-value. I have provided a MWE, showing The surface ...
2
votes
2answers
44 views

How to make a legend entry image consist of line, pattern and markers in pgfplots

I'm trying to make the legend entry image look like a chunk from the "whole" of the following plot (so it has a line, pattern lines and marker). Is it really possible? I'm after an unsuccessful ...
2
votes
1answer
46 views

Point meta not working for for coordinates plot, example page 186 PGFplots manual Revision 1.12 (2015/01/31)

On page 186 of the PGFplots manual Revision 1.12 (2015/01/31) an example of the use of point meta is given: \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} ...
5
votes
1answer
52 views

Construct colormap for iso / level surface in PGFplots

I am trying to construct a plot of a surface in 3d of which the color of the surface is dependent on the z coordinate. The difficult part is that I need the color to vary 'discretely', not ...
1
vote
0answers
29 views

Pgfplots surface looks “wiry” [duplicate]

I've plotted a function from some values, given in the form: x,y,z -2.4,-2.4,0.00208966369454526 -2.3,-2.4,0.00245568047497186 -2.2,-2.4,0.00284901821144199 -2.1,-2.4,0.00326424484110634 ...
7
votes
1answer
78 views

How to make a figure showing growth of functions but with scaled y-axis in latex?

My problem is I would like to make a figure in LaTeX, which looks like the picture. It's important that the y-axis is scaled in a similar way as the picture. BTW I'm using Windows, MikTeX and ...
0
votes
0answers
47 views

pgfplots won't plot from CSV

I have a file called 'dat.csv' that contains data in the following format: x,y,z -2.4,-2.4,0.00208966369454526 -2.3,-2.4,0.00245568047497186 -2.2,-2.4,0.00284901821144199 ...
3
votes
1answer
96 views

Is it possible to choose the base line of the ycomb?

Is it possible to choose the base line of the ycomb (vertical lines)? For example, in log scale, the default base line is at y=1 (or y=10^0). But I would like to make it at y=0 (i.e. minus infinity). ...
3
votes
1answer
66 views

How to plot this histograms as a line graph?

Let's say I have this histogram plot: \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ symbolic x coords={a small bar,a medium bar,a large bar}, ...
6
votes
2answers
77 views

Help with plotting the following

Bellow is the following code that I currently have, I am just struggling to replicate the graph as accurately as I would like. The actual functions for the graphs are quite complex so i am just trying ...
3
votes
1answer
51 views

pgfplots + gnuplot: how to clean up the look of a contour plot generated from raw gnuplot data by using a colour bar?

Here's a MWE: \documentclass[12pt,letterpaper]{article} \usepackage{lmodern} \usepackage[T1]{fontenc} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.11} \begin{document} ...
5
votes
1answer
61 views

Erroneous depiction by use of `\draw` and `\fill` commands in PGFplots `axis` environment

I am trying to use table data to construct a patch surface plot. In doing so, I use pgf/tikz, pgfplots, pgfplotstable and the command \edef. My code: \documentclass{standalone} \usepackage{amsmath} ...
3
votes
0answers
23 views

pgfplots stacked bar plots with too little space for some “nodes near coords” [duplicate]

When creating stacked bar charts with pgfplots, how can I avoid printing those (and only those) "nodes near coords" if there is too little space? The following MWE illustrates the problem: ...
2
votes
1answer
42 views

Call to coordinate for creating a patch gives an error

I'm trying to construct a patch in pgfplots by means of table data. In attempting to do so, I also use the \coordinate command. Minimum working example: \documentclass{standalone} ...
4
votes
1answer
59 views

Disabling filling does not work with patches

I want to draw a triangular patch with no filling. Minimum working example: \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis} ...
1
vote
0answers
45 views

Importing PDF image with filled surfaces using graphicx [closed]

So I coded up a plot in pgfplots for inclusion in a document and it came out very nice. I've attached what it looks like below straight from the original pgfplots compilation. I generated the filled ...
1
vote
0answers
39 views

Glitches and other problems with pgfplots

I want to draw a rather smooth surface in a 3D graph with pgfplots. 1) It shows however, some glitches (spikes on the smooth surface), which I guess due to some numerical issues in the basic package. ...
2
votes
0answers
73 views

Tips for making a lightweight long document

I wonder what tips should we keep in mind to keep a long document lightweight. I've written 3 chapters from my thesis with ~30 figs and some math, and document size is exponentially increasing (10MB ...
5
votes
1answer
55 views

Use pgfplots to force linear regression through origin/zero

I'm using pgfplots to make a linear regression of some data. I know the curve should pass through zero (Hookes law). data.csv: F,delta 2.4525,0.6 4.905,1.05 7.3575,1.5 9.81,2.4 12.2625,2.5 ...
3
votes
2answers
74 views

! Dimension too large. for tikz

MY aim is to plot only a small part of a data set with tikz but I get the error message ! Dimension too large. <recently read> \pgf@xx when I try limit the plot area with xmin and xmax. Is there ...
1
vote
1answer
50 views

Hidden data in stacked bar plot

I am trying to reuse a stacked bar plot I created a few months ago that looked like this: The source code I'm pretty sure I used to create is was: \documentclass{article} ...
2
votes
1answer
44 views

pgfplots: figure too large

I have a problem with pgfplots and it took me a while to strip down my problem to the minimum. I try to add two lines and fill the area between them. The curves have points outside of the axis area. ...
0
votes
0answers
35 views

Scale y data in bar plots with pgfplots depending on x ticks

I have an issue dealing with data scaling. I consider two different kinds of information (i.e. orange and apple eaten daily) depending on three different people. Now I need to display the factor of ...
3
votes
1answer
75 views

Pgfplots rounded corners and plot problem

I noticed something strange recently when trying to use rounded corners in pgfplots: it totally ruins the plot. See below without rounded corners: and then with rounded corners: Here is a ...
2
votes
1answer
160 views

Color coded plots with colorbar in pgfplots

In matlab I can achieve this result using the structure of this minimal working example (in matlab): figure('color','white'); hold on xx=0:1; colors = parula(5); for i = 1:5 color = colors(i,:); ...
3
votes
1answer
52 views

Stack lines by absolulte Y-offsets in pgfplots

I need to shift several curves in a plot but in a way that is independent of the scale of the data. For example I need to shift each curve by a fifth or so of the scale of plot. Suppose one has to ...
0
votes
0answers
43 views

Reduce mesh size of data set for Surface pgfplot

I want to reduce the amount of sample points latex uses for creating a pgf surface plot. My data file currently has a mesh of (41x401) points. I am looking for a way to implement the (each nth ...
1
vote
0answers
35 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
106 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
29 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
83 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
64 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
97 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
93 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
116 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 ...