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
1
vote
1answer
43 views

PGFplots: fixed scale and fixed dimension

I have two pgfplots axes next to each other with the same dimensions. The axes should be aligned and use the same axis scaling. This leads to a situation where I specify width, height and the x and y ...
0
votes
2answers
43 views

Symbolic Coordinates not showing

So I'm just learning LaTeX so I'm sorry if this is a dumb question, but i've read the manual, watched youtube videos and read blogs and I still can't figure out why this is not working. I want to do a ...
0
votes
1answer
49 views

Bar plot with pgfplots: fit all bars on x axis

This is the result so far: \documentclass[border=10pt]{standalone} \usepackage{graphicx} \usepackage{pgfplots} \pgfplotsset{width=7cm,compat=1.8} \begin{document} \begin{tikzpicture} \begin{axis}[...
0
votes
1answer
70 views

PGFPlots: adding points and managing the labels

I want to draw following with Tikz/PGFplots: X = 0:12. Y = 0:30. \documentclass[10pt]{article} \usepackage{pgfplots} \pgfplotsset{compat=1.15} \usepackage{mathrsfs} \usepackage{float} \usetikzlibrary{...
1
vote
2answers
48 views

Can I add a table through PGF \nextgroupplot functionality?

I have made a minimal working example which shows how far I am right now: \RequirePackage{luatex85} \documentclass[tikz]{standalone} % Default preamble \usepackage{pgfplots} \pgfplotsset{compat=newest}...
1
vote
1answer
62 views

Draw “less than functions” in tikz graph [duplicate]

I would like to know how to draw the "less than" or "greater than" lines in a tikz graph. i found this nice graph but am unable to draw the "zebra-lines". Is there a ...
0
votes
1answer
23 views

Let custom mark depend on a variable

I am trying to create a custom mark to use in a scatterplot. pgfplots: problem in the legend using custom marks has provided a hint on how to proceed but I do not know how to make this mark depend on ...
1
vote
2answers
90 views

Animate pgfplot graph using animate package

After googling how to animate a plot I found different ways that I didn't get, I've done some animations before using this method. My question is it possible to use the same method to animate the ...
0
votes
1answer
50 views

How to fix this pgfplot (5x*e^{-x}+1)?

\begin{figure}[H] \centering \begin{tikzpicture} \begin{axis}[xmax=8,ymax=3, smooth, restrict y to domain=0:4, axis lines = left] \addplot[red] {5 * x * 1 / pow(e,x) + 1}; ...
0
votes
0answers
24 views

How to change overlapping of axis caption in graphs? [duplicate]

I have plotted a data in latex using pgfplots. The axis caption of the graph are overlapping eachother. Can someone tell me how to change it. My code is as follows: I have attached the image file ...
1
vote
0answers
40 views

Trend line through points with pgfplots

How can I draw a smooth curve through the points using pgfplots that are not necessarily connected, using a .txt file? I do not want the smooth line that goes over each point but rather a fitting plot ...
0
votes
2answers
53 views

pgfplots: 2D contour plot of 3D function: placement of axes labels

I'm using pgfplots \addplot3 to plot contour plots of two-variable functions, as seen in the (x,y) plane (using view={0}{90}). However the default placement of the axes labels is odd (I suspect, ...
0
votes
0answers
25 views

Simplified contour plot (pgfplots)

I tried different options, none of them worked. In the picture below I am trying to remove all numbers (so there would be just lines) and even tikz on axis, and set color blue for the first plot and ...
1
vote
1answer
26 views

Dotted line segments in pgfplots and changing font size in legend

I have the following code: \documentclass[11pt]{scrartcl} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{booktabs,siunitx} \usepackage{pgfplots} \pgfplotsset{width=10cm,compat=1.9} %\...
1
vote
0answers
15 views

Changing font size of legend and adding dotted lines in pgfplots [duplicate]

I have the following code: \documentclass[11pt]{scrartcl} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{booktabs,siunitx} \usepackage{pgfplots} \pgfplotsset{width=10cm,compat=1.9} %\...
1
vote
1answer
36 views

pgfplots: Boolean key for a style does not work

I trièd to insert a Bool Title=true|false: \pgfplotsset{ %/pgfplots/.cd, % no effect Title/.is choice, Title/.style={title={A title.}}, } Why does Title, Title=true and Title=false not work ...
1
vote
1answer
20 views

Error in fill background at a cont plot

I have this pgplot with const graphs. The idea is that the first area at NW (which is actually the background) is completely green. Then the second area should be blue and the third one white. As you ...
1
vote
2answers
72 views

Plot Gauss Bell Curve based on a data set?

I want to plot the bell curve to show the distribution of the data around the mean, with one and two standard deviations. Possibly, comparing two data sets. I have the following code from @Stefan ...
1
vote
0answers
33 views

Package pgfplots Error: Could not read table file [closed]

To create a 3d scatterplot, I copied and pasted the code from p.132 of the manual http://ftp.math.purdue.edu/mirrors/ctan.org/graphics/pgf/contrib/pgfplots/doc/pgfplots.pdf, \documentclass{standalone} ...
0
votes
1answer
46 views

How to draw a linear axis with tick labels at different alternative distances?

I need help to draw a linear axis that have a ticks labels below of axis in progresive diferent distance one from the other like a stair. I try draw this using tikz package, but I don't know do that. ...
0
votes
2answers
74 views

Concept of designing asymptotes

I just read this about how to make asymptotes, but could someone teach me the same method if I want to draw for \dfrac{x^2+0.5x+1.5}{x+3} with their asymptotes? Also teach me about the concept of this....
2
votes
1answer
44 views

How can I draw a fancy “proxy” legend line with pgfplots?

I have a couple of curves I am drawing in an axis, but one of them is a circle that is drawn with a "fancy" line (I just overlay a thick black curve with a slightly thinner white dashed ...
1
vote
2answers
31 views

How do I draw a circle in pgfplots that uses data coordinates?

I want to draw a circle with radius specified in data coordinates. But I don't get that. Here's a circle with radius "5" but its data coordinates radius appears to be only 0.05. What am I ...
2
votes
1answer
44 views

Supervised and unsupervised learning graphic in tikzpicture

I would like to represent these two plots using tikzpicture. I don't need them joined together as below but I would like to have something similar. I can generate a scatter plot as below: Where I ...
1
vote
1answer
50 views

Changing some specific xticklabel styles

I would like to change some xticklabel styles but not all of them only few and not in specific positions (so it wont be 1st or last always). How could I change only lets say (3,5) labels to (Hello, ...
0
votes
1answer
39 views

Indicating point on a graph with a given interval

I have drawn a graph ,but is there a simple way for indicating the points on a graph when an interval is given \documentclass{article} \usepackage[margin=0.7in]{geometry} \usepackage{tikz} \def\width{...
1
vote
0answers
33 views

PGFplots standalone colormap problem

I'm trying to create a colormap for one of my documents. To test and see what this colormap looks like, I use the \pgfplotscolorbardrawstandalone command. However, when using this command, the upper ...
2
votes
1answer
39 views

Placement of PGFPlots.net Bar graphs

I'm trying to display these 2 graphs so that one is on top of another but every time I got them side by side How can I display them so that one is on top of other so it look like this \documentclass[...
1
vote
0answers
35 views

Formatting error bar mark pgfplots, append to style?

I am trying to increase the thickness of my error bars. I found that the stem and the marker needs to be changed individually here. Problem with this is that using /error bars/error mark options={*...
6
votes
4answers
252 views

Truncating singular 3d surface plot with large values

I was wondering how to plot a singular surface such as z=1/(x*y)^2 (the function I'm working on is far more complicated). What I'd like to achieve is shown below: Wolfram Alpha (left) does a great ...
1
vote
1answer
33 views

How to top-align PGFplots legend exactly flush with axis

My goal is to top-align the legend box with the plot so that it is exactly flush with the top axis frame. The following MWE works ok on first sight, but when looking closer, there is a small vertical ...
0
votes
1answer
50 views

interval of the horizontal axis

I want to add a custom interval to the x-axis for the graph attached.It should be start from 20, and then increased by 5. For example, 20, 25, 30, ......50. Similar question was asked before, but it ...
1
vote
1answer
56 views

Add node colors and node shapes to legend in tikz-picture using forest tree and pgfplots

I want to add the elements of my tree to the legend (see the legend for description). I found this and this answer, but they do not explain how to add other shapes to the legend. I did not find ...
0
votes
2answers
38 views

Trying to plot two functions with tikzpicture where one of the them is a parabola

I am trying to plot the following two equations: y = x 4x + y^2 = 12 The second one is a parabola. So, I need to solve for y. When I do that, I have a square root. So I break the second equation into ...
0
votes
0answers
29 views

Using arithmetics on macros in pgf-axis-environment to specify x-ticks with TeXLive2016

The Problem: I want to compile the figure below with TeXLive2016 compatibility. I know this is kind of outdated, but apparently it is used by arxiv. The MWE compiles with TeXLive2019, but not when I ...
0
votes
0answers
27 views

How can I set the Y-asis to auto. if I don't know the range of my data?

I have a .dat file which I want to fetch the median data points to plot my figure. However the y-axis is giving issues. here is my code. and attached is the data file. \documentclass{article} \...
1
vote
1answer
68 views

pgfplots, tikz: How to use fillbetween at a Bezier-curve

With normal curves it works all fine, but what's about Bezier curves? I have a Bezier curve of the kind (-0.3,3.7) .. controls (2.3,0.9) and ...... I want to set two coordinates on the Bezier-path ...
3
votes
1answer
40 views

Drawing a graph with two functions, include the cosine function

First, I would like this plot to be in radians. I want a plot of two functions. $y = \cos x$ and $y = 1 - \cos x$ for $0 \leq x \leq \pi $. I wrote the following LaTex code: \begin{tikzpicture} \begin{...
1
vote
1answer
26 views

PGFPlots keys for axes and plot styles only partially working

I'm trying to plot different views of a 3D curve, but I'd like to define the axes and the plots' style from the beginning; I haven't been able to do this. Here's the code and what I get: \...
1
vote
1answer
22 views

Point label only partially visible in PGFPlots

I want to add a label to the following plot, but due to the axes being small I can only see a part of it. Is there a way of adding "virtual space" to the plot so I can see the whole label? ...
2
votes
1answer
27 views

How to plot data approaching zero in pgfplots log plot?

I'm trying to generate a log plot of some data using pgfplots. I've mostly got it looking how I want, but I'd like the plot to show the data continuing down toward the origin rather than stopping at ...
0
votes
1answer
95 views

Change the equation of the Gauss bell

My goal is to draw the absorption peaks of Lambert-Beer-Bouguer graph which, ideally, have the shape of a Gaussian. I would like to make sure that these peaks all have the same width, which in Gauss's ...
1
vote
1answer
65 views

pgfplots Figure with fixed Width

How can I create a standalone pgfplots figure with set total dimensions, including axis labels and legend entries? If I set plot dimensions with width=5cm, height=5cm, pgfplots only gives me a total ...
1
vote
1answer
85 views

Janky pgfplot behaviour with arcsinh function

I'm trying to draw a titration curve using pgfplot. Based off this paper, there is an equation for the titration curve: I've attempted to implement this within pgfplots, and I get a very strange ...
1
vote
2answers
66 views

Tikz issue with samples parameter, minimal example

What is wrong with my use of the samples parameter in combination with \pgfmathdeclarefunction? A minimal offending example is as follows: \documentclass{article} \usepackage{tikz} \usepackage{...
0
votes
0answers
67 views

How to plot several large data in pgfplots?

I want to plot 16 data (the size of each data is 150 kb) by pgfplot and LuaLatex on the Overleaf website. But I could not have the pdf result. There is an error:Timed out. Sorry, your compile took too ...
1
vote
1answer
35 views

Reduce graphic when plotting

This matrix plot extends one square longer than it should. I don't understand what is causing this. This is the full code: \documentclass[border=5mm]{standalone} \usepackage{pgfplots} \begin{...
2
votes
0answers
33 views

Smooth curve segments

I need the last segment of the curve (which is dashed) connected smoothly to the previous segment. Please suggest any other improvements as well! \documentclass{article} \usepackage[utf8]{inputenc} \...
0
votes
0answers
41 views

Tikz Regression Line With Orthogonal Residuals

I pick the example of drawing a Regression Line from TikZ: Regression Line with Residuals. But now, instead of drawing vertical error bars, i wanted them to be orthogonal to the regression line. Is ...
2
votes
2answers
100 views

Latex charts similar to scientific graph

I found this awesome library for python which enables drawing nice plots https://github.com/garrettj403/SciencePlots is it possible to create similar styled graphs with latex ? I have used pgfplots ...