{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

0
votes
0answers
9 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 ...
5
votes
1answer
24 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 ...
3
votes
1answer
34 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, ...
4
votes
0answers
58 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
30 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
28 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
33 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
99 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
27 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
126 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
109 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
142 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
24 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
56 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
88 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
32 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
54 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
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 ...
7
votes
1answer
98 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
51 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
31 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
38 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
47 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
47 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} % ...
1
vote
1answer
30 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
52 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
173 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
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
1answer
118 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
95 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
36 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
71 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
191 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
37 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
44 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
94 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} ...
0
votes
1answer
57 views

How to do \flushleft and \flushright with tikzpictures

I have two charts, one is drawn with pgfplots, the other with pgf-pie. I want put these two chart in align horizontally, so one is on the left and the other is on the right. I have read Aligning using ...
0
votes
0answers
40 views

How to plot data with time in x-axis, but no date?

I have a set of data in below format, #time #value 01:10 2 02:15 3 02:20 7 ... The 'time' is given in HH:mm format. I want to plot the data with the time dimension on the x-axis. The ...
2
votes
1answer
34 views

Gap at origin when using axis lines*=left in conjunction with line width spec via axis line style

Please forgive the strange graph displayed here - I am simply trying to display a replicable chunk of code in the presence of all the packages I am attempting to use and want to avoid displaying data ...
2
votes
1answer
104 views

Cylindrical Bar Chart

I know this might be a long shot, but does anyone happen to know (or point me to where to start) how to draw this chart. Say we have 6 values (5, 10, 15, 20, 25, 30), one for each column. Thanks in ...
1
vote
1answer
63 views

Scaling pgfplot with tikzscale

I'm using tikz and pgfplots for graphs. When using a second y-axis on the right the scaling of tikz is not proper. So I tried to use the tikzscale package and the includegraphics but it seems to scale ...
6
votes
1answer
88 views

pgfplots: Using the fillbetween library

I want to use the fillbetween feature which is here decsribed by the pgfplots author Christian Feuersänger. In my case I have a coordinate list and want to fill the area between -10 and 10. But it ...
4
votes
1answer
72 views

how to set properly ymax and ytick

I'm trying a plot the left y-axis from 0.5 to 0.88 with 0.88 at the top border of the box (like the 160 at the 2nd y-axis). But even to get 0.88 I have to set ymax and (the last ytick) to 0.9 and ...