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

How to add one single legend entry for several plots?

How can I create a single legend entry for 4 plots at the bottom of the group of plots?. Something like this: Title Title -------------- ---------------- - ...
2
votes
1answer
44 views

How to disable the spaces before the first bar and after the last bar?

\documentclass{article} \usepackage[adobefonts]{ctex} %支持中文就靠这一行了 \usepackage{fontspec} \usepackage{tikz} \usepackage[active,xetex,tightpage]{preview} %这一行有改动,将pdftex换成xetex ...
3
votes
1answer
75 views

How to integrate pgfplot inside a pre-existing tikz picture?

I'm trying to put together a pgfplot inside a pre-existing tikz picture. But somehow the axis I create with pfgplot has different units and I'm not sure how to make the two things fit. The code is: ...
2
votes
0answers
50 views

3D plot from file

Hi I am currently learning how to do plots in Tex and I found a problem which I cant solve. I would like to do 3D surface plot from file but all what I get is a 3D line. For learning purpose I used ...
1
vote
1answer
49 views

pgfplots error plot 3D math function of two variables

I want to plot a very typical production function (q=L^0.5*K^0.5) in 3D using pgfplots package. When I compile the following MVE I get the following error "! Package pgfplots Error: An internal error ...
1
vote
1answer
77 views

Drawing Q–Q plots (pgfplots)

I can see from the PGFplots documentation, that there is no native support for Q–Q plots. However, since I am using PGFplots for all my other figures, I would also like to use it to display the Q–Q ...
0
votes
0answers
41 views

matplotlib2tikz - compilation error for 2D

Situation: I am using matplotlib2tikz to export a two dimensional plot (comparison). Exported to pdf it looks like this: Including the tikz file (and compiling) yields an error though: Package ...
4
votes
1answer
142 views

Histogram with overlaying Gauss curve (pgfplots)

I am struggling to create a histogram with an overlaying normal (Gauss) curve using PGFplots. To be more specific, I want to recreate this SPSS plot: Creating the histogram using PGFplots is no ...
2
votes
1answer
35 views

Formatting axis as currency

This may well have been answered somewhere, but I can't find it. It seems very simple, but is eluding me. I have a chart built with pgfplots. \documentclass{article} \usepackage{pgfplots} ...
11
votes
1answer
197 views

I am trying to add a trend line to this plot

I have this graph: \documentclass{standalone} \usepackage[utf8]{inputenc} \usepackage{textcomp} \usepackage{pgfplots} \pgfplotsset{width=10cm,compat=1.9} \usepackage{filecontents} ...
4
votes
1answer
45 views

Error message in labeling tick marks

I want to label a tick mark on the x-axis and a tick mark on the y-axis. I put a "%" before the commands in the following code so that the line could be plotted and the tick marks can be drawn. The ...
2
votes
2answers
107 views

How can I draw an implicit equation with pgfplots?

I need some help plotting y^2=x^2(x+1) in pgfplots. I want to print it in the domain -10 to 10. I tried for sometime, but it did not work. Also it should be a smooth curve and not a dotted one.
3
votes
0answers
54 views

Pgfplots and histogram with heterogeneous values [duplicate]

I've got to plot an histogram with pgfplots where a single x value assumes a large value on the y-axis (14000) while the remaining data are all under 150... I'd like some suggestions on how to handle ...
1
vote
0answers
35 views

pgfplots build just hangs

I'm very new to using pgfplots, so maybe I'm just being impatient... Here's the first five lines of my data file, plusMethods.csv. In total, the data file has 58 lines. ...
3
votes
1answer
47 views

PGFPlot's 'domain' argument ignored for 'table' or 'coordinates' input

Minimal example: \documentclass{minimal} \usepackage{tikz} \usepackage{pgfplots} %\pgfplotsset{compat=newest} % has no effect here \begin{document} \begin{tikzpicture} \begin{axis}[] % Does not ...
1
vote
0answers
37 views

Problem with opacity in pgfplots when using pstricks package

Can anyone tell me why doesn't opacity work in pgfplots when I include the package "pstricks" and how could I fix it? See for example the code below: \documentclass{standalone} ...
3
votes
1answer
49 views

Adding error bars to pgfplot with coordinate o

I'm just starting out with pgfplots, and am not overly steeped in Latex in general. I have the following, which isn't all the way there (I need to expand the width the accommodate the legend for ...
5
votes
2answers
98 views

Indicating lengths of line segments

I would like to label the length of four line segments in a certain plot. In the plot, the length of line segment PQ should be labeled a, the length of line segment QS should be labeled b, the length ...
1
vote
1answer
87 views

How would I specify intervals?

I am new to latex, and would like to plot a graph where the x-axis has intervals. I have this sample code that is not interval: \documentclass{article} \usepackage[margin=0.5in]{geometry} ...
2
votes
1answer
95 views

Plotting a Bivariate Normal Distribution in Tikz

I have been trying to make a 3D plot of a certain bivariate normal distribution but that is far from ideal at the moment. The code I have been using is \begin{tikzpicture} \centering \begin{axis}[ ...
1
vote
1answer
76 views

Remove labels with pgfplots

How to remove extreme labels on each axis ? Why does the shape of the curve is not limited to the upper edge of the grid ? I find that the curve is not very smooth, especially at the apex of the ...
3
votes
1answer
93 views

TikZposter does not work with pgfplots

I can't use axis environment in tikzposter, when I add \usepackage{pgfplots}, I will get: Package pgf Error: Sorry, the requested layer 'backgroundlayer' is not part o f the layer list. Please verify ...
3
votes
1answer
60 views

When using pgfplots, I receive an error of “ Missing { inserted.” when using the fillbetween package. Why does this error show up?

I've been using pgfplots to generate images in my homework for a modelling course. I've been receiving the error below and I can't seem to locate it in my code. Missing character: There is no ; in ...
1
vote
0answers
53 views

tikz - maintain scale while adding plots

I want to superpose some plots like this one, but shifted in the x-axis: \documentclass{article} \usepackage{tikz,pgfplots} \begin{document} \begin{figure} \pgfplotsset{ ...
1
vote
0answers
34 views

real number of my files at tikzpicture

I have a tikzpicture that read 3 data files. The values at Y axis are converted automatically to x10^5. I need to show the exact number of my data files. How do I do that? Thanks. ...
4
votes
1answer
57 views

Speed up plotting data with many columns

I am trying to make some kind of a spaghettiplot and draw all columns from a table with 851 columns (one for the z-coordinate, the rest for a quantity as a function of height), to get something ...
5
votes
1answer
50 views

Why does setting the position of the x label shift the label for this semilogyaxis in pgfplots?

I have two plots with the same line; one is plotted on a standard scale, one is plotted on a semi-log y scale. The second plot has the x-axis label shifted vertically quite substantially. How can I ...
2
votes
1answer
179 views

Display max value of an y bar stacked plot

The following MWE generates an y bar stacked plot: \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ ybar stacked, ...
2
votes
1answer
105 views

How to add a zoombox effect to different images?

According to link it is possible to create magnified subfigures and corresponding boxes for portions of a large image like this one: I would like obtain the same effect but with different ...
1
vote
0answers
58 views

Bar graphs with tikz scientific axies=clean

I really like theaxis generated by tikz datavisualization with scientific axis=clean. However I can not find a bar graph visualizer in the documentation. Does such a visualizer exist? Or (even better) ...
2
votes
0answers
51 views

Problem with pgfplot

I'm trying to use the template that can be found here https://github.com/matze/mtheme but I'm running into a problem which I can't resolve. The error message says; I can't find file ...
1
vote
1answer
43 views

Individual tick label style depending on position

I'm looking for a solution to restrict tick labels to be within the axis limits (see figure, without enlarging limits). The idea was to apply a custom tick label style for example to the first ...
1
vote
1answer
48 views

Get x and y labels for tikzpicture

I have plotted a scatter diagram with pgfplots: With this code: \begin{figure}[H] \centering \begin{tikzpicture} \pgfplotsset{ticks=none} \begin{axis}[ymin=0, ymax=10.5, ...
1
vote
0answers
59 views

Error in TikZ pgfplots that previously compiled

I'm trying to compile the following code with no luck. The odd thing is that it was working and then suddenly it is no more working (I edited something in the document and upgrade CSV files, but this ...
2
votes
1answer
63 views

How to avoid that stacked bars overlaps error bars?

I have a stacked bar chart with error bars that sometimes dips below the top part, which hides the remaining part of the error bar. (see both blue and red for x=5 and the red for all others). I want ...
4
votes
1answer
53 views

How to group 2 by 2 style this plot?

I have the following plot that say something about performance: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.12} \begin{document} \begin{tikzpicture} \begin{axis}[legend ...
4
votes
1answer
53 views

tikz: \pgfkeysvalueof and text color!

This tikz code automatically output a node with the y value on the plot... However, how can I colour the text black ??? (now it's blue) \definecolor{mycolor1}{rgb}{0.20810,0.16630,0.52920}% ...
2
votes
1answer
55 views

Show only every n-th xtick label when using 'x tick label as interval'

This question results from the same problem I asked here. Now, I have to many data points to give every single one a tick label. For one axis (the one on the bottom) I could achieve what I want. But ...
3
votes
1answer
54 views

drawing line between plotted points

How do you have the line draw between points that have been plotted on a graph? Here's what I've done so far. \begin{tikzpicture}[>=latex] \centering \begin{axis}[ axis x line=center, axis y ...
5
votes
1answer
82 views

pgfplots - How to specify default line widths for plots and marker?

I would like to specify different default line widths for plots and for markers (like x-marker). For the plot line width, I use: \pgfplotsset{every axis plot/.append style={line width=1pt}} Yet, ...
6
votes
1answer
109 views

How to get vector graphics from Concorde program?

Back in around 2009/2010, my former colleague Libor Sarga (a beginner in TeX at that time), asked me if I could help him to get a vector form of his results obtained from Concorde. He was writing a ...
0
votes
1answer
22 views

How do I increase spacing between unit components in pgfplots?

I'm using pgfplots (version 1.12) with the units library. When I create a unit label \si{molecules \cm^{-2}}, this turns up without any spacing between "molecules" and "cm". When I use the same ...
3
votes
1answer
57 views

How to have an ybar plot without frame?

I want to remove the frame around a plot, which usually works well with axis lines = left. However, something strange happens when trying this with ybar. Without axis lines=left With axis ...
4
votes
2answers
68 views

changing y axis values

How do you change the y axis points to letters? Specifically I'm interested in using musical notes in the y axis. This is what I've tried and I received an error. \begin{tikzpicture}[>=latex] ...
2
votes
1answer
59 views

Plots and chapterspecific colors

I have a color switching function that looks like this \definecolor{chap1}{RGB}{68, 114, 148} \definecolor{chap2}{RGB}{10,130,124} \definecolor{chap3}{RGB}{250,72,46} ...
2
votes
0answers
75 views

How to plot multiple plots associated to different colors of a colorbar with pgfplot

I HAVE EDITED THIS THREAD, NEW QUESTION AT THE END First of all, I apologize for my possibly bad English as it is not my mother tongue. My problem is complex but I am going to try to explain it the ...
5
votes
1answer
96 views

Problem with axis when drawing a function plot using PGFplots

Dear TeX StackExchange, I am trying to plot two functions in the same grid. The code I currently have is below: \begin{center} \begin{tikzpicture}[scale=1, transform shape] \begin{axis}[grid=both, ...
1
vote
0answers
67 views

Alternating colors for stacked bar charts

I'm trying to make a stacked bar chart with two bars next to each other with different colors. I've based my code on discarding \addplot commands similar to this question, but even though I'm ...
0
votes
1answer
49 views

Start xtick labels in the first interval using pgfplots

I'm creating a graph with two x axis using pgfplots where one axis represents timesteps and the other iterations within one timestep. So far I have the following code: \begin{tikzpicture} ...
6
votes
2answers
134 views

Tikz figure wit linear inequalities, surfaces and lables (ILP graphically)

I'm creating slides to explain Integer Linear Programming (ILP). What I want to do is show how solve a two dimensional problem graphically. E.g. I have the following problem: Decision variables: ...