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
2 answers
92 views

Tell pgfplots not to try to plot where the function is not defined

The following code raises error because the function is not defined on part of the domain (e.g. acos cannot have its argument greater than 1): \begin{tikzpicture} \newcommand{\myfunc}[1]{acos(cos(...
Ulysses Zhan's user avatar
1 vote
0 answers
57 views

How to plot broken axis in overleaf? [duplicate]

I need to plot the following points in a plot: There is an outlier in Method 7, and hense I need to draw a broken y axis in the plot. How do I do it? in the x axis, it should be [1, 2, 3, 4, 5, 6, 7, ...
Hasalanka Nagahawaththa's user avatar
0 votes
3 answers
114 views

A proper plot of this function with TikZ

Here I am to ask for your help again. I need to plot with TikZ the function $\frac{1}{x+2}$, highlighting the vertical asymptote at $x = -2$. I would like to draw the vertical asymptote in dashed ...
Henry's user avatar
  • 368
0 votes
3 answers
54 views

Coordinates not plotting correctly

I am trying to create the figure (attached), but when I do, my points are not plotting correctly. For example, (0,2), plots (0,-1) (or very close to it). I am not sure what I am doing wrong. I ...
Nick B's user avatar
  • 795
1 vote
1 answer
66 views

Trying to plot using tikz

as usual I feel stupid because I feel that it should be easy but... well here I am... I want to plot this function using tikz : x/3.6 + (x^2)/155 So I tried this : \documentclass{scrartcl} \...
Kawahiem's user avatar
0 votes
1 answer
34 views

Node not showing in plot

I want a node do describe my second function e^{-2t} but it doesn't showing up; this is my code: \begin{tikzpicture} \begin{axis}[ xmin=-3,xmax=3, ymin=-2,...
Dio's user avatar
  • 3
0 votes
1 answer
45 views

How to assign a single figure-number for a group of plots?

I need to assign a single alphabet to a group of plots because I will be creating multiple groups of plots. How can I do this in latex (overleaf)? \documentclass{article} \usepackage{svg} \usepackage{...
skm's user avatar
  • 960
1 vote
1 answer
100 views

How to place nodes on a Tikz plot

I have this curve made with TikZ: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw [cyan,line width=1mm] plot [smooth, tension=2] coordinates { (0,0) (5,...
Andros's user avatar
  • 167
0 votes
0 answers
45 views

How to plot the plane x+z=0

How to plot the plane x+z=0. I took four points on x+z=0 plane to form a rectangle. Is this a correct approach? \documentclass[tikz,border=10mm]{standalone} \usepackage{tikz} \usepackage{tikz-...
math131's user avatar
  • 93
1 vote
2 answers
112 views

to plot the plane of intersection of the sphere $x^2+y^2+z^2=1$ and the plane $x+z=0$

I want to plot the plane of intersection of the sphere $x^2+y^2+z^2=1$ and the plane $x+z=0$. See the edit I have tried to plot it with the help of https://tikz.net/parametric-sphere/. My plane of ...
math131's user avatar
  • 93
0 votes
1 answer
39 views

\tikzpicture vs. axis vs. \pgfmathdeclarefunction vs. \tikzmath vs. \tikzset vs. \def\func

we can declare a function in the tikzpicture options, in \axis option, in \pgfmathdeclarefunction, in \tikzmath, by using \tikzset, by using the \def\func, etc... That is confusing as hell (at least, ...
Rubem Pacelli's user avatar
0 votes
1 answer
47 views

Trying to draw a line using pgfplots

I would like a simple plot that shows a line with a negative slope. I do not want to show a specific line. I am using the package pgfplots. Here is what I have: \begin{tikzpicture} \begin{axis}[ axis ...
Bob's user avatar
  • 255
2 votes
0 answers
59 views

Penrose-Carter Diagrams with Tikz

I am trying to draw the Penrose diagram for the motion of a particle in a Schwartzschild background. I was able to draw the diagram thansk to This article by Izaak Neutelings The code is the ...
LolloBoldo's user avatar
1 vote
1 answer
74 views

reproduce the elliptic hyperboloid

I want to reproduce the elliptic hyperboloid as shown below How to rotate the hyperbola so that the non-drawn hyperbolas could be plotted. My Fig is almost done. Please help me. \documentclass[border=...
math131's user avatar
  • 93
2 votes
1 answer
75 views

Plot a sequence to show the limit, improving the code

I wanted to generate a good figure to show the visual definition for the limit of a sequence. This is an idea so far, but I would like to improve it, for example: How can I delete the thicks on the $...
Henry's user avatar
  • 368
0 votes
1 answer
33 views

Tizk, data visualisation: axes style and dashed ends

I'm sorry to bother you with another question, but I like to learn these things. I am learning about Data Visualisation, Tikz/LaTeX, and as a try I wanted to plot the function $x^2$. Here is my work ...
Numb3rs's user avatar
  • 99
-1 votes
2 answers
57 views

Plotting functions with tikz [closed]

I would like to be able to plot standard function in Tikz, for a document in LaTeX I'm writing. So far, I tried and I used this piece of code \begin{tikzpicture} \draw[->] (-5, 0) -- (5, 0) node[...
Numb3rs's user avatar
  • 99
0 votes
2 answers
104 views

TikZ seems to be plotting the wrong function?

EDIT: I tried to add a domain and it still doesn't work. I'm trying to plot I did this with desmos and I assume it's correct since it solves my y(0) = -1 initial condition. When I use \begin{...
Motik7's user avatar
  • 1
1 vote
2 answers
98 views

How to plot a Hyperbolic paraboloid in a style of the attached figure

How to plot a Hyperbolic paraboloid in a style of the attached figure using only one COLOUR Modify my Code please \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{figure} ...
math131's user avatar
  • 93
1 vote
0 answers
29 views

Resize LaTeX Histogram

I wrote this LaTeX code for generating a histogram. The problem that arises is that the histogram bars overlap and do not appear well defined as there are many coordinates in the graph, namely 1740. ...
MICHELE SPECCHIA's user avatar
0 votes
0 answers
17 views

Access table data to be used for labels on lines plotted in a \foreach loop

I have a large table which contains multiple sets of (x,y) data, and following each such dataset is a constant number, which we can call "C". To save time I want to utilize a \foreach loop ...
Eirik B's user avatar
  • 85
4 votes
2 answers
229 views

How to make a right-handed triad

I want to represent a cross product of two vectors $\vec a,\vec b$. I want to make a right-handed triad. How to draw a screw along $\hat n$ and also how to mark the angle with $\theta$? \...
user1942348's user avatar
  • 1,053
0 votes
1 answer
79 views

Problems with simple bode plots using bodeplot package

I'm trying to plot the most simple Bode plot of the most simple lowpass filter function, given as G(s) = 1/(s+1). Here's my code: \documentclass{article} \usepackage{bodeplot} \begin{document} \...
StringChecker's user avatar
0 votes
0 answers
29 views

Highlight the great circle of intersection when a plane x+z=0 cuts a unit sphere

I want to visualize a unit transparent sphere, highlight the great circle of intersection when a plane x+z=0 cuts the sphere. Also, I want to plot the plane. What to do My attempt: \documentclass{...
math131's user avatar
  • 93
0 votes
0 answers
33 views

I want to plot a sphere showing its spherical coordinates [duplicate]

I want to plot a sphere showing its spherical coordinates. A possible Fig is given below. I want to enhance the look of the Fig with nice colour combination. I have tried the following: \...
math131's user avatar
  • 93
0 votes
0 answers
62 views

How to plot a donut whose Fig is attached herewith [duplicate]

How to plot a donut whose Fig is attached herewith The donut looks very nice. I want to plot it. The parametric equation of the torus is $$x = (R + a cos(p)) cos(t);$$ $$y = (R + a cos(p)) sin(t);$$ $...
math131's user avatar
  • 93
1 vote
0 answers
24 views

Foreach loop doesn't work inside mdframed to draw points

In this case, I would like to plot some points from the graph of x^2 - x - 6 using foreach (coordinate in the MWE). Unfortunately, when I plug the foreach loop, the error stated Undefined control ...
Wilory Lu's user avatar
  • 101
0 votes
1 answer
12 views

Set specific values on x axis on a logarithmic plot [closed]

I made the following plot And it comes from data that I stored on a .csv, now the x axis is on a logarithmic scale and I only want ticks right below the points that are plotted. Fortunately, all of ...
Leonardo Lovera's user avatar
1 vote
0 answers
40 views

How do I draw the integration path in the complex plane in the case with two branch cuts? [duplicate]

This is the picture of a graph I would like to plot. This is what I have tried to do, what is missing is how to align all of the points properly so that it looks nice. \documentclass{article} \...
Giorgio Li's user avatar
0 votes
1 answer
76 views

Why does this MWE not compile (heatmap with contour lines)?

I'm trying to plot some 3D data which is saved in a csv file. Plotting just the color map works fine, but I also need to add the contour lines, so I get a result similar to this: My intuition was ...
Sim Son's user avatar
  • 264
3 votes
1 answer
63 views

Plotting inequalities

I'm trying to plot $x<y$ and $2x<y$, but it doesn't work. What I have: \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} % Draw axes \draw[->] (-4.1,0) -- (4....
Andersa's user avatar
  • 53
3 votes
1 answer
50 views

How to draw a function on a section of a plot

I want to draw the blue "Gaussian" (approximated using sinc) on the black line going through the bullet point exactly like how it rests on the actual axis with its center above the bullet ...
Ahsan Yousaf's user avatar
0 votes
2 answers
54 views

Making array with increment in LaTeX

\documentclass{book} \begin{document} \edef\s{0,45,...,360} \s \end{document} In LaTeX, I don't know how to make an array start from 0 with increment 45 and end by 360. I try to make code ...
Ongky Denny Wijaya's user avatar
1 vote
0 answers
30 views

Help with xinttools

xinttools package allows to plot function summation. Given a function f(x,n), these curves f(x,1) f(x,1) + f(x,2) f(x,1) + f(x,2) + f(x,3) will be plotted using \def\myterm#1{#1*x + 7} ... \...
user3713179's user avatar
0 votes
1 answer
105 views

Plot a summation of cosine wave

I need to draw a wave that is the summation of these cosine waves This is my attempt in LuaLaTeX: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usepackage{luacode} \...
user3713179's user avatar
2 votes
1 answer
223 views

Drawing planes and vectors

What would be the best way to create diagrams similar to those attached? I have briefly looked over the tikz-3dplot package but it doesn't seem very convenient for my purposes. When I'm dealing with ...
MintLemonade's user avatar
0 votes
0 answers
32 views

Plotting log graph with equal spacing between ticks

I'm plotting some results for a article I'm writing and I'm using the following code: \begin{tikzpicture} \pgfplotsset{small} \def\mylistD{50,100, 500, 1000} \def\mylistR{10, 50} \foreach \d [...
Bruno Mello's user avatar
3 votes
1 answer
82 views

Suppressing TikZ errors about calculations

I'm trying to plot the graph of a curve as follows: \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw[->] (-3,0) -- (3,0) node[right] {$x$}; \draw[->...
Long Horn's user avatar
  • 115
0 votes
2 answers
99 views

Tikz Plotting Question

I am having some trouble plotting on Tikz. I want to generate a plot like this, but instead, my Tikz generates this. How can I improve my Tikz? \documentclass[10pt,a4paper]{article} \usepackage[utf8]...
observer_meow's user avatar
2 votes
1 answer
62 views

How can I add a coordinate system to pst-magneticfield?

For an assignment, I'm asked to draw a schematic of the magnetic field due to two circular coils, parallel to the $x$-$y$ plane and at height $z = d/2$ and $z = -d/2$. I have settled on pst-...
TeamPhysics's user avatar
0 votes
0 answers
34 views

centering matlab2tikz tex file in latex

I used matlab2tikz to convert my plot to a tex file and added it into latex but I encountered some problems. Firstly, my plot isn't in the center of the page. How can I tackle this issue? Secondly, ...
Milito's user avatar
  • 45
3 votes
1 answer
42 views

Using pgfplots to display a dataset and a function at the same time not working

As the title suggests, I'm trying to display a data set and a function in the same graph - more or less like this excel graph, with the blue dots representing the data, and the orange line being the ...
m0n74g3's user avatar
  • 77
1 vote
1 answer
59 views

Mimic GeoGebra's grid lines with pgfplots

Using pgfplots, I want to have grid lines similar to GeoGebra's. That is four minor ticks in between major ticks and a lighter color for the minor grid lines: With the help of this post, I managed to ...
Roysten R.'s user avatar
0 votes
1 answer
50 views

How to make a plot with 6 subfigures ( 2 figures in each row*3 rows)?

I am trying to make a plot that would ideally have 3 rows and 2 columns such that the layout is Row Description(A) |fig(a) |fig(b)| Row Description(B) |fig(a) |fig(b)| Row Description(C) |fig(a) ...
Samira's user avatar
  • 3
0 votes
0 answers
55 views

Changing the text format of a particular label in pgfplot

In this plot I want to change the color of a label in x-axis. For example I want to change the color of Set1 to orange. It is possible to do it simply by \textcolor{orange}{Set1}, as you see in the ...
Puya's user avatar
  • 45
0 votes
1 answer
59 views

How to Plot a Vector Field and a Curve on a Single Plot

I am trying to plot a vector field and a circle using the following code. With the code as it is, the blue circle appears off-center. If I comment out that draw command and un-comment the other, the ...
DJJerome's user avatar
  • 4,006
1 vote
1 answer
129 views

pgfplots: plot subset of data from a table using indexing

I have a simple .txt file with 2 columns (x and y coordinates). With pgfplots, it's easy to plot x against y (i.e., all the elements of the 1st column against all the elements of the 2nd column), but ...
TheDon's user avatar
  • 735
0 votes
1 answer
72 views

How to display 0 as the first value in the y-axis with a axis y discontinuity

I have the following graph where I want to skip [0,50) since I won't have y values in this range. However, I want the value before the discontinuity to be 0 instead of 50. Then the first value above ...
Blue Cheese's user avatar
1 vote
1 answer
76 views

Plotting a function with a gamma evaluation

I need your help in graphing some functions within a Latex document. Two or more curves need to be graphed within my report to be placed between two paragraphs. For example, f1(x) =abs((Gamma(1/x) - ...
Mathpro's user avatar
  • 13
2 votes
1 answer
29 views

Grouped Scatter plot not rendering all the data

I have a two data files that need to be plotted in two plots which I am plotting using the groupplots package in pgfplots. The problem is the data in the hxe.dat file is not all plotted. I have tried ...
Satwik Srivastava's user avatar

1
2 3 4 5
23