{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
1answer
194 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
62 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
45 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
34 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
995 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
54 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
52 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
245 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 ...
5
votes
2answers
268 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
117 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 ...
11
votes
1answer
191 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
232 views

Relative coordinates in pgfplots across multiple table plots

This is a follow up question to this one: Use pgfplots \addplot plot coordinates with relative coordinates Is it also possible to have the relative coordinates across multiple plots? For example if ...
3
votes
1answer
54 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 ...
3
votes
1answer
67 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
0answers
37 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} % ...
15
votes
1answer
595 views

XeLaTeX and TikZ - how do I ensure my PDFs are using the CMYK color model?

The place I want to print my document at needs the PDF to be provided in CMYK. The document is mostly text, except for a few graphs and plots which are done in TikZ or pgfplots. As suggested in this ...
0
votes
0answers
56 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 ...
2
votes
1answer
149 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 ...
13
votes
2answers
613 views

Naming the nodes of `nodes near coords` for later use

I would like to use pgfplots command nodes near coords to get a list of named node ((no1), (no2), (no3) etc.) that I can use afterwards to draw some paths that I fail to construct with pgfplots only. ...
2
votes
1answer
45 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
80 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
40 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 ...
5
votes
1answer
52 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
51 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 ...
0
votes
1answer
61 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 ...
6
votes
2answers
258 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 ...
5
votes
1answer
100 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
0answers
48 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
109 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 ...
2
votes
1answer
37 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 ...
1
vote
1answer
71 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
102 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
74 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 ...
2
votes
2answers
97 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 ...
6
votes
2answers
166 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 ...
5
votes
3answers
184 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
24 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... ...
10
votes
2answers
5k views

Positioning of Pgfplot axis labels

I'm trying to adjust the position of my axes labels and I'm having some trouble: \documentclass{article} \usepackage{float} \usepackage{pgfplots} \usepackage{graphicx} \begin{document} ...
3
votes
1answer
65 views

Error cross-referencing when tikz mode is graphics if exist

I am getting the error "Undefined control sequence" when using \tikzset{external/mode=graphics if exists} and the label does not exist (It should produce a warning not an error, though because the ...
2
votes
1answer
61 views

2 rows legend and alignment

I got a legend with two rows and I would like to have a different alignment on each row. Is it possible ? In my current code, the legend entries on the second line are much longer than ones on the ...
7
votes
2answers
90 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 ...
3
votes
2answers
79 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
38 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 ...
4
votes
3answers
150 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, ...
1
vote
0answers
68 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 ...
9
votes
2answers
269 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 ...
1
vote
1answer
37 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} ...
3
votes
2answers
62 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 ...
4
votes
1answer
89 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 ...