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.

2
votes
0answers
17 views

Doublet vector field not showing up as expected

I'm a bit confused with how to use quiver in pgfplots, I want to plot two equations, z = x/(x^2 + y^2) z = -y/(x^2+y^2) but when putting these into pgfplots and using the following code, \addplot3[...
2
votes
2answers
32 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
37 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
34 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
16 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
20 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 [on hold]

I generated .eps figures with pgfplots. \tikzset{external/system call={lualatex \tikzexternalcheckshellescape -halt-on-error ...
5
votes
2answers
124 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
41 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
71 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
127 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
81 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
15 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
53 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
42 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
44 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
79 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
21 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
37 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
59 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
27 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
81 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
52 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
48 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
33 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
35 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, ...
1
vote
1answer
26 views

How to plot histogram from a tab separated csv file containing tabular list of ordered tuples?

I would like to plot a histogram in which x-axis will contains ordered tuple data and y-axis will contains its frequencies. A CSV file containing data as follows : x_values y_frequency (2,102,100)...
1
vote
0answers
45 views

Trouble with the intersection of 3 planes

I am trying to make a 3d plots as follows. This is my MWE: ‎\begin{tikzpicture}‎ ‎\begin{axis}[xlabel=$x$‎, ‎ylabel=$y$‎, ‎zlabel={$z$},legend pos=outer north east,z post scale=1.1,grid=both,view={50}...
1
vote
1answer
49 views

Transparent marker without line inside

In the plot below, I need to have transparent markers without the line passing through them. For instance, the triangles are transparent but have a line inside, while the circles are white but not ...
3
votes
1answer
73 views

surface and contour plots of mathematical function

I have a problem with plotting contour plot with tikz. I have a mathematical function z=x^2+2*y^2 and I need to plot along log-axis as surface and contour. My code is \documentclass[crop,tikz]{...
1
vote
1answer
58 views

Order of axis style options in pgfplots

I'm trying to understand in which order axis options are applied, and what overwrites what (in the case I'm using style and not append style). When a style is redefined, the previous options should ...
1
vote
1answer
43 views

How can I add a fixed point to a line of best fit? [duplicate]

I am using y = {create col/linear regression={y=data}} with addplot to generate a line of best fit from data I'm pulling in from a file. How can I force the line to include the origin as a point it ...
1
vote
1answer
32 views

The style of plot line changes if \addplot+ order changes

I have a weird issue with this simple plot. I need to draw four couples of plots, each made by an approximate curve (continuous line) and the real curve (dashed line). For some reasons I can't ...
2
votes
1answer
182 views

How to represent density 3D plots based on the type of the point

I want to plot a data set with xyz points, each of them has a 0 (success) and 1 (error) as a result of an experiment. The data file "data_all_10m.dat" is in this link. I have tested Gnuplot with ...
0
votes
1answer
74 views

How to remove arrows pointing towards 0?

I've been struggling with removing these arrows as shown in the picture. It appears that I get more of these arrows the more graphs I have. And if I don't add any graphs they are completely gone. Hope ...
0
votes
1answer
34 views

xticks are between the interval and not below bars

I would like to have a stacked plot with xticks showing the number of samples. But my xticks are between the interval and no matter what I tried, couldn't fix it. Even more strange is that I have 21 ...
2
votes
1answer
30 views

pgfplots: let plot continue until enlargelimits

I want the plot to continue until the enlarged limits, without the axis ticks moving. Any ideas? \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.14} \pgfmathdeclarefunction{gauss}{...