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.

Filter by
Sorted by
Tagged with
0
votes
0answers
19 views

Why does tikz report that my dimensions are too large?

I'm trying to create a figure using Tikz, but it gives me the "Dimensions too large error". I suspect it's because I'm trying to chart functions that approach 0 and 1 in the limits, and Tikz can't ...
1
vote
1answer
12 views

Bar chart vertical alignment and scaling

I'm having problems with the vertical alignment of my bar chart. I started using a single xbar chart for my data, but it looked terrible, since one item is very large and the other very small. So, i ...
0
votes
1answer
58 views

Plotting 3D surface

I'm trying to get my plot as close as this one: CODE: \documentclass[border=5mm]{standalone} \usepackage{pgfplots, filecontents} \begin{filecontents*}{filename.txt} 20 0.01 1.0261 40 0.01 1....
0
votes
0answers
34 views

I cannot use pgfplots?

I am trying to import pgfplots into my Overleaf latex document, and I suddenly get large number of errors. Are there any alternative methods to generating plots in latex? If not, what are causing ...
0
votes
1answer
31 views

Showing odd numbers

How can I show the odd numbers on the xticklabels? CODE: \documentclass[margin=3mm]{standalone} \usepackage[english,spanish]{babel} % multilenguaje \usepackage{pgfplots} \usetikzlibrary{...
1
vote
1answer
43 views

Trend line is not matching with the excel trend line

I am plotting a scattered graph with trend line using following code \RequirePackage{fix-cm} \documentclass[smallextended]{svjour3} \usepackage{tikz, pgfplots,pgfplotstable} \begin{document} \begin{...
0
votes
0answers
25 views

A paraboloid intersecting a plane [duplicate]

I need to plot (in black and white) the following situation using Latex codes: The portion of paraboloid z=x^2+y^2 under the plane z=2 and put an orientation on the intersection circle as in attached ...
0
votes
1answer
29 views

Include negative value in stacked bar chart

I have a problem, and I don't know how I can solve this :( Could you please help me? The parameter "Fim de Vida" does not plote in grafic. \documentclass[a4paper]{report} enter code here\...
0
votes
1answer
11 views

tikzexternalize produces a broken makefile on FreeBSD

The following mwe.tex creates a makefile, which is not working on FreeBSD; it's mostly taken from the pgfplots manual. \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \...
0
votes
1answer
48 views

A PGFplots linear regression problem

I'm having problems with the linear regression function in PGFplots. The eq given by the package has the signs changed. \documentclass[12pt,letterpaper]{article} \usepackage[letterpaper, margin = 1 ...
0
votes
0answers
39 views

Error with \usepackage{pgfplots}

everybody. I am trying to use pgfplots package. I got it from https://sourceforge.net/projects/pgfplots/ and saved in the same directory of the source file. I declared the package writing: \...
0
votes
0answers
14 views

pgfplots + dateplot: plotting datetimes spanning multiple days

Imports: \usepackage{pgfplots} \usepgfplotslibrary{dateplot} \pgfplotsset{compat=1.9} Data: Notice the timestamp starting one day and ending in other. \begin{filecontents}{./data-example.csv} ...
4
votes
2answers
71 views

Fixing overlapping values

How can I fix the overlapping values on the x axis? \documentclass{standalone} \usepackage{subcaption} \usepackage{caption} \usepackage{pgfplots, pgfplotstable} \usetikzlibrary{positioning} \...
3
votes
1answer
73 views

Draw Double Headed Arrow in pgfplots

I am trying to draw a double headed arrow as a plot in pgfplots but the arrow does not seem to be rendering right. Below a minimal example of an attempt to draw a double sided arrow with pgfplots (red ...
4
votes
2answers
41 views

XeLaTex with pgfplots displays wrong color?

I'm using XeTex for Truetypefonts. It appears as if the color output in pgfplots is not correct. Is that a bug? Or do I have some misconfiguration? For other colors than black (e.g. red for the axis ...
2
votes
3answers
34 views

Scale error bars with y bar

I scaled the y bar is in example: How to scale existing coordinates data in pgfplots? the only problem is, that my error bar stays unchanged. Hence it's size is totally wrong. Hi can I scale the ...
0
votes
1answer
69 views

how to label various content of parabola in tex

Can someone pls help with a basic and simplest code to draw a parabola "3x^2-x-4" showing all the grid lines, axis of symmetry, roots and marking the vertex with the help of arrows, dashed lines and ...
0
votes
0answers
33 views

pgfplots graphics plot in XeLaTeX

The following code is copied from an answer by Christian Feuersänger: \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[enlargelimits=false, axis on top,...
1
vote
2answers
47 views

pgfplots 3D with log y-axis

I need an log y-axis for my 3D-plot, but somehow it seems that the generated plot is also in the negative y-range (not the axis-labels, but the y-domain). The y-domain seems to be -1:1 (in fact it is, ...
0
votes
0answers
33 views

How to change axis tick label font to Arial when using pgfplots to draw a figure?

I can change the main font in the preamble using \usepackage{fontspec} \setmainfont{Arial} but it only works for the legend but not axis tick label, I've installed Arial font. I don't want to use ...
2
votes
1answer
37 views

How to change the mantissa separator for PGFPlots contour plot labels?

How can I change the mantissa separator in my MWE from \cdot to \times? The MWE needs to be compiled with the -shell-escape flag. \documentclass[preview]{standalone}% % \usepackage{caption}% \...
1
vote
0answers
96 views
+50

PGFPlots: Align outside legend with neighbouring subfigures

I'm using pgfplots with tikz's external library for my graphics, and I must use the subfigure package for compliancy reasons. As you can see in the mwe below (part "Attempt 1"), inside a figure* ...
0
votes
1answer
47 views

Make bounding box of 3D figure tighter

I am trying to plot 3 figures using pgfplots next to one-another. To do so, I have created 3 minipages with a with of 0.3\textwidth, so that there is a bit of room between them. In each minipage I ...
1
vote
2answers
58 views

How to center a plot with outside legends

I would like to center a plot with outside legends, but the whole figure gets centered (plot with legends). The position of the plot should be like the outside legend is not there. \documentclass{...
3
votes
1answer
62 views

Trying to connect coordinates in boxplot

I am new here so if there is anything Im not following the rules, please tell me. Im not a frequent user of pgfplots. I am trying to connect coordinates in a boxplot with pgfplots and tikzpicture. ...
6
votes
2answers
250 views

Tikzpicture - how to make major ticks longer or thicker

I am trying to make the major ticks (11,12,13,14,15,16,17,18,19 and 20) either thicker or longer so that the box plot statistics are easier to see. Does Anyone know how to achieve this? \...
0
votes
1answer
23 views

Error bars / measurement uncertainty in bar plots

I'm plotting pH results from an experiment and the measurement uncertainty is ± 0.1. \documentclass[10pt]{standalone} \usepackage{pgfplots} \usepackage{siunitx} \usepackage{tikz} \usepackage{mhchem} ...
10
votes
3answers
562 views

Plotting Autoregressive Functions / Linear Difference Equations

Assume there to be some function $k_{t+1} = f(k_t)$. Is there any smarter way to plot a path starting from $k_0$, doing $n$ steps? Thanks in advance. \documentclass[ paper=A4, fontsize=...
7
votes
1answer
123 views

pgfplots vs datavisualization – 2019 review

TikZ' datavisualization library and the package pgfplots (based on TikZ) both produce pretty nice plots in LaTeX. To someone starting to do that, what are the differences between the two and what may ...
1
vote
0answers
69 views

Filled contour with Matlab data, pgfplots

I'm using contour prepared format=matlab to plot a contour, as sugested in pgfplots manual, but I'm not able to combine it with the contour filled option. I've modified the C data from [C,h]=contourf ...
1
vote
1answer
32 views

PGFPlot - Leading missing values in table data ignored, but other missing values interpolated

I know that leading missing values are ignored from PGFPlot - Missing values in table data. However, I found that when missing values pop up again later in a table, there is interpolation between the ...
1
vote
1answer
18 views

How to get pfgplot bar graph flush with the x-axis?

Any idea why these two seemingly formatted the same pfgplots have different outputs? Mostly I'd like for the 0 on the y-axis (in the plot on the left) to be flush with the x-axis just like the plot on ...
1
vote
0answers
56 views

pgfplots (gnuplot): How to plot an implicit function for a triangle

How can I plot \pgfmathsetmacro\xA{0} \pgfmathsetmacro\yA{0} \pgfmathsetmacro\xB{1} \pgfmathsetmacro\yB{0} \pgfmathsetmacro\xC{0.5} \pgfmathsetmacro\yC{0.5*sqrt(3)} f(x,y)=4*( (x -\xA)^2 + (y - \...
3
votes
1answer
26 views

How to get an 'axis equal' pgfplot using gnuplot, splot (implicite funtion)

I get an egg for f(x,y)=x²+y²-4=0. I need a circle. What have I to do? I tested set size square; set view equal xy; (and I think all I found else here here) without succes. % arara: pdflatex: {...
0
votes
3answers
67 views

pgf-plot node at the center-south of the image

I use this code for drawing plots. \documentclass{article} \usepackage{pgfplots} \usepackage{fancybox} \begin{document} \begin{tikzpicture} \begin{axis}[axis lines=middle,samples=200] \...
6
votes
2answers
491 views

How to shade area from one point to other for hobby curves?

I am trying to construct a image similar to a book. I am almost done except a last thing. What I want is and what I have is All I need now is to shade the area from $a$ to $b$. I tried soft clip ...
1
vote
0answers
22 views

Using non-numerical ranges in Tikz bar plots [duplicate]

I am trying to draw a horizontal bar plot using Tikz and I would like to use non-numerical tags for the x axis. More precisely, I have the following diagram: and I would like to change the numeral ...
4
votes
1answer
39 views

Tikzpicture doesn't display correctly

I'm new to LaTeX and am struggling with a problem that I cannot fix. How do I: get ride of all the number inside the bar, get rid of the 120% on the y bar and have it start from 0%, and get the ...
2
votes
1answer
43 views

Plot with samples non-uniformly spaced (failed attempt of 'samples at')

I am plotting a function that needs to be evaluated on numerous samples on some parts to avoid visible mistakes, even with the smooth option. To avoid using too many where the samples are not needed, ...
3
votes
2answers
173 views

Colorbar as included png instead of standard pgfplots output to avoid pdf viewer problems

pgfplots offers really nice surface plots as vector graphics, but file size can easily blow up. it is probably quite common (at least for me) to include a bitmap, which was obtained beforehand by ...
0
votes
2answers
24 views

Transform x coords, then set x limits

I'm trying to reproduce the following pyplot figure with pgfplots: import numpy as np import matplotlib.pyplot as plt x = np.linspace(0, 1) plt.plot(np.log(x)-np.log(1-x), np.log(x / (x + (1-x)))) ...
1
vote
1answer
19 views

Error: File ended while scanning definition of \pgfplots@legend@to@name@grouplegend

I am working a project while all of a sudden the above error appeared and the Latex wouldn't compile anymore. The strange thing is, when I go back to versions of half an hour ago, when it still did ...
1
vote
1answer
41 views

PGF groupplot ylabel not aligned

I have some multiplot I created via matlab2tikz with multiple ylabels. Those were not aligned. I also tried the solution in [this answer] but still. This is the wrong output using my code (see below)...
3
votes
2answers
124 views

Seaborn style plot of pandas dataframe

There is a similar question like mine, but I am not satisfied with the answer, because the axis labels there are coordinates, while I am looking to also have the column and index labels written as ...
0
votes
0answers
72 views

Plotting 3d surface from data points

I have the following code which works great and produces the plot I want. This is it: \documentclass[border=5mm]{standalone} \usepackage{pgfplots, filecontents} \begin{filecontents*}{filename.txt} 0 ...
3
votes
0answers
124 views

possible (major) bug with pgfplot axis labeling?

I tried compiling a bunch of files today, all of which use tikzpictures and pgfplots. Something truly odd is happening with how the y-axis label is being positioned. I took the MWE from Positioning ...
2
votes
0answers
30 views

Pgfplots of flow lines of an ode systems

I'd like to have a tikz diagram of the flow lines of this onion shaped flow: x'(t)=-16y y'(t)=(x^2 + y^2 + 4y + 3)(x^2 + y^2 - 4y + 3) in the square -4 < x < 4, -4 < y < 4. These ...
5
votes
2answers
91 views

Tikz - Coordinates error when using draw with axis

I am using the following code, which is supposed to cut a function in N parts : \documentclass[11pt]{article} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} ...
2
votes
1answer
65 views

Draw a surface using Tikz

I am very new to tikz and I would like to draw the following picture I attempted and here what I got \documentclass[border=10pt]{standalone} \usepackage{pgfplots} \pgfplotsset{width=7cm,compat=1.8} \...
0
votes
0answers
17 views

pgfplots histogram of large set of data

I have a very large dataset with more than 45 million entries which I want to plot their histogram. Even using Lualatex with shell escape does not help to use the Hist plot from the pgfplots. I have ...