{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
0answers
24 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
26 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 ...
2
votes
0answers
37 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
26 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
41 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
41 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
35 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
25 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
47 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
151 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@ ...
3
votes
1answer
94 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
98 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 ...
3
votes
2answers
85 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
32 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
65 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
34 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
178 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
32 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
41 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} ...
0
votes
0answers
52 views

Displaying graphs of three functions so that their x-axes are aligned [on hold]

I am providing the code for graphing three trigonometric functions. (In the preamble, I had to put a % before the command \usetikzlibrary{calc,angles,quotes} because LaTeX could not compile it with ...
5
votes
1answer
91 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
55 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
35 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
32 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
93 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
61 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
82 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
69 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 ...
3
votes
1answer
38 views

Warning for TeX main capacity exceeded when loading files with \pgfplotstableread

I am loading quite a few data files via \pgfplotstableread, but do not further use them via pgfplots. I just kept them in the preamble and switched to plotting them in a standalone document. But now ...
6
votes
2answers
99 views

Interpolation and curve fitting - Tikzpicture? Gnuplot? Pgfplot?

well, I am fairly new to LaTeX, but I tried my hardest do find a solution for my problem but I couldn't find a proper answer, so I hope someone here has the answer or another suggestion for me. I ...
2
votes
2answers
69 views

Aligning ticklabels in secondary y-axis in pgfplot

I want to right align the ticklabels in secondary y-axiz in pgfplot. Here is my output and MWE. Thanks in advance for your help. \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat ...
3
votes
0answers
73 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, ...
5
votes
3answers
159 views

Parametric plot using pgfplots package

I want to make a parametric plot using pgfplot in LaTex. My equations are \rho= K (sinh t-t) P= 1/3 K (sinh t - 8 sinh (1/2) t +3t) with K=1\pi I have written the LaTex code for equations , now ...
2
votes
1answer
20 views

How to print in a node the \coordindex multiplied by a value?

I would like to print in a node the \coordindex multiplied by a value. Is it possible? now: node [ some code... ] {$\coordindex$} after (?) node [ some code... ...
3
votes
2answers
66 views

Polar plot with cartesian values, lack of angular precision in the integrated arctan2 calculation?

I noticed that for values close to 0° and 180° the angular values dramatically changes if the values are imported from cartesian data. Here the code (with cartesian coordinates plotted in polar with ...
4
votes
1answer
26 views

Line break in date ticks label

I want to plot some data depending on dates, but as the date range is quite large (4-5 years) I would like to have ticks in the form dd.mm\\yyyy, is it possible ? It would be even better not to repeat ...
7
votes
2answers
81 views

Using LaTeX commands inside pgfplotsset

Is there any way to use LaTeX commands inside \pgfplotsset? For instance, the following code produces an error indicated in the \pgfplotsset line, whereas if one replaced \contents in the ...
1
vote
0answers
58 views

pgfplots - plusminus doesn't match its definition

I've been trying to make a ybar plot with error bar using pgfplots. I want to make this graph inside a tex template, but one weird thing has occurred - when I inserted the following code (be more ...
6
votes
2answers
174 views

Graphing trigonometric functions, axes labeled with tick marks

I am providing the code for graphing three trigonometric functions. (In the preamble, I had to put a % before the command \usetikzlibrary{calc,angles,quotes} because LaTeX could not compile it with ...
3
votes
1answer
59 views

multiple colormaps

I would like to define multiple colormaps. But when I try this \pgfplotsset{ colormap={something}{ color(0cm)=(blue); color(1cm)=(orange!75!red) } colormap={somethingelse}{ color(0cm)=(white); ...
1
vote
1answer
33 views

How can I add the index of value of a table to a point on a graph?

I would like to add to each branch of my polar comb graph the index value as a label. I give you my code and a screenshot with what I would like to have: \documentclass{minimal} ...
4
votes
3answers
134 views

How can already binned data be plotted as a histogram?

I have the following data: [0, 1000) : 14524 [1000, 2000) : 38214 [2000, 3000) : 36169 [3000, 4000) : 25875 [4000, 5000) : 16942 [5000, 6000) : 10603 [6000, 7000) : 6778 [7000, 8000) : 4288 [8000, ...
3
votes
2answers
56 views

How to plot only some value of a table?

I want to plot only some values of an external tex value table, for example from the 3rd value to the 6th value. I could manually comment the non-wanted values but the table may often change and I ...
9
votes
2answers
250 views

Plotting a directed graph using pgfplots

I have a few files in the following format: x y 12 12 12 13 13 15 15 15 15 13 13 12 12 10 10 8 8 8 8 10 10 12 12 12 12 10 10 10 And I wanted to plot them as a directed graph in a ...
4
votes
1answer
30 views

zmin axis value for a 3d plot in TikZ

If I plot this the z axis does not start at 0 but somwhere negative. How do I fix this? \documentclass[border=2pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.9} \usepackage{tikz} ...
4
votes
1answer
79 views

How to add labels to polar plot / polar comb in polaraxis and show FULL coordinates?

In pgfplots, I am trying to: for a first figure: label 12 polar plots plotted on the bases of 12 tables (values given in cartesian coordinates) without showing a legend but adding a label directly ...
5
votes
1answer
47 views

pgfplotstable will not generate table

I have some data from a table that I would like to tableize with pgfplotstable. After many hours of going through the pgfplotstable 1.10 manual and basicly copying the example code with my data. Are ...
5
votes
1answer
64 views

PGFplots - label each group plots

In this group plot how do I add labels to individual graphs. I want to label each graph as (a), (b), (c)... \documentclass[margin=5mm]{standalone} \usepackage{pgfplots} ...
4
votes
2answers
104 views

Black Fill in my plot

I'm using the following code and when it compiles the result is not what i expect. \begin{figure}[h] \begin{tikzpicture} \begin{axis}[xbar,enlargelimits=0.15] \addplot [draw=blue,pattern=horizontal ...
8
votes
2answers
98 views

Gap between line and point in pgfplots, like pointintervalbox in gnuplot

I wondered if it is possible to create a scatter plot in pgfplots with a similar style as the "pointintervalbox" option in gnuplot, i.e. a plot with points and lines, but there is a gap between the ...