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

Evenly space yticks in pgfplot

My code \documentclass{article} \usepackage{pgfplots} \usepackage{filecontents} \begin{filecontents}{filename.csv} Month, Year, Host-Count Jul, ...
4
votes
1answer
646 views

How to use a summation in a tikz plot

I need to plot this function using tikz, but I have no idea how to go about using the summation in tikz. If someone could help me I would really appreciate it. The code I have is this: \...
1
vote
1answer
57 views

Latex plots wrong curve

I have the following code \begin{tikzpicture}[domain=0:10] \begin{scope}[xshift=4cm, scale=1] \draw[->] (-0.2,0) -- (10.5,0) node[right] {$x$}; \draw[->] (0,-0.5) -- (0,6.5) node[above] {...
2
votes
2answers
144 views

This compiles to create a straight horizontal line rather than the cosine plot I was going for

\documentclass[12pt]{article} \usepackage{amsmath,amssymb} \usepackage{graphicx} \usepackage{physics} \usepackage{mathtools} \usepackage{TikZ} \usepackage{PGF} \begin{document} \begin{tikzpicture} \...
0
votes
1answer
345 views

How can I make an interval plot?

Any one knows how can I draw this kind of interval plot and what package can I use? Note that in my case I want to be able to use intervals in a way that a bar is plotted from a to b, and then from c ...
2
votes
1answer
225 views

cdf in tikz, plotting the wrong values

Im trying to plot a cdf in tikz, however it is plotting the wrong values and I have no idea why. \documentclass{article \usepackage{pgfplots} \usepackage{tikz} \begin{document} \begin{tikzpicture}[ ...
2
votes
1answer
149 views

Tikz isn't plotting the right function

Im trying to plot a probability function in tikz, but the line plotted isn't even close to how the function should look. Im new to using latex and I have no idea why this isnt working, unless tikz ...
0
votes
1answer
132 views

Random bar graph in tikz

Is it possible to generate a random bar graph in latex? The only way to do this seems to be using the tikz package. Is there any code for this Thanks and regards
2
votes
0answers
247 views

3D Piecewise function using pgfplots

I would like to know how to draw the discontinuities of a piecewise function, but using the addplot3 (that is, surface). For instance, consider the example here, you can see that the discontinuities ...
0
votes
1answer
220 views

Importing plots from third party tools

After working on some data in Octave, I need to export the resulting plots (made up of multiple curves and including axis labels and legends) and include them in a report. My first choice (that I had ...
1
vote
1answer
219 views

How to exclude specific numbers from definition set of pfgplot?

I want to plot y = (3x²-3) / (x+1)(x-4): \begin{tikzpicture} \begin{axis} \addplot[ domain=-2:10, samples=50 ]{(3 * x^2 - 3) / ((x + 1) * (x - 4))}; \addplot[ mark=square, ]...
2
votes
1answer
140 views

plot always plots relative to origin

I am trying to use plot to draw a sine somewhere in a picture. I expected the coordinates to be relative to the current coordinate, but they seem to be relative to (0,0). Below is an MWE that does not ...
2
votes
1answer
1k views

3D plot with pgfplots

I am trying to plot the function $U(x,y)=6*\ln(x) + \ln(y)$ for $x=1,...,4$ and $y=1,...,14-3*x$, however, I can't specify that the domain for $y$ is a function of $x$. MWE: \documentclass[tikz,...
1
vote
1answer
715 views

How to draw general functions and tangent lines

I wanted to draw following graphs of two general functions of Geometric interpretation of the Euler method. Thanks in advance
3
votes
1answer
1k views

How to draw a plot with a zoomed in portion next to it?

How to add zoom area and to give and label top x axis? Here is my code: \begin{tikzpicture} \begin{axis}[ scaled ticks=false, xmin=0, ymin=0, xlabel=In, ylabel=out, ] \addplot[...
1
vote
1answer
72 views

Two curves in one plot

I have three vectors f, min(D_{T_{f}}) and max(D_{E_{f}}). These vectors are as follows: f=[\begin{matrix} 11&15&19&23 \end{matrix}], min(D_{T_{f}})=[\begin{matrix} 1&0.5&1.9&...
0
votes
2answers
67 views

Tikzpicture: A plot isn't where it should be

I have been trying to add a plot using Tikzpicture, but it does not locate well in the graph. Here is my code: \usepackage{tikz} \usetikzlibrary{calc} \begin{figure}[h] \centering \begin{tikzpicture}[...
1
vote
0answers
72 views

how to plot a graph in wherever of a table [closed]

how to plot a graph in wherever of a table like in a \multicolumn or \multirow cell? I tried tikz package, but the coordinate of the tools like draw was hard to be fixed. BTW, I found the manual of ...
0
votes
0answers
144 views

Plotting the graph of a integral function [duplicate]

I would like to know how I can plot the graph of the following function in Latex or Tikz. $f(t)=\frac{\int_{-\infty}^{t}\alpha(s)ds}{\int_{-2}^{-1}\alpha(s)ds}$, where $\alpha: \mathbb{R} \...
1
vote
1answer
373 views

Plot bar graph using table data

I am trying to plot this kind of graph using pgfplots here is my code: it is showing error pls help me \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ xlabel=Year, ...
3
votes
1answer
572 views

Pgfplots: One Colorbar, two scales

Is it possible for one colorbar to have two different scales? Like mentioned in this question: Matlab colorbar with two axes? I'm trying to include two heatmaps with a colorbar in the center. As both ...
0
votes
2answers
530 views

Plot better graph using a vector of data X and Y

I tried to plot my data using some packages but I didn't get something nice. I've data like this: X=[590 598 599 600 601 602 603 604 605 606 607 608 609 610 611 627 628 629 634 641 642 644 645 648 ...
3
votes
1answer
536 views

Remove duplicate labels with symbolic y coords

I am new to pgfplots and have a problem with the following example: \begin{tikzpicture} \begin{axis}[title = Some fancy benchmark data, xbar, y axis line style = { opacity = 0 }, axis ...
1
vote
1answer
215 views

Connecting pairs of points from separate plots

I have two scatter plots coming from one single csv file. no,id,x,y,x_proj,y_proj 1,1,565,417,565.6,393.3 1,2,315,234,334.8,193 1,3,949,355,944.8,346.3 I would like to link each point that has the ...
1
vote
2answers
315 views

Drawing plane distribution in 3D

I would like to draw a plane distribution with TikZ. Here is how it should look like: I know how to draw a plane with the coordinate axis, but don't know how to draw planes depending on the base-...
0
votes
1answer
110 views

“Waved lines” on a 2D coordinate system [duplicate]

Good evening everyone. I have this code that I slightly need to modify to make the "wave curves" as showed in photo I attach here. \documentclass{article} \usepackage{tikz} \begin{document} \begin{...
6
votes
2answers
1k views

XYZ Coordinate System Drawing

I am beginner and I'd like to know if it is possible to recreate this image in Latex. I've tried to find some examples to help me, but I didn't succeed. Thanks in advance
1
vote
0answers
2k views

Vertical bar chart with different colors for each bar [duplicate]

I'd like to create vertical bar chart with different color for each bar (each bar represents different landuse) my current output is I have alerady tried adding each bar as a different plot, but ...
0
votes
0answers
302 views

How to plot linear histograms with Latex? [duplicate]

I have been reviewing how to plot a line histogram on data of my results. I have searched and only see how to plot in bar histogram, but I have not seen any construction of one of lines in latex. I ...
1
vote
0answers
233 views

pgf file overlap in labels of bar chart

I am trying to import a bar chart I created using python and Matplotlib into my LaTeX document. However when I save the chart as a pgf file and import it into my document there is always a slight ...
0
votes
1answer
82 views

tikz Graph scaled to point

I had a graph, that I remember working fine in the past, and suddenly I noticed, that everything is scaled to a tiny point at the bottom of the y-axis. I am not sure if anything at all changed and ...
5
votes
2answers
581 views

how to plot multiplication of two functions in latex

I'm new to latex and am trying to plot f(x)=sqrt{2/pi}*exp{-x^2/2} I managed to plot the exponential part easily but when I multiply it by the square root 4 errors occur. This is my code: \...
-1
votes
1answer
119 views

Wrong height in TIKZ diagram

I have the following: \begin{tikzpicture} \def\xmax{110} \def\ymax{1} \def\q{10} % Normalization \def\ha{101} \def\hb{210} \def\hc{340} \def\hd{553} \def\he{701} \def\hf{998} \...
0
votes
1answer
69 views

wrong picture from tkz plot

I cannot found my error. I tried to draw a function, but Latex makes an error. Here the code: \documentclass[a4paper,11pt]{article} \usepackage{tikz, tkz-euclide} \usetikzlibrary{calc,intersections,...
1
vote
1answer
429 views

Shift plot in pgfplot

I want to represent the plot for an isothermal ideal gas transformation. I tried the following: \begin{tikzpicture} \begin{axis}[ axis lines = left, xlabel = $V$, ylabel = {$p$}, ] \...
1
vote
1answer
331 views

How do I plot multiple iterative functions (or recursive sequences) on one graph with TikZ? [closed]

I'm trying to plot several (4) numerical sequences in TikZ. Each of these sequences should be obtained by iterating the following function, a*x*(1-x) where a is a parameter that varies across the ...
0
votes
1answer
105 views

How can I make a graph of this function?

I need to draw the function f(x) = -5/16x^4 + 3/4x^3 + 1, and I have no clue how to do that. I've done something similar to what I need like this: \draw[thick,color=blue] plot[samples=50, domain=-1....
4
votes
1answer
943 views

Pgfplots: Generate points randomly

I have a very simple pgf plot, like this: \pgfmathdeclarefunction{gauss}{2}{% \pgfmathparse{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}% } \begin{tikzpicture} \begin{axis}[ height=4cm, ...
1
vote
1answer
284 views

How can I plot the value in the table?

This is my work so far. %% document class \documentclass[a4paper]{article} %% packages % ----- Preamble ---------- % \usepackage[margin=1.5cm,top=1.2cm]{geometry} % géométrie de la page. \...
6
votes
1answer
5k views

Plotting a piecewise function

I'm trying to learn to plot in latex, but I'm having a problem trying to find out which packages that are best to use in this situation, and I find it a bit of a learning curve. Suppose you have the ...
3
votes
0answers
135 views

Conditional plotting with quiver

I am trying to plot two vector fields (x,y) and (-y,x) on a manifold where the norm is given by $x^2 - y^2$ instead of $x^2 + y^2$. Furthermore, I want the vector fields to be only plotted if x>y. ...
6
votes
1answer
493 views

How to create a Ricker Wavelet in TikZ

Is there an easy way to create this wavelet in TikZ. Following the formula I have which is (1-2pi(x)^2)(e^-pi(x)^2) but when trying to create this I arrived at the issue that the function I have ...
1
vote
1answer
61 views

PGF Plots stacked bar weird behavior

I have a problem with the following pgfPlot, after changing some of the values, it's left padding is gone (see image) - does anyone have an idea why? I have tried changing xtick, changed some values, ...
22
votes
5answers
2k views

TikZ silhouette of human face seen from the side

I am trying to make this picture in TikZ. I wondered if anyone had already needed a silhouette of a human face, and therefore maybe had some code for a plot or something. Just in case anyone had ...
1
vote
1answer
235 views

Is there any package for inclusion of data in vcd format?

I need to include some figures of simulated verilog waveforms in a report. The last 20 years I have typically made a ps/pdf printout from a waveform viewer (such as gtkwave), and included the ...
3
votes
1answer
1k views

pgfplots: Use strings as barchart labels from .csv

I'm trying to plot a vertical bar chart using pfgplots that has strings as labels for the bar charts. (This question has been asked before, but I'm hoping there is a cleaner way to do this now. ...
1
vote
1answer
387 views

Background fill with pgfplots inset

I am trying to add an inset to a plot. I used this answer as a guide to get started, but the inset plot is transparent. Adding axis background/.style={fill=white} to the inset plot fixes the ...
0
votes
1answer
166 views

Depicting a .dat file into a contour plot in Latex [closed]

I have prepared a .dat file containing some numerical information of probability related a specific radial function. I want to depict these information in a contour plot like the attached figure. The ...
3
votes
3answers
166 views

Dot in Range Box Plot

I'm attempting to make a table that visually mimics the WSJ markets page. Specifically, I'm hoping that there's a simple way to implement the visual from the Range column: It seems plausible to me ...
3
votes
1answer
129 views

Swap colors of plots

I want to swap two plot colors in my figure. Please take a look at this: As you can see, the "short-run" graph is omitted in the second figure. Thus, in order to reduce confusions when studying the ...