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

PGFPLOTs bar chart with zero data ymin=0 not respected

I have simple bar chart. With zero values in \begin{tikzpicture} \begin{axis}[ ybar, axis lines*=left, ymajorgrids, bar width=0.26cm, width=0.45\textwidth, ymin=0, y tick label ...
2
votes
1answer
31 views

Why are my marks not drawn?

I'm somewhat stumped by the following simple plot at the moment. I expected three black marks to be drawn. Instead, I see no points being drawn (only the axes). This is based on old code, so I'm ...
2
votes
1answer
67 views

Linear Regression with symbolic x-coordinates

I have been having difficulty with this problem for a few days now so I'm hoping you can come to my aid. I am trying to create a line of linear regression for a very small chart using pgfplots. ...
3
votes
1answer
38 views

pfgplots plot in degrees

Everywhere on the web, and in this forum, tells me pfgplot plots trig functions in degrees, which is what I'm after. Here is the code for my graph: \begin{figure}[H] \centering ...
3
votes
1answer
35 views

adding single points to bar figure in pgfplots

I have a bar plot, in which I would like to add some single points overlayed on the bars. Those points are in another scale compared to the error bars. Below, I'm illustrating those single points in ...
1
vote
1answer
31 views

Issue in plotting a grouped bar chart

I was getting the X-axis labels to be printed without spaces. There is an issue with legends, it is in the way of the delay values How do I keep the values horizontally and enlarge them for better ...
2
votes
1answer
34 views

Reason for multiple bars in Legend entries

I am have a similar Grouped Bar Chart as shown in this question and wish to know why there are multiple bars in the legend entry. Is it possible to modify the legend so as to consolidate these bars? ...
13
votes
1answer
160 views

Non-slanted (siunitx style) unit prefixes with pgfplots

I've taken the example from the pgfplots manual on Preset SI prefixes and modified it slightly, changing a prefix from milli to micro. The result is that the units of the yaxis are stated as ...
3
votes
1answer
112 views

Convert image to code (TikZ? PSTricks?)

I have a ... pdf file, which contains figures of plots such as the following: Now the second plot isn't too hard to draw on TikZ (I assume... I hope? I don't have any experience apart from ...
3
votes
1answer
63 views

tikz, pgfplots and polaraxis

I found a nice template for a polar graph 1 and I adjusted it as follows: \documentclass[12pt]{standalone} \usepackage[x11names]{xcolor} \usepackage{tikz} \usepackage{pgfplots} \begin{document} ...
4
votes
1answer
123 views

Build a histogram with the option hist={bins=7} in pgfplots

The data values fall into the range [800,3200] which is partitioned into 7 intervals of equal lengths (300). Also, I would not want the y axis but only the grid. There should also be a legend to ...
5
votes
1answer
76 views

About the actual meaning of \pgfplotsunitxlength macro from the pgfplots package

From the pgfplots manual (sec. 8.4): \pgfplotsunitxlength,\pgfplotsunitylength,\pgfplotsunitzlength,... Macros which expand to the vector length ||xi|| of the respective unit vector xi... ...
1
vote
0answers
30 views

Zero space between bars of the same interval in pgfplots ybar interval plots

I need a bar plot (containing multiple \addplot) with following requirements: ticks between x labels (and, in this respect, my question differs from Adjusting width of ybar interval separator to ...
2
votes
2answers
48 views

Print comma instead of period in node near coord

I need to print the Y-values for each point with a comma for decimal seperator. See my MWE. The data is provided as a .csv within my folder. \documentclass{standalone} ...
2
votes
3answers
159 views

Wrong placement (and/or size) of picture / plot with groupplot of table (… and discontinuity)?

Consider this MWE: \documentclass{article} % \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.5.1} \usetikzlibrary{pgfplots.groupplots} \usepackage{pgfplotstable} ...
0
votes
0answers
43 views

Tikz/pgfplots problem: change x-axis counting at certain x-coordinate

In order to create a particular diagramm, I need the possibility to change the x-axis-counting at a certain x-coordinate so that x runs from 0-10 in steps by 1 and then changes at 10 put in further ...
2
votes
0answers
45 views

What are the minimum requirements to create a “standalone” installer for pgfplots?

I prefer to use pgfplots for my plotting needs, but I tend to use LaTeX for my documents as well, so I have the full TeX Live installed. I'd like to convince my friends/lab mates/colleagues to use ...
1
vote
0answers
48 views

pgfplots: Distributing random points on surface

I want to distribute some random points on a surface. My working example looks like this: \documentclass[border=2pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.9} \usepackage{tikz} ...
3
votes
1answer
84 views

pgfplot: centering the axis above the caption without trimming axes

is there a stable way to center the axis (without the axis label) above a figure caption without trimming the axis with \begin{tikzpicture}[trim axis left, trim axis right] ? Trimming the axis ...
4
votes
1answer
76 views

Box plot with pgfplots package

I did my first box with pgfplots package. I have several questions : How to write numbers without commas with a thousands separator ? How to have a larger distance between the box and the x axis ? ...
1
vote
1answer
56 views

4 x-axis with pgfplots

I'd like to put 4 x-axis on a same plot, with different scale. y-axis will be the same. I'd try to put several \begin{axis} ... \end{axis}, but they appeared on the same location. Here, I tryed to ...
8
votes
8answers
635 views

Drawing minimal xy axis

can anybody help me to draw this minimal example of an xy axis? I couldn't find anything similar on the forum. The axis should be black but the grid behind it a shade o gray, dashed. It would be ...
2
votes
1answer
15 views

Conditional \addlegendentry

How can I add legend entries dependent on some variable? At least it does not work in the minimal example below. \documentclass{standalone} \usepackage{tikz,pgfplots} \begin{document} ...
4
votes
1answer
81 views

tikz not drawing the correct function

In an attempt to make a graphic of Gay-Lussacs Law, I made this graphic. I've managed to draw the measure points, but the function corresponding with it (which I did with my TI-nspire) is not drawing ...
5
votes
1answer
141 views

How do I get a pfgplot figure to take up the whole page?

So, I'm making figures using pgfplots and I have a problem: They don't centre on the page well. I'd rather stick to article for ease of printing and so I can have multiple figure in the same document ...
4
votes
1answer
54 views

pgfplots, TikZ interoperability and axis equal

Sec. 4.27 of the pgfplots manual explains how to match pgfplots and TikZ unit vectors and origins. It suggests: Configure matching unit vectors by means of the x and y keys. The default ...
3
votes
0answers
26 views

Parsing CSV with comma as decimal separator in pgfplots [duplicate]

How can I plot data from CSV file when comma is separator of decimal part? Part of my CSV file: U f(U) 0 6,12323399573677E-016 0,1257 1,2536924115 0,2514 2,4876019375 I've tried this trick but it ...
0
votes
1answer
40 views

General understanding \addplot3 pgfplots

If I type into wolframalpha.com "3dplot (x+sin(x))^2" I get . When I use pgfplots and do this: \addplot3[ surf, opacity=0.8, samples=50, samples y=30, colormap/whitered, domain=-1:1,y domain=-1:1, z ...
2
votes
2answers
45 views

Change legend color in multiple y-axis plot in pgfplots

I have a plot in pgfplots with two y axis, and two curves for each axis. For each y-axis, the first curve correspond to a given method, and the second one to another method. Hence, the two curves ...
9
votes
2answers
886 views

Pgfplots - ugly marks when using dotted or dashed line [duplicate]

Recently I spotted that applying the option dashed or dotted to a plot results in having ugly / distorted marks or marks with dots (when applying dotted) around them. Here is a MWE: ...
9
votes
1answer
8k views

Different marker shape for pgf/TikZ

I have a figure in my paper which compared 6 different cases. The figure needs to be in black and white. In below is the code I used to create the figure. \documentclass{standalone} ...
2
votes
1answer
167 views

Tikz for generating pdfs and using in latex, compiling problems

I tried using the advices online for implementing tikz into the texmaker and Miktex combiantion. The Miktex is updated and the texmaker runs normally. The tikz version from a flow example runs ...
0
votes
1answer
30 views

legend over the plots

I don't want to have the legend over the plot as shown in Figure. I want it inside the figure box but not over the plot. Also, the number format of y-axis, i want to have it 0.001, 0.002, etc. The ...
1
vote
2answers
46 views

Applying log on a column read from file

I'm trying to plot some data from a file and I want to apply the natural log on the values from one column. MWE: \documentclass[a4paper,12pt]{standalone} \usepackage{pgfplots} ...
3
votes
0answers
51 views

Uniformly spaced line markers

I'm reading line data from file and plotting it. By default, the curve has markers, where are the original data points. The data points are very uneven, but I would like to have evenly distributed ...
3
votes
2answers
68 views

Changing the arrow heads in pgfplots axis lines

Consider the following: \documentclass{article} \usepackage{tikz,pgfplots} \usetikzlibrary{arrows.meta} \tikzset{>={Latex[round]}} \begin{document} \begin{tikzpicture} \begin{axis}[inner ...
0
votes
0answers
47 views

Resize tikzpicture without change \node position

I'm using tikzpicture to create some graphs. But I have a problem, when I change graph size for better position on text, all \node goes to wrong position. Here is my code. This are my .dat. ...
0
votes
0answers
41 views

Help to change important parts of figure [on hold]

I am very sorry, again to present my question, but for me its very important -this graph is important part of my dissertation. Can you help to parallel correlation of two Y axis-that mean I want my ...
0
votes
1answer
32 views

Caption/Space problem in tikz/pgf/subcaptionbox

I plot 4 Graphs with Tikz and use subcaptionbox. Following badnesses occur: (1) There is no space between the caption of the upper figure to the figure below. (2) The second figures (b) caption ...
0
votes
1answer
99 views

Varying Error Bar Length In Timeplot Graph

I have a quick question about the Error Bars functionality in LaTeX, specifically - I am using pgfplots and tikzpicture packages. I was wondering if it is possible to vary the length of the Error bar ...
3
votes
1answer
72 views

Problematic rendering of mark=+ in pgfplots

Consider the following MWE: \documentclass{article} \usepackage{pgfplots} \usepackage{tikz} \pgfplotsset{compat=1.5.1} \xdef\doPlotCoords{} \foreach \r in {0,1,...,10}{% \xdef\tempCoords{} % ...
2
votes
1answer
37 views

aligning plots in pgf plots and a couple other associated questions

I am fumbling my way through pgfplots. I have 3 plots on a page. I have a few issues: The bars in the plots are floating above the axes to various degrees. How do I anchor the bars down to the axis? ...
6
votes
1answer
78 views

Enlarge distance between bars

I want to create a bar chart. The bins are extremely close to each other, how can I increase the distance between the bars to let the labels on top of it stand a bit free and don't overlap anymore. ...
5
votes
1answer
63 views

TikZ + PGF function Plotting: Is there a max(a,b) function?

I am trying to plot a function with TikZ and PGF. This function contains a max operator (returning the greater value of the given two parameters). I want to do the following: \documentclass[ ...
6
votes
1answer
60 views

Restrict x domain to several regions

I want to plot a graph and show only the low x-positions and the high x-positions. Right now I use two times \addplot with restrict x domain to achieve this: \documentclass{standalone} ...
4
votes
1answer
65 views

To fill legend mark in graph

How to fill mark, such as zebra: same in my uplod picture which draw. Thanks \documentclass[border=5mm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usepackage{etoolbox} ...
3
votes
1answer
65 views

Parallel correlation of two Y axis

Can you help to parallel correlation of two Y axis-that mean I want my third Y axis 0 number begin parallel to second axis number 3. Yes, I know may be I explan in bad english, because I draw picture ...
2
votes
0answers
55 views

Grouping bins in bar charts?

I have below bar-chart. I want to group the bars together by color. It makes no sense to compare the bins directly, but only the values with the same color directly. Is there a way to create two ...
6
votes
3answers
1k views

How to draw legend lines in caption/text without including original plot's TikZ picture?

I would like to reference some plot lines in text/captions. It is possible by defining a label for the plot in the corresponding axis environment. However, I'm using externalization and only want to ...
1
vote
1answer
72 views

How to change x-axis label position only horizontally keeping the default vertical value using pgfplots

I have two plots of different width next to each other. I want them to share one x-axis label. For this I take the x-axis label of the left plot and shift it to the right so that it is perfectly ...