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 [plot]

{plot} is for questions concerned with plotting data or functions using TeX. For questions specific to the pgfplots package, use the {pgfplots} tag.

1
vote
1answer
44 views

Drawing Line Plot with uncertainty

Does anyone have an idea how to generate a graph with the 'uncertainty' area like in the picture shown: i have no idea where to start! Thanks for any inspiration! Cheers! Martin
0
votes
1answer
21 views

Plotting an elliptical arc in TikZ with minimal additional packages and as simple as possible functions

I have the above output from Mathematica that I would like to reproduce exactly in LaTeX, but I am just beginning with TikZ and do not understand the huge layers of code that are presented in other ...
1
vote
1answer
25 views

How to define vertical line correctly in axis environment?

I Would like to have three vertical dottetd lines from top to bottom to visibly divide the 4 functions. How can I do this. \documentclass[letter,12pt,twoside]{article} \usepackage{tikz} \...
1
vote
1answer
34 views

Plotting logarithm with base b in TikZ

\begin{tikzpicture}[line cap=round,,x=1.3cm,y=0.4cm] \clip(-1,-3) rectangle (12,13); \draw [domain=0.1:10 ,smooth,very thick] plot(\x, \Log{2}{3*\x}); \draw[->,color=black,line width = 0.8pt] (0,0....
2
votes
1answer
46 views

How do I draw these two lines on a X,Y graph?

I don't really know much about drawing graphs on LaTex so I am kind of lost here. One of the lines is y=-3 (a horizontal line at y=-3) and the other is y=x-3. I have as follows: \documentclass[]{...
1
vote
1answer
17 views

Pgfplots - Turn off Box when plotting a File

By default, pgfplots will draw a box around my plot. I am plotting a .dat-File with \draw table [...] {data.dat} and i want to turn that box off and just leave the x- and y-lines instead. In the ...
1
vote
1answer
48 views

Strange asymmetry when plotting identical exponents?

Instead of the expected symmetric shape: what I get from this code: \documentclass[border=5pt]{standalone} \usepackage{pgfplots} \begin{document} \newcommand{\vandbarrierdel}[1]{ \node ...
1
vote
2answers
51 views

How do I label the axis of a sinus using pi? [duplicate]

I am plotting a sinus function using a pgfplot and would like that the tick of the x axis was labeled using multiplers of pi (pi/4, pi/2, 2*pi...), for they are the "important" x values to visualize ...
1
vote
0answers
58 views

How do I create a curve on Latex?

I want to create a curve using tikz. As can be seen, the curve is made of connected lines with no rounded connection points and I would like to round off the edges. Following is my code: \...
1
vote
1answer
57 views

Connecting two functions in a plot

I'm trying to draw two horizontal lines, y = 0 and y = 1, in [0, 1], in front of the already existing plot. The intended result is: The current result is: Obtained from: \documentclass[border=5pt]{...
2
votes
1answer
79 views

Help with economics graph

I am new to LaTeX, but I need to draw this 2 period model. Thank you in advance!
4
votes
2answers
82 views

Stacked ybar plot creates additional empty y-entries

I have this code: \documentclass{scrartcl} \usepackage{pgfplots} \pgfplotsset{ compat=1.16, table/col sep=comma} \usepackage{filecontents} \begin{filecontents*}{data.csv} Type, fillA, fillC, ...
5
votes
1answer
536 views

Plotting the Lorentz Constant in LaTeX

I'm having trouble producing a graph of the Lorentz constant, defined by \frac{1}{\sqrt{1 - v^2/c^2}$ as a function of $v$. (Here, $c$ = $3 * 10^8$). I tried many examples, but I usually get "...
1
vote
2answers
55 views

How to use intersections in PGFplots as x-ticks?

I am pretty new to PGFplots, but I am already loving it very much! I want to have a plot, where the intersection of two curves or when the data reaches a certain y-value is labeled on the x-axis as ...
5
votes
2answers
71 views

tabular with xticks enabled at some plots make one plot moved

I have 4 plots arranged using tabular: \documentclass{scrartcl} \usepackage{pgfplots} \pgfplotsset{compat=1.16} \begin{document} \pgfplotsset{ height=4cm, width=\linewidth*0.5, every axis plot ...
1
vote
0answers
26 views

Placing numbers at the above and right side of the plot frame

I have the following code for a plot. I need to place numbers of x-axis and y-axis in above and the right side of the plot frame respectively. The code is \documentclass{standalone} \usepackage{tikz,...
1
vote
1answer
57 views

Fill the area included between two gnuplot contours

this is my first experience with latex plots. I want to fill the small area included between the two contour lines just like i did for the two polynomials, but i think there is some issue with the ...
3
votes
1answer
27 views

Automatically extend discrete xticks when using dates

When defining xticks in PGFplots one can say something like: xtick={0,2,...10}, to achieve ticks at 0, 2, 4, 6, 8 and 10 My x-axis has the date coordiantes definded in the pgf manual, however i ...
1
vote
0answers
78 views

Graphing probability density functions [closed]

I am writing a LaTeX document that involves the discussion of many probability mass functions (binomial, poisson, geometric, negative binomial, hypergeometric, zeta) and probability density functions (...
2
votes
1answer
72 views

sketching a polar curve using tikz and orientation counterclockwise

I would like to modify the code below so that Can I indicate the counterclockwise directions with arrow -- from O to B -- from B to A -- from A to O Also, 2. Can we indicate theta_1 and theta_2 ...
1
vote
0answers
49 views

Fixing “broken” peaks in 3D plot

I am currently trying to get a nice smooth 3D plot using tikz, however, I am failing to do so in only one case. The complied file is smooth in most areas, yet, in the "peal" areas, the plot gets ...
0
votes
1answer
26 views

Only one point visible with pgfplots

I am trying to display multiple plots with pgfplots, but only one point is displayed (with a lot of overlapping) : And the latex : \documentclass{article} \usepackage{pgfplots} \pgfplotsset{width=...
0
votes
0answers
20 views

Load graphicpath set by variable

I would want to define Variables to load from a certain path with a certain name composition like: \newcommand{\Simulation}{callistotoeuropa190} \newcommand{\Timestep}{16000} \newcommand{\FigPath}{/...
1
vote
2answers
50 views

Minipage/subfigure issue - creating a set of 4x3 graphs (12 total)

I am trying to fix a 4 by 3 set of graphs, with caption, on a .tex file. The result I want to achieve is the following: (this was done in Word. Yes, that's lame, I know.) The code for each small ...
1
vote
1answer
37 views

How do you fill the 'o' arrowhead white?

%%%%%%%%%%%%%%%%%%%%%%%% \plot [Triangle-o,smooth,very thick,domain=11:-11]{-0.1*x+1.7}; %%%%%%%%%%%%%%%%%%%%%%%%
0
votes
1answer
36 views

pgfplots change distance of only one xtick

I have a semilog plot with the xticks 10^0, 10^1, 10^2, 10^3 and 10^50, whereby the xlabels have the same symbols, with the exception of 10^50 which has an infinity label. Now, when I plot this the ...
1
vote
0answers
55 views

Extract one specific value from table/csv to draw an horizontal line

I need to add horizontal lines (asymptotes) to a plot made from a csv file, with the y-axis value taken from this last. I found an example to draw the horizontal lines \addplot [thick,black] table[x=...
2
votes
1answer
101 views

Small scale grid using Tikz

I am trying to create a grid that only has a domain between -0.8 and 0 and a range between -0.8, 0,8, with the grid not showing any positive X values. Thus far I have this: But when I try to shrink ...
7
votes
1answer
89 views

Solid region enclosed by surfaces

I'm trying to obtain the solid regions showed below for didactical purposes: I know that with psplot in 2d one can do things like that (area enclosed by two curves) and the output is very nice (I did ...
2
votes
1answer
48 views

pgfplots memory error due to specific xmax limit

I am facing a problem with setting the limits of my plot in pgfplots. The following script (from an answer here ) \documentclass[border=5mm]{standalone} \usepackage{pgfplotstable} \begin{document} \...
0
votes
1answer
65 views

Create one linear line plots from each row of data in table

I have a table where the data has the following format: | x | y | dydx | |------|------|-------| | x1 | y1 | dydx1 | | x2 | y2 | dydx2 | | x3 | y3 | dydx3 | I want to create a ...
1
vote
1answer
42 views

Two plots with different ranges in a single plot

I have two plots with different ranges. I want to draw them in a single plot, but if I do so the plots do not show the small fluctuations of each graph. I write: \documentclass[tikz,border=0.5mm]{...
3
votes
1answer
105 views

How to plot a function and its derivative

How can I plot this with \begin{tikzpicture}? the red line should be the derivative at x_0 Pls help :) Thanks!
3
votes
2answers
178 views

To Shade the Area Between $x^2$ and $\sqrt{x}$

I want to draw the following image in tikZ Basically I want to draw the boundary of the unit square, plot the x^2 and \sqrt x functions, and shade the area between them. In my attempt to draw the ...
2
votes
1answer
74 views

3d plot with absolute value function with pstricks

I would like to reproduce the plot given in picture. The function (with known a and c) is a(x^2+y^2+z^2)+(1-a)(abs(x)+abs(y)+abs(z))=c where 0<a<1, c>0 How can I do this?
9
votes
1answer
208 views

Random points in a rectangle

I have made a graph as shown in the following figure: For each rectangle I'd like to generate n random points in it, is it possible? My code: \begin{tikzpicture} \begin{axis}[ grid=major, ...
1
vote
2answers
102 views

Function plots - objective comparison for choosing between tikz data-visualisation and pgfplots [closed]

I am writing my PhD thesis now, and want to plot some results (mainly the evolution of various simulation quantities on y-axis against time on the x-axis). I estimate to have around 50 such plots in ...
0
votes
2answers
217 views

TikZ: Plot contour lines

I have a (continuous) function on the real plane (e. g. f(x,y)=x^2-x*y) and want to draw contour lines (e. g. f(x,y)=-1, f(x,y)=1 etc.). Furthermore, I want to adjust the region where to do this (e. g....
0
votes
0answers
29 views

Drawing piecewise discontinuous plots with pgfplots [duplicate]

I'd like to draw the distribution function defined below: There is a good answer proposing the method to draw a nice graph for step function, but I can't figure out how to do the same for my function ...
0
votes
2answers
45 views

Generate path for \includegraphics with if-else macro

I would like to have a single option/macro (true/false or similar) that determines, from which folder to choose plots. There's only 2 folders for each plot. Mainly need this to switch between low ...
1
vote
0answers
36 views

Set size of \datavisualization

I am trying to plot the function using \datavisualization like this \datavisualization [school book axes, visualize as smooth line, y axis={label}, x ...
3
votes
0answers
53 views

pgfplots - filldraw disappears after adding plot

I have some plots in my graph and want to mark a special area with a square. Here's what the plot looks like: \begin{tikzpicture} \begin{axis}[axis lines = left, xlabel = {Player 1}, ylabel = {...
3
votes
1answer
94 views

Plot 8th roots of unity on complex plane with PGFPlots

This is what I currently have \begin{figure}[h] \centering \begin{tikzpicture} \begin{axis}[axis equal, axis lines=center, xlabel=$\Re$, ymax=1.5,ymin=-1.5, ...
3
votes
1answer
237 views

Problem with legend position

I have been using the tikz package to plot my graphs. When I want to describe each graph in a plot, I use "legend entries" and using "legend pos" I can manage the box describing the graphs. But now I ...
1
vote
0answers
82 views

TeX capacity exceeded using Knitr

I am unable to weave a document containing LaTeX and R code using RStudio due what I think are TeX capacity limitations. Is there a way of fixing this without having to compile using LuaLaTeX which is ...
3
votes
4answers
363 views

Plotting Hermite polynomials

I prefer to plot the first five Hermite polynomials through \draw command (not through the \axis command). There is no problem with the first three ones, but sketching the last two polynomials is not ...
0
votes
0answers
35 views

How to plot greyscale histogram of an image [duplicate]

Is it possible to plot color and greyscale histogram of a given image directly in LaTeX?
3
votes
1answer
65 views

How to fill the intersection among four curves?

In my problem, all curves are plot from data instead of explicit function. And what I want to do is to fill those little curved rectangles with different colors. How could I do it? Here is the tex ...
1
vote
1answer
82 views

Plot the characteristic roots of complex equation

I want to draw the following pictures as plots in the TikZ environment. The first one is the characteristic roots of the equation \lambda + \mathrm{e}^{-\lambda} and the second one is the ...
0
votes
1answer
80 views

How to plot something like this in latex

I would like to graph something like this in latex or R, but my main goal is to do it in Latex. Thanks for the help