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.

3
votes
1answer
49 views

Fill background of a plot depending on different/third column

I have a time series with values for x0 and x1. Depending on their distance, the system is in a specific state. Whenever the system is in the state 1, this should be highlighted with a colored ...
5
votes
1answer
63 views

How to generate a xy diagram with multiple grouped data sets?

Based on the answer of Stefan Pinnow in 'How to group several charts into one chart?', I tried to generate a diagram with multiple grouped data. Therefore, I modified the diagram but I have some ...
1
vote
1answer
12 views

How to plot from a csv file such that one column is the data and the other is errorbar?

How to draw the plot and its error bar from a csv file, when a column is the data and the column after it, is the error bar. Look at the following example. This is an answer from Torbjørn T. to this ...
2
votes
1answer
17 views

Tikz | How to change line color of histogram

I am trying to follow this answer for drawing a historgram. I was able to change the fill color of the histogram but I was not able to change the line color of the bars. Question: What do I have to ...
1
vote
1answer
13 views

Legend customisation in groupplot

I have a groupplot in which each plot shows only part of the data--the first shows one out of five datasets while the second shows the remaining four. For space and aesthetic reasons, however, I want ...
1
vote
1answer
34 views

TikZ PGF: How to develop cell values for 3D graph?

Currently there are some awesome pgfplots around here. I think about something like this one: Minimum Working Example (MWE): \documentclass[border=5mm]{standalone} \usepackage{pgfplots, filecontents}...
2
votes
1answer
42 views

Is there a flat (projected) version of \addplot3[surf]?

This relates to problem 5.7 from "Riley, Hobson and Bence - Mathematical Methods for Physics and Engineering". I would like to have a 2D projected (looking down from z) version of the surface shown, ...
1
vote
1answer
45 views

Combine boxplot and histogram in one diagram (PGF/TikZ)

For my bachelor thesis I did a questionnaire, now I want to evaluate and visualise it in a diagram, combining multiple values. Most of the answers from this survey are in a scale of 1-5 or 1-6. I want ...
0
votes
1answer
22 views

remove xticks within groupplot

Is there a way to get rid of the xticks between the first and second, and the second and third plots in the groupplot below? Getting rid of the xticks on the inside of each plot (e.g. the ticks ...
0
votes
1answer
22 views

adding error bars to bar plot

I have this figure in Excel that I want to replicate in LaTeX. So far, I have these. Can anyone help me to get as close as possible to the first figure please? Also, I want to add a legend to the ...
0
votes
0answers
23 views

How can I add arrows onto gnuplot contour plot?

I have a contour plot for a doublet flow, but I'm trying to add arrows onto the contour plots. \begin{axis}[ xshift=8cm, ticks = none, view={0}{90}, xmin = -1, ymin = -3, xmax = 5, ...
1
vote
2answers
84 views

add straight lines to parity plot

I have the following figure in LaTeX: And I want to add the error lines (+5%, 0% and -5%) present in the following figure: Can anyone help me please? My MWE is: \documentclass[11pt,paper=a4,BCOR=...
2
votes
2answers
41 views

How to change the bar text label in pgfplots

I want to add a \cite{} along with each bar value of my pgfplots bars chart. Can I do this? At the same time, I want to avoid reordering my data. Currently, my code is similar to the following ...
3
votes
1answer
44 views

Dual y-axis plot

Want to do a dual axis plot and I am stuck with some details - maybe someone can point me in the right direction? The main problem is that both bar plots overlap! \documentclass[border=5mm]{...
3
votes
1answer
40 views

PGFPlot vector field has uneven display

I have a simple 2D vector, however the points are aligned such that the vectors at the top pointing upwards are not include in the plot. I was wondering if there's a way to make the vector field more ...
1
vote
1answer
20 views

How modifying the width of xticks line in a barplot?

I have the following plot The code for obtaining it is \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \usepackage{tikz} \usepackage{pgfplots,pgfplotstable} \pgfplotsset{compat=1....
2
votes
0answers
22 views

`imshow` like diplay of image with colormap

I would like to show an originally gray scale image with a specific colormap like matlabs/matplotlibs imshow. Original: % python import matplotlib.pyplot as plt import matplotlib.image as mpimg ...
4
votes
1answer
50 views

Improve perspective visualization in 3d plot

I'm trying to vizualize the computation of Euclidean distance in 3d using pgfplots. This is my current attempt: \documentclass{article} \usepackage{pgfplots} \begin{document} $\mathrm{dist}(p,q) = \...
1
vote
1answer
38 views

pgfplots .eps figures problems [closed]

I generated .eps figures with pgfplots. \tikzset{external/system call={lualatex \tikzexternalcheckshellescape -halt-on-error ...
5
votes
2answers
148 views

Inaccurate Calculations By pgfplots

In graphing a certain function using pgfplots (link here) I noticed a distortion in the curve that at first I assumed must have been a point of inflexion - but on investigating the maths, found that ...
2
votes
2answers
45 views

How to change legend in subfigure environment?

In the image below I have outlined the legend in red. I don't like this legend, because the pattern is in the mark box left of the text, however the color isn't in the box. The code for the legend: ...
2
votes
1answer
73 views

pgfplots fill between broken in TeXLive 2018?

I recently upgraded to TeXLive 2018 and found that the behavior of the addplot fill between behaves differently now. What I'm trying to do is to fill the area between a straight line and a parabola. ...
3
votes
1answer
57 views

Piecewise function is not correct plotted with tikz

I am trying to plot a piecewise function using the code below. The problem is, that the right piece is not plotted correct. It should (obviously) be constant zero, for values bigger than pi/2, but it ...
13
votes
0answers
129 views

How does TikZ parse powers? [duplicate]

I was often stumbling upon (and correcting by hand) an IMHO rather surprising behavior of TikZ: powers are parsed in an unconventional way. Look at the MWE \documentclass[tikz,border=3.14mm]{...
4
votes
1answer
83 views

Is it possible to draw a 3d plot as line art with tikz?

Is it possible to draw a 3d plot as line art with tikz? For example, Is it possible to draw z=x*exp(-x^2-y^2) with smooth line art style? Something like the following figure for z=x^3-3x*y^2.
0
votes
0answers
36 views

Reading data from hdf5 file to plot a graph

Normally when one wishes to to plot some data from a file (.txt, .csv or the like), one would do something like \documentclass[border=5mm]{standalone} \usepackage[utf8]{inputenc} \usepackage[T1]{...
1
vote
1answer
32 views

Problem with colormap in tikz

I'm trying to convert a colormap from python. I'm using matplotlib2tikz but there's an error I don't understand. This is the colormap in python: And when I try to compile I got this error: ...
1
vote
0answers
17 views

How do I display only certain rows in a table using pgfplotstable?

I have a table, read from a file, and I would like to display only rows which have a specific value in a given column. The specific value is a string (e.g. Agricultural). I am able to do it using the ...
1
vote
1answer
23 views

Scaling data in the axis

I'm new in tikz and I'm trying to convert a plot from python. I'm using matplotlib2tikz and everything was ok until I see the scale in x axis. This is the image in Python And this is the image in ...
3
votes
1answer
31 views

Problem with error bars while using pgfplots

I'm new to pgfplots, but it seems like a really useful package. However, I can't quite figure out how to use error bars. Below is the code to my column chart, where some columns should include an ...
0
votes
1answer
54 views

How to make LuaLaTeX multithreaded when `--shell-escape` is enabled? [duplicate]

I found this thread: How to make pdfLaTeX multithreaded when `--shell-escape` is enabled? It works great. But when I change to LuaLaTeX there is still just 1 cpu active. So is there a way to achive ...
2
votes
1answer
43 views

parametric line renders a mesh: how functions are parsed

In the code below I define three functions u(x, y), v(x, y) and w(x, y) which just define a simple parameterization of the unit sphere u(x, y) = sin(x) * cos(y) v(x, y) = sin(x) * sin(y) w(x, y) = ...
3
votes
2answers
45 views

How to change arrowheads to lie on a plane

I have a minor inconvenience in the following drawing. I would like to change the arrowhead that shows the distance d to lie in the yz plane. I am unsure of how to do this if anyone can help me out ...
0
votes
1answer
46 views

Gnuplot error without any log

I am trying to recreate this TikZ picture I saw https://tex.stackexchange.com/a/212936 (specifically the last image) However upon compiling I get a message saying that the process exited ith errors ...
5
votes
2answers
80 views

Formatting the color and scale of a pgfplot

I have the pgfplot of the image below. The bars on the chart are colored, I would like the colors of the bars to be grayscale. If you observe too, the values ​​of the axes are overlapping because they ...
2
votes
1answer
41 views

label positioning in gnuplot

I'd like to have the x and y labels at the end of the axis, next to the arrows: \documentclass{scrbook} \usepackage{tikz,pgfplots} \begin{document} \begin{tikzpicture}[thick,scale=0.7, ...
3
votes
2answers
21 views

xbar y-axis labels are blank for every other bar

Code produces a horizontal bar chart where the name ("a", "b", etc.) for each bar only appears for every other bar. The number of bars (10) seems to trigger the issue; removing one of the bars solves ...
1
vote
1answer
22 views

Quiver in certain region - pgfplot

I am a novice to pgfplot, but got some web examples to create my own vectorized images. Since my specific problem has a vector field just at the upper region of the plane, I would like to draw just ...
2
votes
1answer
38 views

Plotting a knot on a torus

Using pgfplots, I plotted a torus, with a knot that lies on its surface: \begin{tikzpicture} \begin{axis}[axis equal image] \addplot3[domain=0:360, y domain=0:360, samples=20, surf, z buffer=sort] ...
1
vote
1answer
39 views

Changing plot colors

I want to change the color of my plot, so I do as written here, but nothing changed. Btw, can you help me to understand why is my colum from 2009 not plotting? Here is my MWE \documentclass{article} ...
2
votes
1answer
63 views

Pgfplots plotting data from a csv file

I'm trying to create a diagram with three x-axes at the bottom. I found a code which creates 3 axes but when I try to plot the data from a csv file I get an error stating: ! Package pgfkeys Error: I ...
3
votes
1answer
28 views

How to draw from a csv file with rows as plots and non-numeric columns as x-axis?

I have a small csv file. Each row in the file corresponds to a result of method and each column a measure about the method for example: \documentclass{article} \usepackage{pgfplots} \usepackage{...
5
votes
2answers
88 views

Smooth plots, single color scatterplots

I am having difficulty trying to make a smooth graph. Also, how do I make a scatter plot one color? It seems to automatically make it a range of colors. I am trying to graph $$ y = 23.0 + \frac{32....
2
votes
1answer
31 views

Why 'X Group' and 'Y Group' does not appear on this pgfplot?

Why X_Group, Y_Group does not appear in this pgfplot example? I tried to change the below reference slightly, but my example does not show the grouping as in the example. Reference: https://tex....
2
votes
2answers
55 views

legend style customization in pgfplots

I have this bar graph, and I want to do 3 things: Remove the numbers in the bars, they are overlapping (If possible keep only one, symbolizing that both bars have the same value); Within the frame of ...
4
votes
2answers
141 views

Making a (filled) surface in a 3d plane to look like a (filled) ellipse in 3d plane

I have the following MWE: %&lualatex % !TeX program = lualatex \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} \begin{axis}[ ...
3
votes
1answer
49 views

Tikz bar plot Issues: The histogram is not scaling properly

I am having trouble with my tikz plot, Even the value is 21508 corresponding to drive, it is evident from the figure that histogram is not scaled properly. I do not know why this is happening. My ...
1
vote
1answer
34 views

How to Label y-axis properly when plot from CSV file? [duplicate]

I would like labeling as follows: It does not get proper labeling on y-axis when I am plotting data from CSV file in Latex. Here is the code : \documentclass{standalone} \usepackage{tikz,pgfplots} ...
1
vote
1answer
36 views

PGFplots: Plot end arrows without specifying domain

I want to draw functions in a standard way (like you would find in a textbook) using PGFplots. This question relates to the end arrows on a function. Using restrict x to domain (and y) works for most ...
6
votes
1answer
59 views

How to add title at custom position in Latex pgfplot?

I tried to add title at custom position of a pgfplot from a CSV (https://drive.google.com/file/d/1xnF8rG9J50ZIxl9K04k6nksvjWoWrfHe/view?usp=sharing) file, but nothing came out. I tried several ways, ...