{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

2
votes
0answers
216 views

elsarticle with latest version of pgfplots [closed]

I want to submit a paper to Elsevier using it's elsarticle class. My document uses some commands from the latest version of pgfplots. However, Elsevier uses a TeXlive distrubution with pgfplots ...
4
votes
0answers
925 views

Matlab2tikz adds extra legend entries [closed]

The legend from a boxplot figure is not being created properly. I get this: Instead of thiS: But really only need 2 legend entries. Any Ideas why all the objects in this plot are being given ...
3
votes
1answer
761 views

How to draw the outlines of a patch in pgfplots?

In pgfplots the patch plot library allows to basically draw 3D bezier planes easily. This is very helpful if the exact mathematical form of a plane is not known or not important. What I have not ...
12
votes
1answer
3k views

3D line plot in pgfplots

I have the following problem with pgfplots and \addplot3. I have a graph in [0,1]x[0,1] that should display a mesh plot and a line plot that traces a particular line across the mesh. The line plot is ...
11
votes
1answer
2k views

How do I zoom a rectangle area in pgfplots adding a gray background even for the axis labels?

The background to this question is: I want to "zoom" into a certain area of a function and show it a little bigger. Furthermore, I want to put a gray rectangle as a background of the zoomed area, ...
8
votes
1answer
1k views

Tikz: \foreach and axis environment incompatibility

I'm trying to plot a figure with TikZ. I have a few .txt files with the coordinates of the curves that I want to plot, in a list such as file2.txt, file4.txt, ... file30.txt and I want to add ...
5
votes
2answers
455 views

new command, pfgkeys within pfgplots axis environment

I am trying to setup an command to create technical drawing dimensions (inspiration from Dimensioning of a technical drawing in TikZ). I would like to use pgfkeys for that, in order to pass multiple ...
7
votes
2answers
747 views

Dimension is too large error on changing my axis.

I successfully swapped my axis over earier and managed to get it scaled fine. I changed my mind and then changed it again so since then I've been spending hours trying to get this to work ...
5
votes
1answer
243 views

String annotations to scatter plot coming from a different file

I am trying to adapt the setup to be found in this question. to the case where the names are in a different file. The main motivation is to have the same names for several plots and to be able to ...
0
votes
1answer
235 views

Stacked chart in TeX (added up line loads)

I've got a problem with finding the correct way or commands to make a nice plot in TeX, even with some basic experience in pgf/TikZ. Imagine a weight distribution with start- and stop values and a ...
4
votes
0answers
843 views

How to correctly set a colorbar for an external graphic? [closed]

I created a pdf file from a Matlab imagesc plot. I have remove the colorbar and axis and now I want to have this image in my tex document. I manged to get the axes almost as I want them, but the ...
2
votes
0answers
46 views

How to I fix my axis to suit the correct order of magnitude? [duplicate]

Problem: It's the times ten to the 3 bit part which bothers me. Not just that is exists but also because it's positioned itself in a strange place. My files is formatted so it is in MHz so I don't ...
3
votes
0answers
747 views

standalone pgfplot with extra include in subdirectory -> no output [closed]

I am trying to generate a pgfplot with data in a textfile as a standalone document. I am using the 1.2 version of standalone from https://bitbucket.org/martin_scharrer/standalone/downloads because it ...
3
votes
1answer
284 views

Problem with snake ticks in pgfplots for bell shaped normal distribution

I want to draw two sided created region for normal distribution (see figure below). I have issue with snake ticks proper alignment and area looks suspicious to me. Am I missing something here? Any ...
2
votes
1answer
280 views

Create standalone pictures

I am trying to write a sample code to be used as a template to generate pictures that will be latter included in a paper. At this stage, the pictures are only plots. I have the following code. But it ...
9
votes
2answers
1k views

Fading of horizontal lines is impossible?

The path fading option in TikZ is obviously not working for horizontal lines. For plotting constant functions as well as for drawing a line between two points. Making them slightly tilted solves the ...
5
votes
1answer
3k views

External graphics and tikz externalize won't work together

I am using the tikz library external a lot and with success - so far. Now, I need to import an external file (eps, png, pdf... I don't care), and add the axes. I know I can do this with \addplot ...
2
votes
1answer
533 views

read strings from csv file for usage as figure meta data

I got the following problem, I use pgfplots(table) to generate plots and tables in my latex document from generated data. I would like to read additional information from a metadata file. The reason ...
12
votes
2answers
671 views

pgfplots: get color setting from table

I want to plot multiple lines using pgfplots. Each of the lines should have a color, depending on the group it belongs to. In the example attached, a table is provided, containing all the ...
3
votes
2answers
1k views

tikz plots alignment

I'm trying to produce a figure using \begin{figure} \centering \makebox[\columnwidth]{\input{try1.tikz}} \makebox[\columnwidth]{\input{try2.tikz}} \end{figure} The files try1.tikz and try2.tikz ...
11
votes
2answers
1k views

Background color in pgfplots that extends beyond the axis of the plot

I am interested in adding a background-color to my pgfplots plot that extends beyond the axis of the plot. See the image bellow for clarification; I am interested in adding a background color such as ...
5
votes
1answer
3k views

How to draw horizontal(row) legend without the surronding rectangle?

I found the following code to manually draw legend, but it produces vertical(column) legend. How to draw it horizontally? I don't want surrounding rectangle also. \documentclass{article} ...
9
votes
1answer
584 views

How to switch x- and y-axes?

Is there a simple way to switch the x- and y-axes, so that the x-axis becomes the vertical axis? \begin{tikzpicture} \begin{axis} \addplot+[domain=0:10]{1.2*0.000001*(0.2*(x*1000)^2 + 700*x*1000 + ...
4
votes
1answer
931 views

How to manually draw horizontal legend and place it correctly in tikz?

This is my tikz code to draw some plots. \documentclass{article} \usepackage{tikz,subfig} \begin{document} \begin{figure} \centering \subfloat[Iteration Domain for a Tile]{ ...
3
votes
2answers
1k views

How to ensure equal font sizes in all included TikZ/pgfplots figures?

I would like to have many tikzpictures in my document. Since each tikzpicture has its own size, I don't know how to manage the font size among all the pictures. Some of tikzpictures are of size ...
4
votes
1answer
6k views

pgfplot — label, referencing and caption

I've the following pgfplot: \begin{center} \begin{tikzpicture} \begin{axis}[ xlabel = Number of threads (\#), ylabel = Task completion time (seconds), ...
7
votes
1answer
3k views

Adjustable absolute axis labels in pgfplots

How can I use absolutely placed y labels, but still adjust the absolute placement? In the below example, I want to be able to get the two plots to align exactly, including the y labels. If I add ...
10
votes
1answer
9k 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
357 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
430 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
457 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 ...
7
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
284 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} ...
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
830 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)}; ...
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
500 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
837 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} ...
2
votes
1answer
261 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 ...