{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

12
votes
1answer
10k views

Grouped bar chart

I'm trying to construct a grouped bar chart and have three questions I can't seem to find the answer to: 1) How do I modify the spacings between the groups? Or at least make sure that no bars are ...
12
votes
1answer
3k views

How can I force the pgfplots coordinate system and the tikz coordinate system to match and why do they not match by default?

I plot a function with pgfplots and want to combine it with some simple \draw commands from tikz. But to my suprise the coordinate systems seem not to match. The rectangle drawn ranges from x=-10 up ...
2
votes
0answers
111 views

Bounding box calculation in groupplots suddenly fails? [closed]

Suddenly some graphs changed in my documents. I have not the slightest idea what changed but as of today the bounding box calculation for some plots created in pgfplots is going haywire. My MWE looks ...
2
votes
0answers
386 views

Multiple Labels on X coordinate when using symbolic coordinate [closed]

I am using pgfplots to plot bar charts; when I try to use symbolic labelling for the x coordinates, I get the labels repeating. Any ideas why, the snippet is below. \begin{figure}[!h] \centering \...
9
votes
0answers
431 views

Multiple axis discontinuities with pgfplots [duplicate]

I want to show narrow segments out of a large spectrum. Since it is one spectrum, I want to use one single plot, but hide the irrelevant parts. To make clear that I show disconnected parts, I want to ...
2
votes
1answer
501 views

How to generate a separate legend picture?

I want to generate a tikzpicture which only contains the legends, and not the plots themselves. I use the following code and it returns an error: ! Package pgfplots Error: Sorry, the supplied plot ...
6
votes
1answer
2k views

How to draw an additional line over an existing TikZ figure?

\documentclass[border=5mm] {standalone} \usepackage{pgfplots, pgfplotstable} \begin{document} \begin{tikzpicture} \pgfplotstableread{ % Read the data into a table macro Label First Second ...
8
votes
1answer
1k views

Problem in increasing the distance between labels in contour plot in a TikZ picture

I am having problem in increasing the distance between the labels in a contour plot in a TikZ picture. I tried a value from 10 to 10000 for the key contour/label distanc just to have only one label on ...
5
votes
1answer
292 views

Draw group line error

How draw group line works? I tryed to use this example, but when chaged the index it gives me an error: Undefined control sequence \end{axis} CODE: \documentclass[conference]{IEEEtran} \usepackage{...
2
votes
0answers
43 views

Increase the X length of a tikzpicture [duplicate]

This is the code that i'm using (Thanks to percusse in here): \documentclass[conference]{IEEEtran} \usepackage{lipsum} %<-- For dummy text \usepackage{pgfplots} \pgfplotsset{compat=1.7} \...
1
vote
1answer
859 views

Problem in modifying contour label style in pgfplots

I am trying to modify the contour label style in a TikZ picture. I would like to have the label values in the format 0.0 instead of being integers. The following code produces a picture in which ...
5
votes
1answer
1k views

Plotting functions with parameters from an external file using gnuplot/pgfplots/pgfplotstable

If I have a table, how can I get the table values and use them as parameters for plotting in pgfplots in gnuplot? In particular, how can multiple curves be plotted with the same functional form from ...
5
votes
1answer
1k views

Legend position & bad x ticks scale

I'm currently experimenting tikz-pgf, but facing some strong behaviour. How is it possible to have only 1 legend for a groupplot? Why is the scale 10^(-3) appearing below the first plot? Here is ...
7
votes
1answer
1k views

Axis ticks in radians in polar pgfplots

I am using the polar library with pgfplots to plot a graph like this: \begin{tikzpicture} \begin{polaraxis} \addplot[mark = none, domain = 0.4:12, samples = 600, data cs = polarrad]{sin(x)}; \end{...
3
votes
2answers
1k views

Problem in adjusting contour label color and numbr of samples in pgfplot

I am trying to create a contour plot using TikZ. I have two questions: How can I change the contour labels color to all black? Is it normal that gnuplot responds slow for creating smoother contour ...
9
votes
1answer
1k views

pgfplots - Provide a detailed plot inside the main plot

I have a main plot and inside it I would like to add a smaller plot that offers a higher level of detail. A rough illustration of the above is: Notice that the smaller plot provides a more ...
5
votes
1answer
525 views

PGFPLOTS coordinate filtering as a style?

I am using pgfplots to make plots for my thesis, and I have many scatter plots that I want to have consistent formatting. I am controlling the shape and color of the scatter plot marks with two ...
5
votes
2answers
853 views

Horizontal waterfall chart with labels for each bar

I've looked through similar questions here and here, but I'm still stuck. Basically what I'm trying to achieve is this plus bar labels: I have two problems: 1) My code sucks. Right now the y-axis ...
2
votes
1answer
1k views

Tikzpicture in a two column way using a one column .cls template

I'm using a .cls IEEEtran from IEEE available here http://www.ieee.org/conferences_events/conferences/publishing/templates.html; and all document is in two columns. I'm ploting using pgfplots a ...
1
vote
0answers
42 views

In pgfplots, font=\small throws undefined control sequence [duplicate]

I would like to reduce the label font size in a pgfplot. When I do x tick label style={rotate=90, anchor=east}, the file compiles, when I do x tick label style={font=\small,rotate=90, anchor=east}, ...
6
votes
0answers
78 views

Omitting a range when plotting with pgfplots [duplicate]

I have to plot data of the following format: year,value1 -10000000,10 0,10 1890,10 1900,50 1930,500 1970,1500 2000,4000 Using standard pgfplots I do this: \documentclass{article} \usepackage[utf8]{...
2
votes
1answer
278 views

Lines missing in the graph

The code \pgfplotsset{mystyle/.style={mark=none}} \begin{figure}[t!] \resizebox{.4\textwidth}{!}{\begin{tikzpicture} \begin{axis}[title=QWS Dataset, legend pos=outer north east, ...
4
votes
1answer
1k views

Naming 3D axes in pgfplots

I want to label the axes in a 3D plot with pgfplots. Using the anchors .right of origin and .above origin, I can label the axes as "x" and "y" in 2D with ease. In 3D, the labels must be tweaked to ...
5
votes
1answer
649 views

Axis label placement in 3d plot far out but why?

I want to plot a dataset in a 3D pgfplots graph. It looks like a good start but somehow the label placement is far out. Boiling it down to a MWE did not give me any hints how to get the labels back in ...
4
votes
1answer
1k views

How can I integrate matplotlib plots with pgfplots?

The python plotting library matplotlib will by default add margins to any plot that it generates. They can be reduced to a certain degree through some options of savefig(), namely bbox_inches='tight' ...
4
votes
0answers
115 views

Time plot with pgfplots [duplicate]

I tried to plot this type of data x y 00:00 99.42 00:15 99.44 00:30 99.41 00:45 99.37 01:00 99.00 01:15 99.29 01:30 99.51 01:45 99.58 02:00 99.49 02:15 99.50 02:...
8
votes
1answer
658 views

How to omit non-integer x-axis ticks in pgfplots?

The following figure has annoying x ticks at 0.5, 1.5 and 2.5. Non-integer values have no interpretation for my purpose. Question: How can I get pgfplots to exclude non-integer x-axis ticks? ...
17
votes
1answer
3k views

Plotting Normal distribution in pgfplots

I'm trying to reproduce the following diagram in TikZ and pgfplots. My MWE with regenerated graph is below: \documentclass{standalone} \usepackage{pgfplots} \begin{document} \...
6
votes
2answers
363 views

Automatically choosing preset color schemes in pgfplots based on number of entries

This is really more of a question to satisfy personal curiosity than to solve a real problem. When choosing the colour schemes for my plots, I try to select colours that will work well with the ...
1
vote
1answer
141 views

Does anyone know if the listed prerequisites for TikZ's pgfplots package are slightly off?

Does anyone (not to specifically ask Christian) know if the prerequisite PGF/TikZ version listed in the PGFPlots manual is off by a bit? I've been trying to use \tikzset{external/mode=list and make} ...
4
votes
2answers
2k views

Remove border around area legend rectangle

I have a legend with the option area legend to draw a little rectangle in the legend instead of a line segment. There is a border around the rectangle I would like to either remove or make the same ...
4
votes
1answer
322 views

Use of rnd in pgfplots

The following code fails to compile due to the use of rnd: \documentclass{article} \usepackage{tikz,pgfplots} \pgfplotsset{width=7cm,compat=1.3} \begin{document} \begin{tikzpicture} \begin{axis} \...
6
votes
1answer
2k views

Undefined control sequence: \pgfplots@data@xmin

I am trying to use Jake's excellent Tufte y bar chart style but I am getting an ! Undefined control sequence. <argument> {rel axis cs:0,0}-|{axis cs:\pgfplots ...
4
votes
1answer
901 views

Align plots in pgfplots

Can somebody help me? I try to align two plots horizontally in pgfplots! In the preamble I have: MWE* \documentclass[12pt]{article} \usepackage{pgfplots,subcaption} \pgfplotsset{ compat=1.7, ...
14
votes
1answer
2k views

How to plot circular polarized electromagnetic wave

I am searching for a solution to get nice looking circular polarized waves in my latex document. My goal is to get a graph that looks like this: I do not want the graph to be animated but I can not ...
2
votes
1answer
332 views

ytick pgfplot issue

I have the following latex code but unfortunately cannot get the ytick to be of my choice. \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{center} \begin{...
10
votes
1answer
5k views

Specific error bars in pgfplots possible?

For plots with a lot of points it often looks very crowded if each point has its own error bar. Is there an easy way to only draw certain error bars in pgfplots? I could not find any option besides ...
9
votes
1answer
6k views

change color of pgfplot bar plot

I want to plot two bar plots next to each other. This works without a problem. However both use the first color defined in a pre or selfdefined colorseries. I tried to modify the color manually in the ...
6
votes
1answer
3k views

How to align PGFplot subplots

I am using the matlab2tikz MATLAB function to export a MATLAB figure with subplots to tikz code. Unfortunately the subplots do not align properly. The post PGFplot to occupy full \linewidth, and ...
1
vote
0answers
512 views

change color of nodes in pgfplots bar plot [closed]

I have a bar plot which print the number next to the bar. The text is however not very well readable due to the color applied to it. Therefore I would like to know how to modify its style. \...
13
votes
1answer
2k views

Creating Bezier surfaces using procedural graphics

Are there any package for LaTeX that can create Bezier surfaces? I mean a actual existing function that takes matrices as arguments and generates the surface, not a function written by myself.
5
votes
1answer
2k views

How to increase/fit the width of x-axis to fit all points in pgfplots?

This is my code: \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[scale only axis, symbolic x coords={v1,v3,v4,v7,v8,v9,v10,v11,v15,v16,v17,v18,...
8
votes
2answers
4k views

Easy creation of logarithmic grid with TikZ

Is it possible to create a logarithmic grid using the command below with TikZ? \draw (-0.1,-0.1) grid (4.1,4.1); It would be great to be able to create a logarithmic grid without having to specify ...
7
votes
1answer
414 views

Problem of superimpose and how to change legend symbol

Given the plot as follows I have two problems: a and b are superimposed on each other, how should I make this clear on the graph? How could I change legend c to other icons like star? (It looks a ...
7
votes
1answer
2k views

Multiple different meta for marker color and marker size

How do I set the color of a marker with one meta column in a table AND its size with another meta column? So in this minimal working example, how can I set the marker size with 'w1' and the color ...
9
votes
3answers
560 views

How to draw two intersecting graphs?

I want to make the following figure. My efforts are: \documentclass{standalone} \usepackage{pgfplots} \usetikzlibrary{calc,shadings} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} ...
1
vote
0answers
215 views

How to bring beauty to this pgfplot? [closed]

We are making a plot as follows: \documentclass{standalone} \usepackage{pgfplots} \usetikzlibrary{calc,shadings} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \def\xmin{0} ...
4
votes
1answer
2k views

pgfplots - Number above one of the bars in the bar chart

I want to put a number above only one of the bars in the bar chart. For example, above the bar A, I want to put a number say 200. Other bars will not have any number at the top. This is my code. \...
3
votes
1answer
442 views

problems with pgfplots/ymax

I have two figures that I'd like to connect; both are generated with pgfplots (and in this example, gnuplot). The following works exactly as expected: \documentclass{beamer} \usepackage{graphicx} \...
10
votes
1answer
238 views

Is there an easy way to change the column order of a pgfplotstable?

I am aware of Rearrange data in pgfplotstable but I was hoping for a kind of one-pass solution that doesn't spread the table over so many commands but is rather self-contained within \...