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.

Filter by
Sorted by
Tagged with
3
votes
2answers
342 views

How to plot my data smoothly like excel does?

i have the following Code where i use the smooth function, but the graph generated is not smooth. If i use Excel, i do get the smooth graph as expected. Anyone who can help me figure out how to ...
0
votes
0answers
33 views

How can i plot a surface in latex using external data?

I am trying to plot a surface using this data: 186.39 10.634 0.98471 189.82 10.433 0.98489 199.92 12.122 0.98745 197.92 11.911 0.98709 186.87 10.567 0.98485 199.34 11.517 0.98723 194.29 ...
1
vote
1answer
14 views

Pgfplots grid lines cut plot lines

In this plot the grid lines are cutting the plot lines, how can I tell Pgfplots to draw the plot lines "above" the grid? Also I would like to shade the area right of plot line "6" how can this be done?...
3
votes
1answer
68 views

Trying to make a curve

I need some help. I'm a beginner in Tikz and I want to draw this curve but my problem is that I don't have the function of the curve. Please help me! My MWE is: \documentclass[a4paper,12pt]{...
6
votes
5answers
765 views

How to plot a complicated multi-variable function in a tex document automatically, not just importing an image

I have the following Tex functions and I want to plot them in my tex thesis, but I don't know how. I mean, I want the Tex to draw the function, not just to include an external image to it. y[\text{x$\...
21
votes
2answers
421 views

Plot Dini's surface

According to Wikipedia, the Dini's surface is described by the following parametric equations: x = a \cos u \sin v y = a \sin u \sin v z = a (\cos v + \ln\tan v/2) + bu So, I'd like to plot the ...
0
votes
0answers
17 views

pgfplots does not use declared marks at a table plot [duplicate]

I use \pgfdeclareplotmark{mymark} {\shade[draw=none,ball color=green!70] (0pt, 0pt) circle [radius=2pt];} Why has \addplot3 table [only marks, mark=mymark] no effect? What have I to do? \...
2
votes
1answer
52 views

Plotting attenuated wave with tikz

I have the code (generously corrected by the stack) \documentclass[tikz,border=3.14mm]{standalone} \usepackage{tikz-3dplot} \usetikzlibrary{arrows.meta,bending} \usepackage{xparse} \usepackage{tikz} ...
0
votes
1answer
17 views

Scaling a whole plot

Have a plot diagram with x and y axis and i want to scale it such as stratching. How do i do that? \begin{tikzpicture} \begin{axis}[ axis lines = left, xlabel = $x$] %Below the red parabola ...
0
votes
0answers
30 views

Issue with fig=TRUE in Sweave RStudio

I do not receive plots using the fig=TRUE in the chunks. Rather i receive an 'undefined control sequence' error. Consider a simple code \documentclass{article} \usepackage{graphicx} \begin{document} ...
3
votes
1answer
74 views

How to draw a harmonic plot in latex?

I am trying to plot the graph shown below (even arrows or lines to show important frequency points would be enough) I have been searching for hours, but I cannot find a sample code that can help me ...
3
votes
1answer
131 views

How to draw 3D surface plot from .csv with asymptote

How can one draw "regular" 3D surface plot in Asymptote from data.csv? Following (I dare to say basic) code with the help of pgfplots does the job (suppose you have optimal data format): \...
8
votes
1answer
634 views

How to make this figure using pgfplots in Latex?

I try to find a example to make a similar figure equal this example but not found. Thank you
1
vote
1answer
77 views

Chaining gnuplot function calls in TikZ, reverse plotting

I have a parabola drawn through A, B and C. There are three different equations: for the top darker border, the fill (this is a hack just using a wide line) and the lower border. It's not quite what I ...
3
votes
1answer
53 views

Cumulative animated scatter plot from data using animate package

Trying to create an animated scatter plot that shows the cumulative data over time. I'd like to create an animation for this plot using the animate package: Edits: For clarification, I'm hoping to ...
0
votes
1answer
22 views

how to delete extra labels in bar plot in Latex?

How to delete extra labels on X axis: 53, 113, 241. I spent plenty of time to do it reading manuals on pgfplots and others... \usepackage{pgfplots} ... \begin{tikzpicture} \begin{axis}[...
3
votes
1answer
81 views

How to smooth spectra plotted with Tikz?

I want to smooth these spectra which were plotted from lab experimental data, with more than 1000 point for every spectrum. I tried to control smoothing using tension=1, or "each nth point", niether ...
9
votes
3answers
490 views

programmatically drawing sinusoids with tikz

Here's eight full oscillations of a sine wave: Here's the code: \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw[gray!20] (0,-2) grid (32,2); %...
2
votes
3answers
87 views

Parametric Plots Using Latex

I want to create a plot of the following parametric equations: x(t)=t*sin(t), y(t)=t*cos(t) -3pi/2 <= t <= 3pi/2 Also, I want to show the tangent line on the same chart, which is: y-o = (-pi/...
2
votes
1answer
35 views

PGFplots with row wise plot with .dat file

I have the following data.dat file, which looks like this n 1 2 3 4 L1 11 7 13 14 L2 52 61 17 18 L3 9 10 11 12 I want to plot make a plot of L1 (y-axis) against n (x-axis). The same ...
1
vote
1answer
70 views

How to plot $x^2+y^2 = 4$ and $z=2$ in 3-dimensional space in Latex

I'm trying to plot $x^2+y^2 = 4$ and $z=2$ in 3-dimensional space with axes labels. I came across pgfplot and tikz-3dplot but I could not do it.
3
votes
1answer
61 views

Plotting a graph of a function that can't be solved in LaTeX (or wolframaplha)

I would like to plot a graph of this function: Alternatively it could be expressed like this: Either way, it's a symbolic expression, and as far as I'm aware, LaTeX can't solve it for me. ...
10
votes
1answer
189 views

How to typeset maths above the curve of a function with TikZ, with the curve masked (or locally opacified) to improve readibility?

I want to label a family of curves representing a simple family of mathematical functions : x -> x²+c where c will take various values between, say, -6 and 6. I want to superpose the label directly ...
3
votes
1answer
71 views

How to typeset text along the curve of a mathematical function with TikZ

I want to label a family of curves representing mathematical functions by writing at some place of the curve the formula directly on the trace. More specifically, my family of curves is the very ...
1
vote
1answer
49 views

Calculation of residuals with pgfplots

I want to create a residual for this graph: \begin{figure}[hbt!] \centering \begin{tikzpicture} \begin{axis}[,width=\textwidth, axis lines=middle, grid=major, ...
0
votes
0answers
59 views

problem in using \usepackage{pgfplots} package

I think I have a problem with using \usepackage{pgfplots} package since when I compile any file latex using pgfplots, it fails with this error: ! Text line contains an invalid character. l.232 ......
0
votes
0answers
26 views

Pgfplots: Two legends for scatter plot with multiple plots and classes [duplicate]

I need to create a detailed scatter plot. It contains two different plots, each with several classes - each plots can contain upward of 1000 coordinates with varying levels/classes in each. There may ...
321
votes
4answers
42k views

Create xkcd style diagram in TeX

The unique style of the diagrams at xkcd has an informative but nice hand-drawn touch. I guess they are actually drawn by hand but just recently on our partner site for Mathematica someone asked how ...
0
votes
1answer
101 views

Plot characteristics of a PDE

In this answer on MathSE there are plots of a the solutions of the Burgers equation along certain characteristics, which is different from a slope field. Since the answer's author has left the site, ...
6
votes
1answer
247 views

TikZ - How to plot composed function of type x(t) = cos(t+ cos(t)) without pgfplots?

I'm trying to plot a graph of a composed function in form x(t) = cos(t+ cos(t)) using only TikZ without PGFplots, but the result is incorrect. (source: mrak.cz) The used code is: \documentclass{...
1
vote
0answers
66 views

Plot colors in tikz [closed]

I have a problem that is doing my head in, I am trying to color a graph with the color "Mahogany", thing that works when writting in a beamer but that suddently happens to stop working in an article. ...
1
vote
0answers
125 views

PGF generated plot via Matplotlib and using relative font sizes when input to LaTeX

I can produce plots on matplotlib and export them to pgf successfully. But I believe that by first defining a base font size on matplotlib rcParams (11pt for example), and then defining things like ...
0
votes
0answers
21 views

Plotting simple CDF graphs

I am working on a homework assignment that requires me to sketch simple cumulative distribution functions and probability mass functions. They are either step functions or discrete points. Can someone ...
0
votes
0answers
75 views

Tikz: addplot error using pythontex

Please, help solve this issue. The python code have the objective of calculus the derivative of an expression f(x). If I uncomment the line %\addplot [domain=0:10, samples=100, color=blue ]{\pyc{...
0
votes
0answers
113 views

Cannot plot from files anymore after re-installing Miktex

I have recently re-installed Miktex and I cannot plot form a file anymore that compiled before re-installing it. The following code \documentclass{article} \usepackage{tikz} \begin{document} \begin{...
2
votes
0answers
62 views

Plotting two functions and their intersection using tikz/pgfplots

I'm new to both tikz and pgfplots, and I am having trouble getting an image of the functions f(n) = 2n^2 and g(n) = 50*n*log2(n) on the same plot. I want the domain to go from n=1 to n=1000, and I don'...
2
votes
1answer
187 views

pgfplots: How to create heatmap with date as x-axis?

Assumed we want to draw a nice heatmap in pgfplots with date as x-axis. Minimum Working Example (MWE): \documentclass[tikz]{standalone} \usepackage{pgfplots} \usetikzlibrary{positioning,calc}% \...
0
votes
0answers
65 views

how can I plot this with Tikz

I want to use Tikz to draw the image below, I have data for the values of x, y and u/u_b
0
votes
1answer
55 views

Dot plot with small axis values

I am trying to produce a dot plot where the horizontal axis represents probability. At the moment, running the following code generates a very squashed dot plot, like the image in the screenshot. ...
0
votes
0answers
29 views

pgf matrix plot mask values in colormap

I would like to make a matrix plot with the following script, where all 0 values are displayed in white all other values according to the colormap. Is there a masking feature in pgf plot? Could it be ...
0
votes
0answers
21 views

How to put two plots in one figure, vertically? [duplicate]

I have two histograms. Together they tell one story, so I want to put them in one figure. I want to stick to one column format, therefore I want them vertically. How can I do that? I've only seen ...
1
vote
1answer
54 views

Trend line is not matching with the excel trend line

I am plotting a scattered graph with trend line using following code \RequirePackage{fix-cm} \documentclass[smallextended]{svjour3} \usepackage{tikz, pgfplots,pgfplotstable} \begin{document} \begin{...
5
votes
1answer
81 views

Make pgfplot lines dashed automatically below maximum of functions

I want to create a graph which displays linear functions whose maximum builds a piecewise-linear-function (PWLF) labeled max in the minimum working example below. Currently, to highlight the maximum, ...
0
votes
0answers
50 views

Matlab plotting symbols

Is there a set of commands that I can use in latex to reproduce the plot markers used by MatLab? So far I am using $+$, $\bigcirc$, $*$, $\cross$, $\square$, and $\diamond$. The $*$ symbol is ...
1
vote
1answer
38 views

tikz: draw plot by given coordinates points

I'm trying to draw, in a T=f(x) plane graphic, a curve passing through four points whose coordinates have been obtained experimentally. The x axis range is 0 to 0.5, the y axis range is 0 to 80. This ...
1
vote
1answer
55 views

Tikz: positioning of plot within node?

I would like to use \begin{axis} and \addplot within a node, as follows: \begin{tikzpicture}[xscale=0.5,yscale=0.5] \pgfmathdeclarefunction{gauss}{2}{ \pgfmathparse{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)...
2
votes
1answer
78 views

Draw a surface using Tikz

I am very new to tikz and I would like to draw the following picture I attempted and here what I got \documentclass[border=10pt]{standalone} \usepackage{pgfplots} \pgfplotsset{width=7cm,compat=1.8} \...
4
votes
0answers
596 views

Embed interactive 3d objects in a pdf

I have seen pdf files with interactive objects. For example, objects that you can rotate by using the mouse. I would like to know what such formats can be embedded into a pdf using latex, and how. I ...
1
vote
2answers
105 views

How to include a set of four subplots (2x2) as one subplot of another set of (2x2) subplots using groupplots?

What I am looking for is something like this: and I have tried the next MWE: \documentclass[10pt,a4paper]{article} \usepackage{tikz} \usepackage{pgfplots} \usepgfplotslibrary{groupplots} \begin{...
0
votes
1answer
48 views

PGFPlots logarithmic scaling of x axis and ticks base 2

I'm trying to create a plot, where my x axis is scaled to base 2 and the ticks should be at the exact height of the coordinates. I have the logarithmic x axis, but i just can't get the ticks to be at ...