Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [pgfplots]

{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.

0
votes
0answers
12 views

How to center wide subfigures in classicthesis?

In a twosided ClassicThesis document, I want to put 2 TikZ pictures side by side, so that their total width is bigger than \textwidth. If I use KOMA's addmargin as described in this question, the ...
0
votes
0answers
23 views

Error: sorry, plot file{file_contourtmp0.table} could not be opened

I was met with this unpleasant surprise when trying to compile this file: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.13} \begin{document} \begin{tikzpicture} \...
4
votes
1answer
40 views

How to keep xtick label in pgfplots for those coordinates wihout y value

I construct plots by coordinates from table. For some coordinates, the y value is not given which causes the related xtick label disappears. But I want these xtick labels for such coordinates being ...
1
vote
1answer
33 views

pgfplots line doesn't reach axis

Here is the code: \documentclass{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ width=500, height=500, axis lines = center, ...
2
votes
1answer
22 views

Pgfplot: remove tick elements on axis

I am trying to plot a graph using pgfplots. The plot is fine, my only concern is about the fact that I don't have, let's say, a linear x axis: I have the following elements: 1,2,4,5,7,8,9,10,12,13,14,...
4
votes
1answer
19 views

Problem with time format on x-as not displaying correctly

I've made a 24 hour graphic (with different y-axes). So far so good. But the x-axe is not displaying as I wanted. 1/ the time is not displayed correctly 05:59:00 instead of 06:00:00 2/ the x-axe ...
3
votes
1answer
69 views

Fill between breaks suddenly

I am trying to plot a function as shown below: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usepgfplotslibrary{fillbetween} \begin{document} \...
0
votes
1answer
22 views

pgfplots semilog axis limits

I read in some posts (here is one) that if I'm using semilogxaxis in order to limit the domain to [10^a, 10^b] I should give as limits a:b: \begin{semilogxaxis}[ restrict x to domain = -1:1, ...
3
votes
2answers
62 views

draw angle of Inclination

Καλημέρα!! I 'm trying to draw a line with the angle of inclination, but nothing happens. What am I doing wrong? \documentclass{article} \usepackage{tikz} \usepackage{tikz,pgfplots} \usetikzlibrary{...
2
votes
2answers
37 views

colorbar problem when scaling every node

I'm trying to illustrate a confusion matrix, and when I scale every node and it seems to mess up the colorbar. Notice that the colorbar is not completely filled in. And here's an MWE: \documentclass{...
1
vote
1answer
32 views

Include negative value in sum/total value in stacked bar chart

I have a stacked bar chart that looks like this. However, I'm trying to include the negative values (ninth column in the datatable) into the total value on the stacked bar chart so that in the end ...
3
votes
2answers
21 views

Remove blank space around plot's empty labels

I have the following MWE %!TEX program=lualatex \documentclass[crop,tikz]{standalone} \usepackage{pgfplots} \usepgfplotslibrary{groupplots} \pgfplotsset{ compat=1.16, } \begin{document} \begin{...
-5
votes
0answers
59 views

Looking to hire experienced tikz-pgf / pgfplots / Python programmer [on hold]

I'm looking to hire experienced tikz-pgf / pgfplots / Python programmer, paid by the hour, to make a large number of technical illustrations. The work can be done remotely. Is anyone interested? If ...
1
vote
1answer
29 views

Stacked bar chart, nodes near coords remove small values and show sum

I know it is possible to have only the sum shown on top of the bar chart and remove the other values in the stacked bar chart (as shown in picture attached), but I can't figure out what went wrong in ...
3
votes
1answer
22 views

Obscure error with conditional formatting in pgfplots

I am trying to format a matrix plot in such a way that the nodes will change text color depending on the cell color. This is turning out to be a lot more complicated than I expected. The following ...
2
votes
0answers
54 views

Tikz multi-bar plot custom bar position

I have a multi-bar plot that contains single and multi bars: I want to make the single bars A and D in the center; right now they are left aligned. The following is the code: \begin{tikzpicture} ...
0
votes
1answer
23 views

Contour gnuplot setup for TexMaker (Windows 10)

I'm trying to get contour gnuplots working on Windows 10 with TexMaker and MiKTeX, but I keep getting the error: "sorry, plot file {file.table} could not be opened." I have the latest version of ...
6
votes
1answer
52 views

Stacked Bar Chart - How to center values inside/outside the bar?

I modified a code (found here in the forum) to produce a stacked bar chart. Unfortunately I do not understand the whole code… How can I center the values within the bar chart or right beside the chart?...
2
votes
1answer
23 views

Graphs using pgfplots: Failure when using x as a negative power

I'm trying to plot the decharging curve of a capacitor. The code is as follows: \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{...
1
vote
2answers
49 views

How do I plot an ellipse with \addplot with using an equation

i am trying to plot an ellipse in my coordinate system. TikZ provides an implemented easy method for plotting ellipses, but I don't like it — I want to draw my ellipses with actual analytic equations. ...
2
votes
2answers
21 views

Axis environment problem: how to determine a domain in which x and y axes are to be drawn?

Let's suppose that I want to put a neat graph of the sinus function in my document. Its source code is: \documentclass{standalone} \usepackage{pgfplots} \usepackage{tikz} \usetikzlibrary{calc} \...
2
votes
0answers
26 views

\pgfmathprintnumber label of bar values exceeding axis values

I'm trying to only have the y-value exceeding the axis to be labelled and not the rest (as shown in the picture below). Is there any suggestion how this can be made? my MWE (thanks to @Jake): \...
2
votes
1answer
47 views

Is there a way to place the x axis at a specific y value in PGFPlots?

I prefer single-line axes for plots, rather than the box style which is (I think) the default for PGFPlots. I'm familiar with the axis x line*=middle option, which places the x-axis at y=0. However, I ...
2
votes
1answer
22 views

pgfplots produces stretched pictures

The plots produces by pgfplots seem to be slightly stretched so that right angles are not preserved. \documentclass[12pt,parskip=full,a4paper]{scrartcl} \usepackage[utf8x]{inputenc} \usepackage{ucs} \...
2
votes
1answer
36 views

Simple coordinate system in order to explain the variance decomposition - how to create this graphic underneath?

based on my low level beginner latex skills I am completely overcharged in this case. I have no idea how to create a code in order to get the desired output shown below, I guess I have already startet ...
2
votes
1answer
52 views

Plotting from CSV file using comma as decimal separator

I'm trying to create a plot with pgfplots from CSV file using semicolon as separator and comma as period. I've tried parsing /pgf/number format/read comma as period as parameter to both \axis and \...
1
vote
0answers
53 views

Too many xticklabels on plot

I want to construct a plot with package pgfplots using data from a table named "00-data.txt". Following is a part of this table. id a b time 1 1 1 23:59:58 2 2 4 23:59:59 3 3 9 00:00:00 4 4 ...
7
votes
2answers
81 views

How to represent discontinuous data (Interrupted Plots) with pgfplots?

I want to plot a large set of data points generated from a numerical experiment. The plot looks like a step function, that is, for an interval in x-axis, it takes a constant value. The code is (for ...
8
votes
2answers
221 views

Why is there a trace line in this tikz graph?

I am trying to generate a shaded area between three curves: two are y=±√x and third one is y=5. \documentclass[10pt,multi=False,border=5pt,tikz,class=scrartcl]{standalone} \usepackage{xcolor} \...
1
vote
0answers
17 views

pilots-made and node shown on x-axis using different column data [duplicate]

Here is my data using for construct plots(in a file named "00-data.txt") with the package "pgfplots". id a b time 1 1 1 235958 2 2 4 235959 3 3 9 000000 4 4 16 000001 5 5 25 000002 I ...
7
votes
1answer
40 views

Plot basic graphs (inequality)

I am beginner (and it is my fourth article here) and I am struggling with plotting some basic graphs. I found here some similar articles, but it did not help me. :( I want to plot graph, where is: y&...
9
votes
1answer
202 views

Creating a tube plot from external data with pgfplots and tikz

I have the following MWE \documentclass[border=10pt]{standalone} \usepackage{pgfplots} \pgfplotsset{width=7cm,compat=1.8} \usepackage{pgfplotstable} \begin{document} \begin{tikzpicture} \...
2
votes
1answer
28 views

Partial numbers in stacked bar plot

I have a problem with stacked bar in PGFplot. I would like to show the partial number of each segment, like this: But instead of that, when I copy my code in TeXShop and compile it, I got the value ...
4
votes
1answer
72 views

Shading the region bound by two graphs

How do I shade the region bound by the standard parabola and the square root function? \documentclass{amsart} \usepackage{amsmath} \usepackage{tikz} \usetikzlibrary{calc,intersections} \usepackage{...
3
votes
1answer
37 views

Why I get “the requested layer 'background' is not part of the list” error if it is part of the list?

The following code gives me the error: ! Package pgf Error: Sorry, the requested layer 'background' is not part of the layer list. Please verify that you provided \pgfsetlayers and that 'background '...
4
votes
1answer
50 views

Area under curve in pgfplots

\begin{figure}[H] \begin{center} \begin{tikzpicture} \begin{axis}[xticklabels={},yticklabels={},axis x line=center, axis y line=center, xlabel={$x$}, ylabel={$y$}, xlabel style={right}, ylabel style= ...
2
votes
1answer
67 views

Draw a subset of cartesian plane (or space)

I want to know whether is it possible to draw, by means pgfplots or tikz, a subset of the Cartesian plane or space starting from their equations. For example: and
4
votes
0answers
53 views

Stacked bar chart percentage label not showing

I have a stacked bar chart and surprisingly not all the percentage of the bars are shown. I only allowed values more than 3% to be shown, however some are clearly more than 3% and at the same time not ...
3
votes
1answer
81 views

Plotting a 3D data-set from a .csv file

I have a .csv with 2-dimensional data. Now I am trying to plot it in different index ranging from -n:1:n (this index is y-axis). \documentclass[border=10pt]{standalone} \usepackage{pgfplots} \...
3
votes
1answer
29 views

Adding legend entry for border of fill, from fillbetween

I've made a plot like the one below to show a distribution of values in the dependent variable versus the change of the independent variable. \documentclass[varwidth]{standalone} \usepackage{pgfplots}...
1
vote
1answer
20 views

How to add Error Bars to PGFPlots graph data that isn't in table form

I am making a graph in PGFPlots, and I have many lines along my axes. My MWE contains two. Each have different error value, and my data are in coordinate form, not in table form. Would I have to ...
0
votes
1answer
24 views

Missing } inserted. in legend refernce. error during 2nd compilation

I am running into the following problem and hope that you can help me as my dead line is just around the corner and suddenly i have got this problem. I am using Texmaker with Miktex and i try to ...
0
votes
1answer
29 views

Compiler Error with pgfplots package

my code suddenly stopped compiling and getting this errors: File ended while scanning definition of \pgfplots@show@ref@Gain. } l.89 \begin{document} I suspect you have ...
2
votes
1answer
86 views

PGFPlots with TikZ produces unstable plots

I'm currently trying to get some of my Octave plots to work natively in a LaTeX document. My method of choice is to use the plot parameters of my Octave scripts in a standalone TikZ document that uses ...
5
votes
2answers
71 views

What is the difference between storing table data by filecontents and pgfplotstableread?

In this MWE, the table data loaded from poles.dat is successfully parsed as shown in the left plot. However, storing the same data inside a macro using \pgfplotstableread doesn't result in the same ...
1
vote
1answer
93 views

Scaling the x-Axis in a more logarithmic way

While I have found some answers for equidistant scaling, I did not find an answer which I was able to transfer directly to my problem. I have one interval going from 10^-8 to 3*10^-8 , one from 3*10^-...
4
votes
1answer
31 views

Accessing raw meta in pgfplots scatter plots with explicit meta

I am trying to make use of explicit meta data that I add to coordinates in a scatter plots. However, I do not want the transformed data, rather it should be the original one. This question is ...
2
votes
2answers
55 views

PGFplots: Changing style of labels of nodes near coords

Trying to adopt this answer approach, I didn't manage to get what I want of changing the style of the nodes near coords labels. I would like to make this code poles={red, fill = blue, draw} work and ...
0
votes
0answers
87 views

How to make a huge clickable matrix plot use less memory?

I'm trying to plot a temperature map of certain shape. For fewer elements (less than 3000) I have no problem, but for too much elements (more than 250k) I can not produce the file. From these, I'd ...
1
vote
1answer
46 views

PGFplots: Global setting of coordinates labels

The following code results in an error when introducing the foreach part. So, I would like to know what is wrong in it. \documentclass[border=1cm]{standalone} \usepackage{pgfplots} \pgfplotsset{...