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
5
votes
1answer
2k views

how to create an histogram with a string label using pgfplots?

Dear i try to generate an histogram / barplot result.csv: overlap,hit,organism 100,274,Unknowns 100,228,Coccomyxa subellipsoidea 100,11,Eukaryota -500,153,Unknowns -500,145,Coccomyxa subellipsoidea ...
5
votes
2answers
733 views

How to plot the graph below?

May I know how to draw the graph as shown below? below is a code I have try but with look and feel that is quite far away from the example: \begin{tikzpicture} \begin{axis}[ legend pos=north ...
5
votes
1answer
826 views

How can I restrict `pgfplots` plot to an interval manually?

OK, I've plotted these graphs but am unable to stretch the second one, so that they both have the same values on the vertical lines drawn from one to another. I've tried to set domain=0:2200 for both ...
5
votes
2answers
465 views

Visualize volume of revolution between two graphs with pgfplots

I am trying to visualize the volume generated by rotating two graphs around the xaxis. For example for the functions f(x) = x^3 + 1 and g(x) = x + 1 (over the interval [0,1]). Here is what I tried so ...
5
votes
1answer
967 views

How to print without the image

I want to print a document without print the images too: just the position of them so the printer make the process faster (I have some big image and i don't want to spend ink and time to print them). ...
5
votes
1answer
570 views

Plotting graph and data with PSTricks: Wrong scaling

Consider the following code: \documentclass{article} \usepackage{pst-plot} \begin{document} % options \psset{ xunit = 5, yunit = 50 } % constants. \def\masse{0.183276667} % kg \def\kraft{0....
5
votes
1answer
145 views

Strange result in plotting data using pgfplots

I'm trying to plot this: \begin{tikzpicture} \begin{axis}[ height=5cm, width=\linewidth] \addplot[smooth,blue] plot coordinates { (27,177) (28,223) (29,240) (30,227) (...
5
votes
1answer
160 views

How to generate a xy diagram with multiple grouped data sets?

Based on the answer of Stefan Pinnow in 'How to group several charts into one chart?', I tried to generate a diagram with multiple grouped data. Therefore, I modified the diagram but I have some ...
5
votes
1answer
788 views

How to add secondary non linear scaled x-axis (1/x) for same data that does not align to linear scale (x) ticks

I want to plot Wavelength and Wavenumbers of one Dataset to one tikzpicture. I found stackexchange: How to have linked axes on plots? but I DONT want to have both axis-ticks aligned to same position. ...
5
votes
1answer
190 views

I am trying to plot area vs volume

I am writing a lab report in chemistry discussing the surface of catalysts. I want to show that area doesn't increase proportionally to volume. I have been trying to plot a function vs against another ...
5
votes
1answer
2k views

Convert image to code (TikZ? PSTricks?)

I have a ... pdf file, which contains figures of plots such as the following: Now the second plot isn't too hard to draw on TikZ (I assume... I hope? I don't have any experience apart from drawing ...
5
votes
1answer
370 views

Creating Tikz Legends in the Caption

I'm having a few issues with creating a legend in the caption of an image. I've made a lot of graphs using matlab2tikz and I've externalised them to reduce my compiling time and memory usage. ...
5
votes
1answer
379 views

pgfplots: Read expression from file

For my lab reports I often have to do complex fitting and transformations to my data (like fitting cauchy distributions or FFT). Fitting with gnuplot sometimes fails and including it directly in the \...
5
votes
1answer
87 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, ...
5
votes
0answers
319 views

Table vs Plot: How to print table of values, with colors representing values [closed]

In an effort to collect knowledge that will ultimately allow me to answer this question, I am seeking a way to generate a table where numeric values are plotted as cell-filling colors. The color ...
4
votes
5answers
8k views

How to plot a simple circle in LaTeX

I want to plot one simple circle, but this code is giving me the most grief. Here is what I have written: \begin{figure} \centering \begin{tikzpicture} \pgfplotsset{ticks=none} \begin{axis}[ ...
4
votes
5answers
1k views

TikZ and analytic geometry

I have four given points, for example A(3,2) B(5,4) C(-3, 4) D(-3, 0) Using TikZ/PgfPlots, how can I draw them in the Cartesian coordinate system, show the points, each accompanied by its name (A,B,...
4
votes
4answers
488 views

Showing discontinuity in graph with intermediate value

How can I make a graph like this in LaTeX? The important things are: the circles at the extremities of the graph, one black and one white the arrows tracing the graph from both sides of the ...
4
votes
4answers
2k views

How to plot a curve in a polar form r = f(Θ)?

Can we use LaTeX to make the graph of $\rho = \sec(\theta)$?
4
votes
3answers
2k views

plotting a linear programming problem

I am a beginner in LaTeX, but I am learning as I go. I want to plot the following linear programing problem: (plot: to make a graphic) f(x,y) = 2x - 3y -> max x + y <= 12 x,y >=0 Here is ...
4
votes
2answers
682 views

How can I create this graphic?

The picture shows a normal linear regression. Although it is easy to compute on paper, I have no idea how to code a linear regression in order to get an output shown as in the picture. I would be ...
4
votes
2answers
420 views

How to plot diagram like a “#” in tikz

I don't know how to plot diagram like a "#", anyone could give some tips? Thank you!
4
votes
3answers
918 views

How to graph an implicit polar equation?

I need to graph the following implicit polar equation using Latex I would be very thankful for any help. Thanks
4
votes
2answers
774 views

How to use Tikz/Pgfplots to plot an algebraic curve on a restricted domain?

I want to plot for example equation y^2 x + x^3-3y^2-2x^2+x=0. But at the same time I need to gray out some parts of the plane (see shaded area). Is there a way to do this?
4
votes
1answer
753 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[(*...
4
votes
3answers
2k views

Problem aligning multiple pgfplots due to different axis label sizes

I have two plots that comes back to back in my paper. One of these plots is generated from 1000 data samples while the other one from 320. The problem that I'm, facing right now, is that plots are ...
4
votes
3answers
419 views

Implicit plot - ellipses

I need to draw a pencil of conics: Given two ellipses $\left( \frac{x}{a_1}\right)^2 + \left( \frac{y}{b_1} \right)^2 - 1 = 0$ and $\left( \frac{x}{a_2}\right)^2 + \left( \frac{y}{b_2} \right)^2 ...
4
votes
1answer
561 views

Financial graph LaTeX style

I am used to work with LaTex, but I am totally stuck trying to plot the following graph and include it in my paper using a LaTex layout. Here below I am also reporting the dataset (markdown does not ...
4
votes
2answers
311 views

Align plots within tikz pictures one above the other

I have an issue I trust you will solve. I am plotting two graphs in order to represent Bode diagrams. For correspondance of abscissa they should be one above the other. I can align the figures but ...
4
votes
1answer
253 views

How to improve visibility of a black and white plot?

I'm plotting information from 10 sets in the same plot. The result is very messy since the lines for each game intersect and overlap with each other, and the width of the final image is small. Here's ...
4
votes
2answers
1k views

Need to plot a function in coordinate system

I would like to plot a rational function in LaTeX. I tried different ways with Tikz or pgfplots... nothing works. There are many different ways. Often there are problems with poles / asymptotes etc. ...
4
votes
3answers
883 views

Horizontal parabola [duplicate]

How does one draw a horizontal parabola, left or right oriented? I can easily draw: \draw[blue, line width=1.75pt, domain=-2.00 : 3.00, samples=1500] plot[smooth](\x, {\x*\x - \x - 2}); and even ...
4
votes
1answer
2k views

Complex function plot using TikZ or PGFPlots

I need to plot some steps of this approximation https://mathoverflow.net/a/27127 but don't know how to start.
4
votes
2answers
660 views

PGFplot producing “noise” (incorrect graph)

Update: This has problems if the samples are one of these: {19,21,23,28,30,31,32,34,36,38,39}, so I think something else is going on. I can get this example to work fine if I reduce the number of ...
4
votes
2answers
152 views

How to draw a graph with label x-axis in word and not number?

I actually want to draw a graph like below: Basically, I want to have a graph using the data below: Testing1 9 3 Testing2 4 5 Testing3 4 5 Testing4 1 4 Testing5 1 5 ...
4
votes
2answers
127 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, ...
4
votes
3answers
174 views

Draw edges with varying/random curvature in TikZ

I want to draw a network plot, but many edges are overlaying. I want to vary curvatures of the edges to make overlaying edges visible. My initial idea was to make the curvature a random uniform ...
4
votes
1answer
990 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, ...
4
votes
2answers
314 views

tikz plot not correct [duplicate]

The following code generates the wrong plot: \documentclass[tikz]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[domain = 0:1, samples = 500] \addplot[color ...
4
votes
1answer
2k views

pgfplot: how to render 3dplot with colors black, white and gray

I my previous question, I rendered a 3d plot, but as I want to print my plots they should be in black, white or gray coloring format. How should I change the coloring scheme? \documentclass{...
4
votes
1answer
2k views

Problem using matlab2tikz

I'm trying to get matlab2tikz to work. I want to use it for prettyfying output of Matlab's image() command. In Matlab I tried imagesc(rand(100)); xlabel('X'); ylabel('Y'); title('Random Colors'); ...
4
votes
1answer
373 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!
4
votes
1answer
683 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: \...
4
votes
2answers
493 views

Plotting a recursive defined set of functions with conditional base function

I'm trying to visualize the construction of B-Spline functions by showing step by step how the curve is created. This involves painting curves similar to these: The function that creates the curve, ...
4
votes
1answer
3k views

How to draw a parametric 3D curve in tikz

I would like to use tikz or a similar LaTeX package to draw the following curve in a three-dimensional coordinate system (t^2, t*(1-t), 1-t) for t in (0,1). Is there an easy way to do this? Thanks!
4
votes
1answer
628 views

How to use Pgfplot to draw vertical lines with use of data taken from file

I have one-column example.csv file with time samples (with different intervals). My question is how to use Pgfplot to generate plot with several vertical lines in time samples taken from .csv file ...
4
votes
1answer
421 views

Coordinate System in Tikz with plottet with one equation

I would like to have this coordinate system (with numbers on the axes): I know how to make it in Tikz; but the numbers on the axes are missing and I would like to add a plot: \documentclass[border=...
4
votes
1answer
192 views

Graph doesn't stay within grid

I've plotted two simple functions in Latex using tikz. It looks like this: As you can see, the curve doesn't stay within its grid. How can I fix this? This is my code. I'm using documentclass '...
4
votes
1answer
936 views

pgfplots: symbolic coordinates with line skipping

I am trying to skip lines inside the symbolic X coordinates of the following pgfplots Bar Chart : \documentclass[a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{color} \usepackage{amsmath, ...
4
votes
1answer
994 views

My personal TikZ template to be easily changed

Every time I need to plot a simple function (eg. a parabola), I use a self-made TikZ template that is: \documentclass{minimal} \usepackage{pgfplots} \pgfplotsset{/pgf/number format/use comma,compat=...