{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
23 views

Axis rotation and alignment

I have a problem to rotate an axis. Here is the code I use where the problem occurs : the two axis origins are not aligned. \documentclass[a4paper,11pt,twoside]{article} \usepackage[pdftex, active, ...
1
vote
1answer
38 views

pgfplots: two y-axis with three plots and one legend

After googling about my problem, I came up with this two year old question here on TeX.SX. I adopted the example from there having two plots in the first axis-environment and one plot in the second ...
1
vote
2answers
41 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 ...
5
votes
1answer
75 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 ...
0
votes
1answer
77 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
96 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 ...
8
votes
1answer
76 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
58 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 ...
6
votes
1answer
41 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 ...
4
votes
1answer
40 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
0answers
72 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 ...
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 ...
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
41 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: -- ...
2
votes
0answers
106 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) ...
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 ...
2
votes
0answers
31 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? ...
4
votes
1answer
131 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 ...
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: ...
5
votes
2answers
148 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.) ...
2
votes
0answers
27 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
58 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. ...
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 } ...
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, ...
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
0answers
34 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 ...
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 ...
3
votes
1answer
95 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 ...
7
votes
1answer
104 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 ...
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 ...
2
votes
0answers
33 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 ...
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 ...
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
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 ...
1
vote
0answers
36 views

Fourier transform visualization in 3D [duplicate]

I want to plot this (based on this image from Wikipedia): As far I get this: \documentclass[tikz,border={20pt}]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.10} % ...
2
votes
1answer
40 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
54 views

Second iteration - Is there a way to clear paths previously defined with name path global in TikZ

In realtion to this pretty old question (back 3 years from now) Is there a way to clear paths previously defined with name path global in TikZ? I would like to know, whether there is actually a nice ...
11
votes
1answer
175 views

Why does \mathbb{R} cause '! Undefined control sequence. - \GenericError'?

When I compile the following document, I get ! Undefined control sequence. \GenericError ... #4 \errhelp \@err@ ...
4
votes
1answer
135 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
1answer
125 views

Matplotlib's PGF vs Matplotlib2Tikz

I want to generate some plots to be integrated into a LaTeX document compiled with pdflatex. I also want the plot font (legend, title ...) to follow the settings of the LaTeX document. My search so ...
4
votes
2answers
97 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 ...
2
votes
1answer
37 views

x tick label style issue, anchor=east and text width command not working together

I have a figure where one of my labels is very long. I would like this label to be split to two rows. Currently my code is like this \documentclass{article} \usepackage{pgfplots} ...
4
votes
1answer
73 views

3d plot of a surface with nonrectangular domain

I need to make a 3D plot of a step function For example, suppose that I want to plot the function f:[0,1]x[0,1]->[0,1] given by: f(x,y) = 1 if x < y^2 and f(x,y) = 0 otherwise I would like to ...
3
votes
1answer
37 views

How to remove small value labels from ybar chart?

I can't figure out a way to prevent small values showing in my labels. A problem that looked very similar to mine can be found in here. Due to my non-existent coding skills I couldn't figure out this ...
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 ...
0
votes
0answers
39 views

Matlab2tikz, alignment of subplot ylabel (large distance from plot)

Matlab2tikz came to my attention in the past month and have been using the simple tutorial from HowToTeX. It has worked great so far only one issue remains, I am unable to anchor the ylabel to the ...
5
votes
1answer
45 views

How to make part of x-axis normal scale and other logarithmic scale in pgfplots?

I'm trying to make such graph (made in Origin), using PGFplots: But I do not know hot to make x-axis correctly. This is my MWE: \documentclass[tikz,12pt]{standalone} \usepackage[T1]{fontenc} ...
5
votes
1answer
95 views

Spherical Rectangle with TikZ / PGF Plots

How would you do a spherical rectangle? I know that for a sphere you do this: \documentclass[border=2pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.9} \usepackage{tikz} ...