{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

4
votes
2answers
56 views

pgfplots + animate: Incorrect math mode symbols (unwanted verbatim)

Description I want to make an animated diagram. As soon I use the animate environment the stuff in math mode ($...$) is not displayed correctly (looks like verbatim text with _ ^ and so on). MWE ...
4
votes
0answers
68 views

A problem with pgfplots and coordinates

I'm using Jake's code in his answer to How can I automatically mark local extrema with pgfplots and scatter?. Using the mark max style I can retrieve the value for the y-coordinate of the maximum for ...
1
vote
1answer
44 views

plotting side by side two subfigures in a one figure in an llncs class file [duplicate]

I want to plot two figures in the same line. I'm also using the llncs Springer class file found here for my document. I have these two figures: \begin{figure} \begin{tikzpicture} \begin{axis}[ ...
5
votes
1answer
60 views

Plotting piecewise function using declare function

I am trying to plot a piecewise defined function, but somehow I don't manage to get it right. See below. I use the following code \begin{tikzpicture}[ declare function={ func(\x)=(\x >8/10) * ...
3
votes
1answer
95 views

pgfplots 3D bar chart - wrong plotting order

I am using bar3 to plot 3d diagrams in Matlab but it seems that in LaTeX the plotting order is wrong ? Is there any way to have the right order? This is a small example of the generated 2.tikz file ...
4
votes
1answer
105 views

Surface of revolution in pgfplots

I'm looking to make a plot for a latex report I'm writing. Effectively the plot is a paraboloid sat ontop of a circle but I'm having some issue creating the surface of revolution for the paraboloid. ...
2
votes
1answer
47 views

how to fill the color of a sphere with \addplot3

I need to fill a sphere with one color. I've read the documentation and there is fill=blue but in my case is not working. The below picture shows what I've got so far. \documentclass{standalone} ...
2
votes
1answer
43 views

How to fill area bounded by two curves using tikzpicture more complicated case

The following is the code I am using. Basically, I am trying to shade the area between the two curves and the lines $y=1$ and $y=2$. When I use fill between, how do i actually restrict this between ...
6
votes
1answer
119 views

How to increase legend lines lengths in PGFplots

I want to know how I can make PGFplots to draw longer segments in the legend. I looked at couple of previously asked questions and none seemed to work for me. In this question: "adjust the legend ...
6
votes
2answers
92 views

Three dimensional Regression Plan with Residuals

In R, I can make three dimensional Regression plane with residuals with the following command scatter3d(prestige ~ income + education, data=Duncan) with scatter3d function from car R package. I ...
4
votes
1answer
84 views

Shaded 3D ellipsoid with pgfplot

I'm trying to display a shaded 3D ellipsoid with axis labels with PGFplots. So far I achieved this. \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots,tikz-3dplot} \begin{document} ...
4
votes
3answers
115 views

How to fill area bounded by two curves using tikzpicture

I would like to ask a question on how to shaded the area between two curves. First of all the following is the code \documentclass[]{article} \usepackage[margin=0.5in]{geometry} ...
3
votes
1answer
40 views

Edge thickness of the faces in a surface plot

Is it possible to change the drawing thickness of the edges of the faces in a surface plot in PGFplots? For example, in the minimum working example \documentclass[margin=1cm]{standalone} ...
1
vote
1answer
120 views

Graphs/Charts in Latex

Being new to Latex, I'm finding it hard to draw graphs in latex. I wish to draw this graph. Can anyone please help me with the same? Here is the code I had been trying to use: \begin{tikzpicture} ...
5
votes
2answers
148 views

Plotting triangle on voronoi diagram, shading fractions of triangles with pgfplots/Tikz

Using this previously asked question I was able to plot Voronoi polygons from a set of generated data. I would like to annotate the plot further by doing the following: SOLVED BY MANIPULATING INPUT ...
2
votes
1answer
30 views

pgfplot, placing 3 graphs next to each other in one coordinate system with different headers

I want to create this graph: The graph is from a scientific paper which I want to quote in my master thesis. As it looks nicer if I create the graph myself than inserting it as a picture, I need ...
3
votes
2answers
35 views

Labelling only one point on a coordinate axis (pgfplots)

I want a grid on the whole plane like I have, but I don't want labels on the coordinate axes (other than at x/y=1) or the blank spaces that are seen in the MWE. How do I accomplish this? ...
2
votes
1answer
76 views

Two histograms with curve on top, using precomputed data (tikz)

How do I recreate something similar to the matlab figure (screenshot below)? My data is extremely numerous so I am unable to write a txt file for tikz to read in and make its own histogram. ...
5
votes
1answer
52 views

Underbrace in plot label using pgfplots

I'm trying to plot some data using pgfplots, I currently have this code \documentclass[12pt,article]{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} ...
5
votes
1answer
87 views

Increase contrast in a specific colormap range in pgfplots

I'm trying the replicate the following rendition of the Rosenbrock function in TikZ and pgfplots: https://commons.wikimedia.org/wiki/File:Rosenbrock_function.svg Here's my MWE: ...
5
votes
1answer
64 views

Depressed last plot in pgfplots

For some reason, the rightmost graph is slightly lower than the other graphs, but I don't know why. Code: \documentclass[12pt]{article} \usepackage{amsmath, amssymb} ...
2
votes
1answer
60 views

Draw sphere and add scattered data with color information [closed]

My goal is to plot 3D data (x,y,z coordinates) such that a certain path on/inside a unit ball is illustrated. Since the path will not only be on the surface of the unit ball I have to encode the norm ...
2
votes
1answer
32 views

pgfplots: How to adjust the width of the drawing area?

I want to produce plots that fit into the columns of a text document. My problem is that setting width=\linewidth seems to apply on the axis and labels only. When I put the legend outside it sticks ...
1
vote
1answer
46 views

Can PGF Plots do a histogram with variable bar widths?

So, I need to create a histogram in PGFPlots/LaTeX where source data has grouped x values and frequency, the desired output is a histogram with continuous x scale, frequency density on the y and bars ...
1
vote
1answer
29 views

! Dimension too large. in x-y plot

I am trying to do a simple x-y plot. However, I have no idea what I am doing, which result in the duplicates to be no helpful for me. I was based on this tutorial. Can you help please? ...
3
votes
0answers
36 views

Crop z-axis of PGFPlots

I try to implement the following image of the function 1/(x*y) I plotted using WolframAlpha using the PGFPlots package: The function is not defined if x=0 or y=0, so I split it up into four parts ...
1
vote
1answer
29 views

Insert a line break in the title of a groupplot plot

I've seen some posts that address this question for a caption, but most rely on using the caption package... I have a groupplot that produces the following output: Obviously I'd like to clean up ...
1
vote
1answer
31 views

Glitch in 3D surface plot using pgfplots not solved by z buffer

The solution from this question does not work for me. The function is (x+y)^A. If I plot it with A larger than one, the 3D graph is fine. However, the graph is horrible if A is lower than one. ...
2
votes
1answer
47 views

Custom colormap breaks colorbar: Cannot remove border and Mac Preview doesn't show colorbar

I have a custom colormap. And I have a plot with a colorbar. Without custom colormap: No border around the colorbar, as intended. Looks perfectly fine in Mac Preview. With custom colormap: Black ...
0
votes
0answers
28 views

Pgfplots colorbar labels have incorrect value

I have created a custom colormap and try to use it like in this example: Color coded plots with colorbar in pgfplots. I also fix my meta range with point meta min and point meta max. However, the ...
0
votes
1answer
37 views

How to only show legend in pgf plot?

I have created with matlab2tikz a standalone picture, saved in myfile.tikz Here is the code: % This file was created by matlab2tikz v0.5.0 running on MATLAB 8.4. %Copyright (c) 2008--2014, Nico ...
2
votes
0answers
22 views

Colorbar for lineplot using pgfplots [duplicate]

I am doing a lineplot with pgfplots. However, instead of the usual legend, I would prefer a colorbar, as I am basically trying to visualize a transition, and for that I chose colors in a gradient like ...
0
votes
1answer
16 views

Pgfplots, Gnuplot: Put all *.gnuplot and *.table in subfolder - Global setting

MWE: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.12} \pgfmathsetmacro\z{0.403713} \pgfmathsetmacro\w{343.386319715305} \begin{document} \begin{tikzpicture}[ gnuplot ...
1
vote
1answer
41 views

Bug: fillbetween with multiple plots

Using the pgfplots package fillbetween in two tikzpicture with the same name path gives different results. MWE: \documentclass[border=10pt]{standalone} \usepackage{pgfplots} ...
2
votes
1answer
29 views

Pgfplots error bars with different lengths in pos/neg

Is it possible to specify different error magnitudes for the pos/neg directions in a PGFplots plot? \addplot[error bars/.cd,y dir=both,y explicit] coordinates{ (1,0.0319)+-(0,0.0035) ...
5
votes
1answer
37 views

How to center align a single plot within a row of groupplot

I have an odd number of plots, 5, and would like to center align this fifth plot using groupplot as well as a group x-axis label. I have a 3x2 setup. I searched for answers and I've seen a case where ...
3
votes
1answer
62 views

Plot multiple histograms from csv file using pgfplot

I have the following data.csv file: subject,f1,f2,f3 F11,0.019,0.04165,0.00016547 F14,0.03034,0.02161,0.000267 M22,0.05128,0.0648,0.000327 M22_1,0.052,0.0328,0.000206 M23,0.0364,0.06355,0.000379 ...
1
vote
1answer
62 views

Fit 3D plot onto a shape

I want the 3D plot to be specified in terms of the coordinate system used to draw the rectangle. Right now, the 3D plot takes up way too much space and is off picture. I want it to be contained ...
1
vote
1answer
73 views

Draw a 2D functions in tikz

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] ...
1
vote
1answer
53 views

Date/Time in both axes with PGFPLOT

I am trying to plot some data that contains date/time values in both the x and y axis. I have been using the pgfplots and have managed to plot date/times on the x axis and on the y axis separately ...
2
votes
1answer
29 views

Markers of \usetikzlibrary{plotmarks} in nodes shifted compared to \addplot [duplicate]

MWE: \documentclass[]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.12} \usetikzlibrary{plotmarks} \begin{document} \begin{tikzpicture} \begin{axis} \addplot[mark=*] coordinates ...
3
votes
2answers
74 views

How to insert degree Celsius symbol in node text in pgfplots/tikz?

Here is my code. \resizebox{\textwidth}{!}{ \begin{tikzpicture} \selectcolormodel{gray} \begin{axis}[xlabel=Voltage,ylabel=Current,title=IV Characteristics of PV Module] \node[label={Set 1}] at (axis ...
3
votes
1answer
74 views

Funky (don't know how else to describe) Surface Plot

Below is an MWE \documentclass{article} \usepackage{pgfplots} \usepgfplotslibrary{groupplots} \usetikzlibrary{pgfplots.groupplots} \pgfplotsset{compat = 1.12} \begin{document} \centering ...
3
votes
1answer
40 views

pgfplots' fill between with wrong segment split

I want the last segment to be white, but it seems that the last segment is combined with the previous segment. \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} ...
2
votes
1answer
35 views

Missing Legend Entries in GroupPlot

I am constructing a groupplot with a common legend placed in a node under the plot. An MWE that recreates my problem is below. \documentclass{article} \usepackage{pgfplots} ...
2
votes
0answers
54 views

How to correct a PGFPLOT plot with minimal data that does not follow global options?

I have incomplete test data, as shown in the MWE. I would like to use all (few) available data points in the plot, ie (55.16, 0.08) for copper, but the plot does not take it into account. Also the ...
5
votes
1answer
38 views

pgfplots: Pointwise Positioning of Explicit Point Meta

I am drawing several diagrams like the following one: I would like to label the important points with $P_1$, $P_2$ and so on. The problem is that there is no global position for the nodes that fits ...
3
votes
0answers
46 views

trying to load images with foreach

Im trying to load images from a directory but I cant because I dont know why \i does not indicates the number, code searches the directory and the files were not found.. \documentclass{beamer} ...
2
votes
2answers
51 views

Tikzpicture: How to caption with multiple axis

Is there a way to caption multiple axes with tikzpicture? I don't want to use subfigures since each axis (and its corresponding figure) is connected via an arrow to another axis. I have something ...
1
vote
1answer
62 views

Vertical colorbar (in tikz) + subfigures (png)

I have an issue with the placement of a colorbar. The colorbar is defined separately in a tikz-environment, as suggested in this topic. My goal is to place one colorbar together with 4 png pictures ...