{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

1
vote
1answer
33 views

axis y line*=right does not move ylabel to right

When I recompile this code from the pgfplots gallery (example_291.tex), I get the following graph which clearly does not move the ylabel to the right for the second axis ...
0
votes
0answers
13 views

Change edge color of pgfplots patches

I am plotting patches and don't them to be colored according to their z-values. Instead, I want to define the colors by myself. Here is an example: \addplot3[area legend,patch,forget plot,patch ...
0
votes
1answer
58 views

How to place two bar charts beside each other

There are two tikz barcharts in this snippet. I'm able to display barcharts one after another but when i use subfigure/subfloat its giving an error \documentclass[preprint,12pt,3p]{elsarticle} ...
2
votes
3answers
90 views

Overlaying or nesting graphs in tikzpicture with different axis scales

I need overlay or nest a figure in a graph. I try with \pic, but the results aren't good for figure scale, according to graph scale. I try also to define the figure in nodes, to place it in the ...
0
votes
0answers
30 views

Unclutter a bar plot with pgfplot

I have the given bar plot with three hirachies (color + inner-group + outer-group): The figure look overloaded but I don't know how to split the x axis labels in a better way. A possible solution ...
8
votes
1answer
75 views

How can two bivariate normal distributions be plotted in one plot?

I would like to visualize the following two bivariate normal distributions: I found Jakes awesome answer and adjusted it so that the plots get rotated the correct way. Current plot Question ...
3
votes
1answer
55 views

convert gnuplot script to pgfplots using “raw gnuplot” option

I'm trying to rebuild a plot from "standalone" gnuplot with pgfplots using the raw gnuplot option. This is the gnuplot code which generates the desired graph: #!/usr/bin/env gnuplot set xlabel "Time ...
4
votes
1answer
39 views

pgfplots: symbolic coordinates with line skipping

I am trying to skip lines inside the symbolic X coordinates of the following pgfplots Bar Chart : \documentclass[a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{color} \usepackage{amsmath, ...
5
votes
1answer
36 views

How can I import matrix data (2d function) from matlab into pgfplots?

This question arised in Spectrum colormap for multiple curves, but since it is of general interest, I add a separate question and my answer here. Suppose you have a matlab figure which needs to be ...
2
votes
1answer
57 views

Plotting data from set of files in pgfplots

I have a large number of files containing xy-data that I would like to plot in one plot. I know I can do that manually and bit by bit which is ok for only several files, but not for larger numbers. ...
3
votes
1answer
33 views

How can I mark a point in a pgfplot and make sure its visible (on top of the plot)?

Recently, I have TikZ'ed the following image for Wikipedia (see file) I would like to mark the green dot like it was done here: I've tried a couple of different things, but no matter what I did ...
5
votes
0answers
67 views

TikZ/PGF 3.0 datavisualization vs pgfplots

To follow-up on a previous question TikZ datavisualization or pgfplots?, the current release of TikZ 3.0 has a flexible datavisualization engine that creates the same kind of plots as the more mature ...
2
votes
1answer
29 views

How can I place a node relative to a legend?

I'd like to place custom formatted nodes relative to the legend in a plot. The answer to Placing node relative to legend is a solution per se, but related to op's actual intent so it isn't helpful to ...
2
votes
0answers
39 views

Conversion of big “amount” of seconds into HH:MM:SS when plotting timeseries with pgfplots

My aim is to plot a timeseries (experimental data) using pgfplots in LaTeX (pdfLaTeX, TexLive on Mac). The data I'm using is seperated with semicolons (columnwise) and has the following structure: -- ...
5
votes
3answers
1k views

Incorrect plot using Pgfplots

I'm trying to plot a function with pgfplots for LaTeX. Unfortunately, pgfplots plots the function incorrectly. Here is the LaTeX code I use: \begin{figure}[H] \centering \begin{tikzpicture} ...
1
vote
1answer
38 views

Problem with documentclass memoir + pgfplots from data file

I'm using the documentclass memoir and I want to make a plot from a file.dat of two rows, nothing special. But I keep getting that pgfplots could not open the file. The point is that if I make a new ...
2
votes
0answers
104 views

Very fancy bar chart

Just wonder if this could be done with tikz? I know I should provide at least a MWE, but I am new to latex and have absolutely no idea where to start. MWE (Addition by HK) ...
4
votes
1answer
129 views

Spectrum colormap for multiple curves

I have been using matlab2tikz to generate a lot of my plots, but I am finding it struggling at this particular job so would like to inquire about how to do it properly in pgfplots / tikz. Essentially ...
5
votes
2answers
147 views

Filling an angle arc with a pattern

Consider an angle (on a plane) with the vertex O, the initial side (ray1) and the terminal side (ray2). Assume the measure of this angle is less than 360 degrees. (There are two such angles.) ...
1
vote
1answer
41 views

Overlapping ticks and figure not centered with matlab2tikz

See the printscreen. What I want is that the figure is centered, now that is not the case with using \setlength\figurewidth{1.0\textwidth}. Besides that the ticks with negative signs on the x-axis are ...
10
votes
3answers
168 views

Aligning tangents of graphs

I am drawing some graphs with tangents. I calculated the tangent should be centered at x=57/27 which is approximately x=2.11. I'm currently using the pos and sloped keys for nodes to draw tangents, ...
4
votes
1answer
133 views

TikZ nodes in pgfplots saved for later use, but locations mismatch

I really need a quick advice dealing with the answer given by sdaau. See this question. Actually I have a follow-up question regarding the given solution. This works actually pretty fine, but the ...
2
votes
0answers
28 views

create bar chart from select table row(s) for select column

The code below creates a bar chart but does not use the included data table. I would like to create the chart for an arbitrary year by specifying the year and using the table. Possible? ...
6
votes
2answers
111 views

Riemann sum with pgfplots — can't seem to make graph look right

I'm trying to reproduce something like this with the function x^-1, but no matter what options I try, I can't seem to make the graph look correct. This is my current code: ...
2
votes
0answers
26 views

Setting zmin/zmax in groupplot confuses colorbar creation (colorbar is 3d)

When using groupplots and setting zmin and/or zmax in the groupplot environment manually, pgfplots generates a (broken) 3d legend: I assume the issue is that groupplot passes the zmin/zmax settings ...
3
votes
3answers
150 views

Hatching a rectangle leads to solid line in beamer

I would like to indicate an inequality constraint using a hatched pattern. This is to be done in a pgfplot, that is itself part of a beamer frame. Here is an MWE: \documentclass{beamer} ...
2
votes
1answer
192 views

pgfplots: How to fix the number of yticks?

With max space between ticks= it is possible to set space between ticks, but I would like to setup the number of ticks, so all my graphs will look similar. I would be happy with 4 ticks, so if y vary ...
5
votes
1answer
64 views

`pgfmathresult` in a command

The following code doesn't work : \documentclass{standalone} \usepackage{pgfplots} \usetikzlibrary{positioning, calc} \newcommand\machin{ \pgfmathparse{1} \pgfmathresult } ...
7
votes
1answer
101 views

How to plot scatter points using pgfplots with color defined from table rgb values?

I am trying to plot a set of data points (scatter points not linked to each other), where each point has a different color. The color definition is given by predefined rgb values written in the same ...
12
votes
2answers
3k views

Using a pgfplots-style legend in a plain-old tikzpicture

I am using a plain-old tikzpicture to produce a pie-chart-like plot. Now, all other plots in my paper are handled using pgfplots (which doesn't do pie charts) and have their legend typeset by ...
5
votes
2answers
91 views

Use just a specific range of a colormap or shading in tikz

I'd like to create an image with tikz that uses just a part of a predefined colormap or shading. More precisley, if I have e.g. the jet-colormap I like to create several rectangles that use the ...
4
votes
1answer
56 views

How to draw a scatter chart with multiple columns of metadata+labels?

I want to print a scatter chart and color the nodes according to a column in the data file. The problem is, point meta already is used for other data. This is the class of the point, either ONE or ...
5
votes
2answers
2k views

How can I change format of number's axis on pgfplots

I want to change format of x or y number in green box of below graph .
4
votes
0answers
33 views

Specify legend entry as \addplot option?

Somehow, specifying the legend entry for each \addplot using the separate command \addlegendentry bothers me... I'm not sure why, probably because my sense of order says that the legend entry belongs ...
3
votes
1answer
94 views

Creating performance profiles

A performance profile is a kind of plot used in the optimization community; here below is an example from http://www.gamsworld.com/performance. For an introduction, see Section 22.4 of Higham and ...
3
votes
1answer
76 views

two variables foreach loop problem

I want to draw a pulse train on which I write some information like the corresponding angle, etc... But I think I've got a problem with the two variables foreach loop because I can't even compile ...
3
votes
0answers
97 views

pgfplots error using matlab2tikz

I am trying to plot a matlab figure in latex file. so i use this matlab2tikz function. It works really well, until I try to add some customised text on the figure before converting it to tikz file, ...
10
votes
2answers
2k views

tikz/pgfplots advanced z-order axis/grid

Is it possible to have both the axis on top and the grid on the very bottom (or somewhere in between some other planes/lines/...) of a plot? Example figure with axis on top=true but the grid on top ...
0
votes
1answer
193 views

Why do I get black areas instead of pattern fills when compiling with xelatex? [duplicate]

I want to draw this picture with TikZ. I've used the following code. But the outcome was not good (fig1). While the Fig 2 is the correct form. I do not know where is the problem? My texlive version ...
3
votes
0answers
54 views

normalizing graphs in pgfplots

Suppose you have multiple graphs in a pgfplot whose y ranges are [0 y1] [0 y2] etc, y1 < y2 < .... I want to divide all graphs by max(yi), so that the plot would be in the y range [0 1] (but ...
5
votes
1answer
2k views

How to put the values of each bar in a pgfplots bar chart inside the bar itself?

I have this: \begin{tikzpicture} \begin{axis}[ ybar = 0.6, width=1.2\textwidth, height=0.4\textheight, enlarge x limits = 0.2, bar width=16pt, title={Instance els19 with 1\% max error}, legend ...
1
vote
0answers
40 views

How can I horizontally align the bars of two barplots

I would like to align the clusters of the two barplots of the figure below. For instance, I would like that the cluster of "Program-2" on the second bar appeared just below the "Program-2" cluster ...
2
votes
0answers
32 views

Forcing graphic, table, plot .. out of page boundary

I am very new to latex, so this question might be very basic. However, I have been searching the whole evening, so either I don't know how to google this effectively, or what I am trying to do is not ...
5
votes
1answer
993 views

Pgfplot barplot with cluster of stackedbars

How can I create a pgfplot that have two stacked ybar for each "point in x axis" ? I wan't something like this: I already have a graph that have one stacked bar for each x point. Some hint on how ...
2
votes
1answer
50 views

pgfplots: How to remove all axis lines of polaraxis?

I need to draw a polar coordinate system without border lines. Adding axis lines=none (without star) to pgfplot's polaraxis argument list blanks out the coordinate system completely (including grid ...
2
votes
1answer
48 views

How can I make axis lines connected and make axis be over the plot?

I've just put a lot of effort in the following tikz image for Wikiepdia (see commons link): However, there are two small things that I can't get fixed: When you look at the bottom left corner ...
9
votes
5answers
224 views

How to get multiple plots of particular functions?

I'm trying to understand how I can get multiple plots from a set of functions to be plotted in the same window without the clutter; i.e., border, axes, grid, whatever... For example, say I want the ...
1
vote
1answer
121 views

PGF stacked bar graph not drawn correctly

I am having problem with the following code which is supposed to produce a simple stacked graph. \documentclass[tikz,border=2pt]{standalone} \usepackage{pgfplots} \usepackage{tikz} \begin{document} ...
5
votes
2answers
258 views

stacking negative value for ybar

I would like my ybars to be stacked the same way positively than negatively. It works for positive values but not for negative ones. On the given example, ThirdCol should be stacked negatively. Any ...
4
votes
2answers
96 views

Stacked bar plot with explicit axis domain

I have a data table which contains positive and negative values for different categories (columns) as input. I want to visualize these values by a stacked bar plot, which shows a stacked bar plot for ...