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
3answers
55 views

Plot with increments

I am trying to adapt the solution here to be inside a pgf axis and use axis coordinates. The solution is based on a draw command like the following \draw (0,0) \foreach \x in {1,...,5} { -- ++ (1,0.1*\...
0
votes
0answers
24 views

Barplot from CSV file [duplicate]

I have a CSV file containing the following content: optimization,time a,10 b,20 c,5 From that file, I would like to create a bar plot, with one bar for each optimization on the x-axis with the time ...
1
vote
1answer
20 views

How to use a loop for labels on line graphs in pgfplots

I want to do a graph like below. Showing the duration of an intervention in a country. generated by this code: \begin{tikzpicture} \begin{axis}[ date coordinates in=x, xticklabel={\day/\month}...
0
votes
1answer
24 views

PGFPlot, Legend line and legend text isnt on the same level

I have the following code: \begin{tikzpicture} \begin{axis}[legend style={at={(0.5,-0.1)},anchor=north}] \addplot {x}; \addlegendentry{$x$} \addplot {x^2}; \...
0
votes
0answers
4 views

Can't login with an another device: I have connected my Stack-overflow account to Tex.SE [migrated]

NOTE:If you are trying to delete this because It is not relevant here or it should be on the meta.stackexchange.com; please read the post and the linked post carefully. Then you might change tyour ...
2
votes
0answers
23 views

Implementing Moreland-balanced color maps in pgfplots

I'm trying to implement improved color maps to increase the data density in my plots and graphics (as described in Envisioning Information by Edward Tufte) and after much searching, found what I ...
1
vote
1answer
24 views

Is it possible to change line styles for pgfplots comb plots?

For example, can I adjust the line thickness, color, or transparency, without also changing the markers? MWE: \documentclass[margin=5pt]{standalone} \usepackage{tikz} \usepackage{pgfplots} \...
0
votes
1answer
38 views

What does coordinate[pos=0.3] do in a \draw command?

MWE \documentclass[12pt,a4paper]{article} \usepackage[T1]{fontenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{pgfplots}\pgfplotsset{compat=1.18} \begin{document} \...
3
votes
1answer
52 views

How to draw a line, a curved line and an arc on a pgfplot?

I have written the following code. MWE \documentclass[12pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{tikz} \usepackage{...
0
votes
1answer
34 views

How to find the x value and the y value in a point in a pgfplot

I want to know the x value and the y value on a pgfplot area to draw a line. How to find it? For an example, I need to draw a line from the X label to the Y label; to do so I need to get the x value ...
2
votes
2answers
49 views

Unknown operator x or x^{2}

I am trying to generate the following pgfplot: Minimum working example \documentclass[12pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} ...
0
votes
1answer
54 views

Economics graphs

How would you draw graphs used to answer optimal consumption bundle questions in economics?
0
votes
0answers
24 views

xlabel ylabel not on right place after scale tikzpicture [closed]

Why is my xlabel and ylabel not on the right place when i scale the tikzpicture? \documentclass[a4paper,10pt]{book} \usepackage{pgfplots,tikz} \begin{document} \begin{center} \begin{tikzpicture}[...
0
votes
0answers
25 views

Adding arrow (\draw) to pgfplot [duplicate]

I'm using \definecolor{kitgreen}{rgb}{0,0.588235294117647,0.509803921568627} \definecolor{kitblue}{rgb}{0.274509803921569,0.392156862745098,0.666666666666667} \begin{tikzpicture} \begin{axis}[% ycomb,...
0
votes
0answers
30 views

References for making histograms [duplicate]

I would like to produce a histogram as similar to the following as possible. The histogram itself is not too structured, so I guess it shouldn't be too hard a task, but I am kind of struggling to ...
0
votes
0answers
37 views

Asymmetry in PGFplots quiver plot edges

I am constructing a slope field using PGFplots and there seems to be an asymmetry in the plot. It's as if there's an offset either side of the y-axis that creates a step in the field lines at the ...
0
votes
1answer
48 views

Parameterized pgfplots not showing proper surface

I have a very simple function composed of two planes in the unit triangle. I managed to plot this function by parameterizing the coordinates. Now that I have the function, I would like to see how it ...
0
votes
2answers
52 views

How to plot different functions in a continuous manner?

I have a graph which has three different sections. Though I have managed to plot the first two sections in a continuous manner, I could not get the orientation of the third one correctly. The plot is ...
0
votes
0answers
12 views

Tikzscale fails for group plot with three elements, but works for two elements

For a custom figure I wanted to stack three figures on top of each other, to keep readability (multiple y axis) and comparability (all figures have the same x axis, the third figure is a combination ...
0
votes
0answers
17 views

tikz input/includestandalone using axis mostly yields Missing/Extra {}

Im trying to include several graphics with \includestandalone (or \input if necessary). Neither my own simple tikzpicture as standalone with axis are able to compile nor the ones I create e.g. with ...
0
votes
0answers
19 views

pgfplots show grid in 3D plot only in background

I created a 3D plot in pgfplots and I would like to show the grid of the 3D box only in the background. According to Section 4.11.3 "Appearance Of The 3D Box" of the pgfplots manual, 3d box=...
0
votes
0answers
48 views

pgfplots: runaway argument when using \thisrow for processing a table

I'm trying to read a .csv file and draw some plots based on the data I got. Because the values are really low I want to multiply them by 1000 so I can label the y axis as mA, but it seems like I got a ...
0
votes
0answers
36 views

add time to x-axis with date in pgfplot

In my MWE I have date and time separated in my .csv file to set both their own respective column in the table. Now I want to plot the same date, but I don't know how to add the time except writing a ...
1
vote
1answer
47 views

How to create a histogram with intervalls and symbols with pgfplots?

I am trying to recreate a histogram with pgfplots in TeX that i have orignaly created with Excel: The problem that i have is that i don't know how to recreate the x-axis with pgfplots. So far I have ...
2
votes
1answer
51 views

Draw Plot (tikzpicture) from csv file in TEX

I am having troubles using csv files to create plot similar to png file. There are two csv files which includes results of two different models (Kobert, XLM-R). I want to make plot in latex looks same ...
1
vote
0answers
30 views

Transform a Graphic on Image into Pgfplots [closed]

So, I have the following graphic: I don't have the point list, so I tried to to the lines "with the eyes" and using the smooth parameter as below: \begin{tikzpicture} \begin{axis}[ ...
1
vote
3answers
37 views

tangens function pgfplots detail [duplicate]

I read the solution in https://tex.stackexchange.com/a/521359/14423 for draw a a function based on the tangent function but I have an issue with asymptotes: \documentclass[tikz,border=3.14mm]{...
0
votes
1answer
84 views

|x|+|y|=\sqrt(2) using tikz or pgfplots

I want to draw the rhombus $|x|+|y|=\sqrt{2}$ using tikz or pgfplot, but I am unable to do that. I want to draw it, but despite several attempts, I am nowhere.
1
vote
0answers
13 views

pgfplots: How to move the legend in a multi-axis figure [closed]

This figure seems to always generate the legend in the top right, north east position. How would I move it to the south east? Passing the legend style to the plots themselves didn't seem to work. \...
-3
votes
3answers
112 views

shadow in picture [closed]

Can you help me with this function?
0
votes
1answer
17 views

How can you change the x-coords of a prepared boxplot in pgfplots?

I want to visualize data with pgfplot boxplots. I am using prepared boxplots. The only problem that i have is that i don't know how to customize the x-axis values of the boxplot correctly. The x-axis ...
2
votes
1answer
32 views

pgfplots fill polygon with gradient

I have the following three-dimensional surface plot and I would like to add a gradient to the red semitransparent area starting with black at x=0 and ending with white at x=1. Is it possible to add a ...
0
votes
2answers
62 views

How to plot the 3D graph of the following three inequalities in latex (e.g., tikz/pgf)?

How to plot the 3D graph of the following three inequalities in latex (tikz/pgf) ? z <= x+y+1, z <= 4x, z <= 5y. My attempt: \documentclass[12pt,leqno]{amsart} \usepackage{pgfplots} \...
0
votes
1answer
60 views

pgfplots surface plot from table

I would like to create a surface plot (like the one shown below) from a .csv table containing three columns of data (x,y,phi) but all I get is a line plot (see second picture). The data table is ...
1
vote
0answers
62 views

Tikz external handling optimization

Since I have many and elaborate diagrams (PGFPlots) as well as Tikz images in my document, I have come across a limitation of Tikzexternalize. It takes a long time to compile the document if I make ...
0
votes
1answer
30 views

Beamer: how to set right proportions for three groups of plots

I'm dealing with the following MWE: \documentclass[dvipsnames, aspectratio=169, 9pt]{beamer} \usetheme{metropolis} \usepackage{appendixnumberbeamer} \usepackage{FiraSans} \usepackage{booktabs} \...
0
votes
2answers
48 views

Formatting tikzpicture plots side by side/ how to use \begin{figure}[htdp] or \begin{figure}[h]

I'm new latex. I've been trying to learn how to format these plots side by side on one line, but I have not been able to successfully. I don't understand how to use the \begin{figure}[h] feature or ...
1
vote
0answers
24 views

Tikz Bar graphs with many coordinates per y value [duplicate]

I have a few problems with the following code: \begin{figure} \caption{test}\label{fig:sourceType} \begin{center} \begin{tikzpicture} \begin{axis}[ xbar, reverse legend, ...
1
vote
0answers
29 views

semilogx histogram with log-spaced bins in pgfplots

Is it possible to make a histogram in PGFPlots on a logarithmic x-axis, with equal-sized (in log space) bins? Just using semilogxaxis and hist fails as expected. Apparently there is no way to specify ...
2
votes
2answers
35 views

Using \csname to iterate over loaded pgfplots tables with \addplot

I'm attempting to create a pgfplots group plot in which each curve is made from a pre-loaded pgfplots table in an automated way. The intended application is for a complicated drawing involving many ...
0
votes
0answers
38 views

Avoid remake of references in TikZ externalization

I am working on a large document with considerably more than 100 TikZ-pictures. Within the document individual plots created with pgfplots are referenced using e.g.: \addplot table[x=f,y=T]{\datPath};\...
1
vote
1answer
29 views

How to access multiframe index for plotting per table columns

I would like to animate 3d plot where plotting data are in table. They are ordered as follows \begin{filecontents}{AA} x1 x2 x3 x4 x5 x6 0.1 0 0.4 0.1 0 0.4 0.3 0 0.12 0.3 2 1 ...
0
votes
1answer
33 views

Drawing a circle with focus on quadrant and different angle-starting point

So, I'm trying to draw a graph, and I have the following MWE as a starting point: \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{arrows,patterns} \begin{document} \begin{tikzpicture}[...
0
votes
2answers
74 views

Need to graph the cdf of a gamma distribution in latex [duplicate]

I need to graph the cdf of a gamma distribution in Latex. I was able to graph that for the Normal distribution using erf function explained here: How to Draw CDF of normal distribution in Tikz (third ...
0
votes
1answer
43 views

How to shade the upper contour set of a function (pgfplots, tikzpicture)

I would like to shade the entire area above the function f(x) = 0.5/x, over the entire domain of the function (that is 0.5:47 in my case) up to y=1. In other words, I'm looking to fill/shade the upper ...
4
votes
1answer
54 views

Stop pgfplots from closing a cycle

I'm trying to draw the graph of a curve in three dimensions. For some reason, tikz/pgfplots is automatically closing the curve. I can't figure out how to stop it from doing this. Here is an example:...
2
votes
1answer
46 views

Trying to do simple calculation in TikZ, results in “Dimension too large.” error

I am working on a pgfplot where I want to calculate some coordinate. For some reason I always get a "Dimension too large." error, but I can't figure out why since I don't understand how a ...
0
votes
1answer
35 views

pgfplots: plot an integer-sequence by a functional

What is the best way to plot an integer-sequence by a functional term, say 2*m+2? I tried \addplot[variable=\m, only marks, red] {m==int(m) ? 2*m+2 : nan}; But this does not draw anything. \...
0
votes
2answers
45 views

How to draw a (reasonably) thick arrow to show a ray on a number line

I'm trying to write an accessible paper describing the least upper bound property of the real numbers, and to do that, I want to introduce the idea of rays (on a number line). For example, if I want ...
1
vote
1answer
27 views

Nested groupplot (one little groupplot inside a “main” groupplots) [duplicate]

Is it possible to have a smaller plot embedded into one of the plots of a groupplot? What I would like to achieve is like a magnified region of the lower plot, it should display two rectangles, one ...

1
2 3 4 5
169