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,167
questions
3
votes
1
answer
257
views
Asymptote 3d plot of an implicit function (with absolute value)
When I run the following code, the program seems to go into an infinite loop. If I write a function without the abs function, the program runs normally. The resulting plot is similar to the picture ...
4
votes
2
answers
153
views
Tikz/Pgfplots Selectively Drawn
I am attempting to plot both branches of a vertically-opening hyperbola onto an existing grid. When I run
\documentclass{article}
\usepackage{tikz,pgfplots}
\pgfplotsset{compat=newest}
\begin{...
2
votes
1
answer
217
views
Plot f(x,y)=2-x^2-y^2, extrema value
It's easy show that f(x,y)=2-x^2-y^2 has a maximun value in (x,y)=(0,0), I need a plot show this result. I tried this:
\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{...
4
votes
1
answer
1k
views
Tikz surface plot
Does anyone know how to replicate this Mathematica plot in tikz?
(If possible: I'd like to use "pattern=crosshatched dots" to fill in the shaded region.)
Below is the Mathematica code:
Show[(*...
3
votes
2
answers
314
views
Topographic map in latex
I want to make a recursive code to give multiple elipses with different colors like a topographic map of a mountain, like in Mathematica I would have this image when typing: ContourPlot[(x/5)² + (y/3)²...
1
vote
1
answer
333
views
Smoothing a pgfplot curve
I am trying to generate plots with smooth curves using the pgfplots package.
Setting the smooth option in the \addplot command does not seem to make any change.
\documentclass{article}
\usepackage{...
11
votes
3
answers
3k
views
How can I plot the F distribution
I wish to plot the F distribution by declaring its density function. However with the following code I get an error saying that fdst has not been declared:
\documentclass[border=5mm]{standalone}
\...
2
votes
0
answers
43
views
How to plot function from a .csv file in Tikz? The .csv file created from the example from Tikz manual is misread (as all y values are 0) [duplicate]
Note: This question is not exactly the same as TikZ data visualization fails to load data from file because I don't have any error thrown by the code (the log don't display "! Package PGF Math ...
1
vote
1
answer
383
views
Shading region in LaTeX
I have the following LP
$$
\begin{array}{cc}
\min & 15x+20y \\
\text{subject to:} \\
& x+2y\geq 10 \\
& 2x-3y\leq 6 \\
& x+y\geq 6 \\
& x,y\geq0
\end{array}
$$
...
2
votes
1
answer
423
views
tikz cosine function plot without pgf
I am trying to plot a function with cosine and exp. It can plot the exp part but not the cosine. I have tried cos, \cos, cosine, \cosine none work. This code used to work for 3 months ago maybe ...
1
vote
1
answer
142
views
Create a graph with very large number of edges
I am trying to create in Latex a graph with a very large number of edges. Something similar to the attached image (taken from a paper by Bissyandé et al).
I've tried to simply draw a graph using ...
4
votes
2
answers
152
views
How to smooth the graph $\chi(t)=\sen(\pi t)\exp\left(\dfrac{-1}{\sen^2(\pi t)}\right)$
I am graphing these two functions $$\chi(t)=\sin(\pi t)\exp\left(\dfrac{-1}{\sin^2(\pi t)}\right)$$ and $\rho(t)=\sqrt{\frac{1}{A}\int_0^{t+1}\chi(x)dx}$, where $A=\int_0^1 \chi(x)dx$.
I only ...
1
vote
0
answers
94
views
Some book to learn to graph 2D and 3D
I have been drawing in a fairly basic way for a long time or using alternative programs to generate my graphs, but now I would like to learn how to graph in Latex but I don't know where to learn to ...
1
vote
1
answer
81
views
Plot line in Kiviat’s graph hides the background text
The following is the hexagonal Kiviat’s graph from tkz-kiviat package. Though the plot made is fair enough, but the lines of the plot hide the background text. I used stackengine and adjustbox ...
5
votes
3
answers
1k
views
plot $(e^x-x)^{\frac1{x^2}}$
I need to plot the function (e^x-x)^(1/(x)^2) in tikzpicture, but close to 0, apparently latex indeterminates it, does not graph it.
This is the code I am using:
\documentclass[1cm]{standalone}
\...
2
votes
2
answers
64
views
Ticks and label superposed with pgfplots
my problem is that I need more digits in the y ticks. When used precision=4, the y label and y ticks are superposed. ¿How can I avoid this?
\documentclass{article}
\usepackage{pgfplots}
\begin{...
0
votes
1
answer
343
views
LaTeX code in legend table in Qti-Plot
I want to use LaTeX code in the legend table of a plot in the qti-plot software. Does anyone know how one could e.g. write $4\cdot 10^{-5}$?
10
votes
5
answers
2k
views
Plotting a smooth function [duplicate]
I want to plot the graph of the function given by:
f(x)=abs(x - x^3/6 - sin(x)) for -1<= x <=1
but a noise (near x-axis) curve is obtained:
The code is the following:
\documentclass[11pt,...
1
vote
1
answer
46
views
Multiple elements not visible in pgfplot
I have a few issues with getting a pgfplot right. I do not have much experience with pgfplots and neither online tutorials nor the pgfplots manuel could help me. The plot I want to create is a bar ...
7
votes
3
answers
939
views
Square root of a function "misbehaves" near the x-axis
I'm trying to plot height lines of a function of the form $H(x,y)=y^2+u(x)$, by taking multiple plots of $\pm\sqrt{c-u(x)}$. The problem is that for some values $c$ the domain is tricky and not easily ...
1
vote
0
answers
158
views
How to plot a complex function in Domain coloring/color wheel graph?
That's what I want to plot in LaTeX. I'm gonna have Complex Analysis, and I want to be able to plot complex functions like this when I'm going to create my own notes in LaTeX
How should I do this? I ...
2
votes
1
answer
3k
views
Softmax activation function
I would like to plot the softmax activiation function. I know that there is already a similar question but unfortunately neither the comments, nor the answer provided there could really help me so far....
4
votes
2
answers
406
views
How to Plot General Form of a Linear Regression
I attempted to use both Mathcha which is an online website that assists in constructing topological diagrams and plots and I also tried to use Sage, in order to plot this linear regression figure ...
0
votes
1
answer
28
views
Removing whitespace of \draw plot command
I use the following command to generate a smooth curve inside a Tikz picture:
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[black] plot [smooth, ...
0
votes
0
answers
158
views
How to plot data in Latex with a two level x axis
I want to create a plot for a latex document based upon data like this
1 1 11.5
1 2 11.2
2 1 11.0
2 2 10.8
2 3 10.5
3 1 9.5
3 2 9.1
3 3 9.05
3 4 9.0
4 1 8.95
4 2 8.9
The first two columns should ...
9
votes
1
answer
2k
views
How to plot vector field of a function with tikz?
How can I draw a vector field of a function with tikz?
For example f(x,y) = 4x2 + y2 - 5
0
votes
1
answer
358
views
Remove border from line in Tikz
I'm using Tikz to draw some diagrams.
However, when i use \draw [shift={(232.14,97)}, rotate = 90] [fill={rgb, 255:red, 115; green, 201; blue, 255 } ,fill opacity=1 ][line width=0.01] [draw opacity=...
1
vote
1
answer
274
views
Shift subcaption of figure
I'm using this code for ploting multiple plots:
\begin{figure}[htbp]
\centering
\captionsetup[subfigure]{justification=centering}
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=\...
1
vote
0
answers
48
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.
\...
1
vote
2
answers
67
views
How to adjust the Size of a Plot inside a Table?
How can one adjust the size of the plot in the following table:
\begin{longtable}{ | c | m{3cm} | }
\hline
Graph & Items \\
\hline
\begin{minipage}{.3\textwidth}
\...
1
vote
1
answer
89
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
0
answers
18
views
How to let a bar chart start from value different to zero with pgfplots [duplicate]
Following up on a previous question. How do I let a bar chart start from a value different to zero? Including negative numbers.
As you can see when I plot the data from the table all bars start at ...
0
votes
1
answer
296
views
Ticks on the y axis not working as anticipated
I am trying to have a plot where the ticks on the y axis are 1, 1.004, 1.008, 1.012, 1.016, and 1.02. However, only the ticks 1, 1, 1.01, 1.01, 1.02, 1.02 are shown in the figure (see below).
I was ...
0
votes
1
answer
180
views
How to use a Mathematica plot saved as a pdf in TexMaker?
How to use a Mathematica plot saved as a pdf in TexMaker?
When I use:
\includegraphics[width=0.4\textwidth, angle=0]{Graphs.pdf}
EDIT:
The image is really small, how do I fix that?
This is what I ...
3
votes
1
answer
804
views
How to use a Mathematica plot in LaTex as a figure?
How can I insert this Mathematica plot in LaTex as a figure?
MWE:
\documentclass[12pt, a4paper]{report}
\usepackage{amsfonts, graphicx, verbatim, mathtools,amssymb, amsthm, mathrsfs}
\usepackage{...
3
votes
1
answer
82
views
Make simple plot nicer with Tikz
Is there a way to make this figure to look nicer?
For instance, how to write the legends of the red arrows or the spacing of the dashed black lines?
At least for me, it is quite crude and can be ...
1
vote
1
answer
2k
views
multiple graphs in one plot Tikz
I would like to patch different graphs in one. Moreover, the two in the right are also linked by two dotted lines. How can I do it? Here the final result:
Here the codes of the single figures that I ...
6
votes
2
answers
617
views
Add text to spin chain with TikZ
I would like to add the text to a spin chain.
This is what I did:
\begin{tikzpicture}
\draw[-] (5,0) -- (0,0) node[left]{$a)$};
% \draw[-stealth] (0,-.25) -- (0,.25);
\draw[](.5, 0) circle(...
0
votes
1
answer
115
views
Plot with TikZ (Fermi distribution)
any idea on how to do these two figures with TikZ? Especially the one on the right :)
Thanks a lot!!
1
vote
0
answers
36
views
How do I draw a polynomial function? [duplicate]
polynomial function f(x,y) = x^3 – 5*y^2.
polynomial function f(x,y) = x^3 – 5*y^2.
Heading
0
votes
0
answers
50
views
How to make a dashed portion of a plot from file .dat
I'm dealing with this kind of file .dat
t1a psi1a t1b psi1b t1c psi1c t2 psi2 t3 psi3
0.000 95.32842 0.000 99.37904 ...
0
votes
2
answers
125
views
I would like to plot a graph with polarization curve [closed]
I would like to plot functions like that, can you help me please?
0
votes
2
answers
3k
views
GPL Ghostscript 9.53.3: Unrecoverable error, exit code 1 when trying to draw pspicture inside tabular environment
Here is the code that is giving me this problem. Basically I'm trying to render inside a grid a couple of pictures plotting the beta probability density function for different values of the parameters ...
2
votes
0
answers
229
views
How do I get LaTeX to perform an exponential regression?
I have been trying to get some regressions for my estimates, but there seems to be only content on polynomial and linear regression. This is the code I use for linear:
\begin{center}
\begin{figure}[...
0
votes
1
answer
324
views
How can I draw the following plots: Straightening out the boundary and the balls, in tikz
I would like to draw something like the following plots.
Thank you!
For the first draw, I tested the following code:
\begin{tikzpicture}
% Origin
\coordinate (O) at (0,0);
% Point z0
\coordinate (z0) ...
0
votes
0
answers
16
views
Problem with plotting figures side by side [duplicate]
I want to plot the figures side by side, so for this I have the following code:
\usepackage{subcaption}
\begin{document}
\begin{figure}
\begin{subfigure}{0.32\textwidth}
\centering
...
2
votes
2
answers
491
views
Filling optical spectrum curve with color gradient
I have some difficulties creating a plot where the area between the curve and the x-axis is filled with a gradient. I want to plot an electromagnetic spectrum and I want the color gradient to ...
1
vote
1
answer
92
views
Comma in x coord (interval)
How can I replace the dot with a comma in x coords?
\documentclass[border=10pt, 12pt]{standalone}
\usepackage{pgfplotstable}
\usepackage[utf8]{inputenc}
\usepackage{pgfplots}
\usepackage{times}
\...
-1
votes
1
answer
135
views
How to plot an RG flow
How can I plot this in latex?
Source: Fig 8.3 in Giuseppe Mussardo - Statistical Field Theory
1
vote
1
answer
790
views
How to display the median on Ogive Curve using Tikz or pgfPlots
I am to plot an ogive curve and find the median of the given data by drawing a dotted line parallel to x-axis offset by 55 units and then drawing a line perpendicular to x-axis from the point of ...