{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

3
votes
1answer
48 views

TikZpicture/pgfplots: How to insert time-data in mm:ss-format (without hh:) into x-axis?

Imagine an ordinary x/y-diagram by using the pgfplots/tikzpicture-packages: In case of regular date-values (dd-mm-yyyy) usually there is no problem in application. But now, I have to add times-values ...
1
vote
0answers
48 views

Temporarily disable Tikz shadow in pgfplots

I am using Tikz to create nice margin notes, like Gonzalo's answer to create a framed environment for a margin note I added a shadow to these notes with `drop shadow =' followed by a color. It works ...
2
votes
1answer
29 views

Using a text inside a math environment in a pgfplots label

How is it possible to have a \text{} field inside of a math environment of a pgfplots label. A minimum not working example is displayed below: \begin{tikzpicture} ...
2
votes
1answer
42 views

Drawing a square that respects layers pgfplots

I have a pgfplots code that generates a paraboloid on top of a circle; \documentclass[a4paper,10pt]{article} \usepackage[utf8]{inputenc} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} ...
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 ...
1
vote
1answer
33 views

Label positioning in pgfplots

I am using lualatex and I am having trouble positioning the labels of a grouplot at the bottom of the plots. Here is my code % !Mode:: "TeX:UTF-8" \documentclass[a4paper,12pt]{book} ...
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. ...
1
vote
1answer
74 views

pgfplots with list and make fails on windows (mingw)

System specs: MiKTeX 2.9, Windows 8.1, -shell-escape added, MinGW installed. MWE: \documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{lmodern} ...
5
votes
1answer
83 views

How can I use trigonometric functions and tick labels with pgfplots?

\begin{tikzpicture} \begin{axis}[ axis lines=middle, samples=100, ymax=5,legend pos=north east, legend style={draw=none} ] \addplot[forget plot,cyan,domain=0.001:8] {abs(log10(x))}; ...
2
votes
1answer
28 views

Scaled tick option not working

I'm trying to plot some time series data using pgfplots. I do not want any "tick scaling" (i.e. scientific notation for my axis). I have tried the scaled ticksand scaled y ticks options, setting them ...
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}[ ...
6
votes
2answers
93 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 ...
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
98 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 ...
8
votes
1answer
427 views

Specify x and y in different coordinate systems in pgfplots similar to gnuplot

In gnuplot you can specify positions in several coordinate systems: First, Second, Graph, Screen, Character. What are the equivalents in pgfplots? I know the following: First : axis cs: Second : ...
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} ...
0
votes
1answer
103 views

Pgfplots: pass to raw gnuplot string unitless plot width and height

MWE: \documentclass{standalone} \usepackage{pgfplots} \usepgfplotslibrary{groupplots} \begin{document} \begin{tikzpicture} \begin{groupplot}[ group style={ group size=1 by 4, vertical ...
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 ...
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
44 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 ...
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} ...
6
votes
2answers
1k views

matlab2tikz imagesc TikZ/pgfplots equivalent

I'm using matlab2tikz to export imagesc figures into TikZ/pgfplots code. This process gives me a TikZ file and a rasterized png version of the image with colours matching the colourbar at the time of ...
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} ...
2
votes
2answers
1k views

y minor ticks not showing with pgfplots

I want some minor ticks on the y axis, but it doesn't work. I already tried minor y ticks num but it didn't help. Thank you in advance. \documentclass[11pt,a4paper,oneside ]{article} ...
6
votes
1answer
415 views

Draw reduced graph with pgfplot

I want to reduce the information contained in a graph to the minimum. I started with a spectrum that I drew from a data file ( http://www.sendspace.com/file/wwydju ). \documentclass{standalone} ...
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 ...
7
votes
1answer
3k views

grouped bar chart with pgfplots

I am trying to create a grouped bar chart with pgfplots, like this one: but I can't put the values over the bars, like this one: My code is: \documentclass{article} \usepackage{pgfplots} ...
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: ...
3
votes
2answers
36 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
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
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
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} ...
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 ...
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
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
30 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 ...
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 ...
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. ...
0
votes
0answers
29 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 ...
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
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 ...
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 ...
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) ...
8
votes
3answers
3k views

pgfplots with symbolic x coords and error bars

I am trying to plot explicit error bars like this: \begin{tikzpicture} \begin{axis} [symbolic x coords={Lighting,Computers,Total}] \addplot+[only marks] plot[error bars/.cd, y dir=both, y explicit] ...