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.

73 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
0answers
701 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 ...
4
votes
0answers
3k views

Force Knitr Figure on same page

I am using Knitr on RStudio. <<glmall, include=TRUE, fig.align='center', fig.cap='Diagnostics plots for full-model with GLM (Poission)', fig.show='asis'>>= par(mfrow=c(2,2)) plot(college....
3
votes
0answers
157 views

pgfplost: Accuracy of the color gradient in matrix plot

I want to plot a matrix with pgfplots to match the style of the rest of my LaTeX document. The desired output is something like this plot from Mathematica: But when I try to plot this data with ...
3
votes
0answers
283 views

Drawing airfoils from .dat external file

I am trying to include plots of airfoils in my report and have tried using this method: http://www.texample.net/tikz/examples/airfoil-profiles/ Initially, I had multiple errors and the document ...
3
votes
0answers
161 views

pgfplots: Best practice to avoid “TeX capacity exceeded” when plotting huge data sets?

I want to create some huge pgfplot with three different axis and a lot of data points. In summary there are 20160 lines of data existent. My problem is: All few hours the values will change ...
3
votes
0answers
174 views

pgfplots - filldraw disappears after adding plot

I have some plots in my graph and want to mark a special area with a square. Here's what the plot looks like: \begin{tikzpicture} \begin{axis}[axis lines = left, xlabel = {Player 1}, ylabel = {...
3
votes
0answers
168 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. ...
2
votes
0answers
53 views

Where is the problem with plotting a graph of function?

Why this doesn't work? \documentclass[11pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{tikz} % package used for the tikz ...
2
votes
0answers
23 views

Is there an easy way to encapsulate a tikz drawing using “plot” commands as part of a node style?

I want to overlay a function on top of a block, as shown in "bounded reciprocal" below. Is there an easy way to do this? Someone had referred me to the approach in my PIctrl shape below but ...
2
votes
0answers
123 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
0answers
148 views

Plotting errors bars with “plot” without using axis environment from pgfplots

In the axis environment of the pgfplots package there is a simple way to add error bars: \documentclass{minimal} \usepackage{filecontents,pgfplots,tikz} \usetikzlibrary{plotmarks} \begin{...
2
votes
0answers
281 views

How to “set format x” to have the format valid with gnuplot+cairolatex

My gnuplot.plt is set up like this set term cairolatex pdf set output "data.tex" set nokey plot 'data.csv' using 1:2 with lines, And I use the output from gnuplot in my latex like this \begin{...
2
votes
0answers
122 views

Inter- and intra-group spacing in bar plots

Can someone help me manage the spaces between bars in a bar plot. I have the following data: 0.0000,0.0001,0.0001,0.0003,0.0006 0.0001,0.0001,0.0003,0.0006,0.0011 0.0001,0.0003,0.0006,0.0011,0.0022 ...
2
votes
0answers
303 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 ...
2
votes
0answers
559 views

Creating figures from matlab for use in latex (problem: activating legend changes figure size)

At the moment I am creating a lot of figures while writing my PhD thesis. As I am using a lot of Matlab I use the function matlabfrag to export my figure to LaTeX: MATLAB h = figure(1); plot(rand(10)...
2
votes
0answers
425 views

How to draw irregular 3d shapes in TikZ?

I would like to draw the cylinder-like irregular shape displayed below using TikZ. I know how to plot regular cylinders using TikZ, however the commands I know don't apply for irregular 3d shapes, as ...
2
votes
0answers
327 views

LaTeX + Gnuplot on Mac: Plot Not Showing

Right. Total novice here so you might need to go easy. I'm trying to use Gnuplot with TikZ to draw an elliptic curve. Using TeXShop 3.58, Gnuplot 5.0 patchlevel 1... don't know what else is relevant. ...
2
votes
0answers
418 views

Tikz: Rational Functions (Hyperbola)

I am aware of similar questions, but as they don't exactly use the same syntax as I am trying to do, I can't see what's different between my way of writing functions down and the others. Here's what I'...
1
vote
0answers
52 views

Removing scientific notation of y-axis

Hello fellows and folks! I am having a very hard time trying to figure out how to remove the scientific notations on the y-axis of my graphs. The graphs are made in MATLAB and then converted into TikZ ...
1
vote
0answers
155 views

Placing marks outside coordinate system with pgfplots

I have a table of data (time vs. time) in a separate file and want to plot it with pgfplots. It works fine, but I have some special values denoting timeout in that table and I want to put them outside ...
1
vote
0answers
56 views

How to draw tan(x) without pgfplot?

I want to know why output of the following MWE is ugly? i.e. yrange=-3:3 has no effect!! \documentclass[12pt]{standalone} \usepackage{tikz} \usetikzlibrary{calc} \usepackage{amsmath} \usepackage{...
1
vote
0answers
579 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 ...
1
vote
0answers
60 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 ...
1
vote
0answers
132 views

How can i make a tornado plot?

I am trying to make a tornado plot that shows what the price will become when i change diffrent values, i want the x axis to be like the picture underneath with 77 as my base cost, but i can not ...
1
vote
0answers
51 views

Sum of sub-bars on top of stacked bars in tikz

I want to be able to display the sum of the values on top of the bars. Below is my code and under that, an illustrated image that displays the values I want to show. Can this be done? \documentclass{...
1
vote
0answers
68 views

Placing numbers at the above and right side of the plot frame

I have the following code for a plot. I need to place numbers of x-axis and y-axis in above and the right side of the plot frame respectively. The code is \documentclass{standalone} \usepackage{tikz,...
1
vote
0answers
61 views

Fixing “broken” peaks in 3D plot

I am currently trying to get a nice smooth 3D plot using tikz, however, I am failing to do so in only one case. The complied file is smooth in most areas, yet, in the "peal" areas, the plot gets ...
1
vote
0answers
78 views

Extract one specific value from table/csv to draw an horizontal line

I need to add horizontal lines (asymptotes) to a plot made from a csv file, with the y-axis value taken from this last. I found an example to draw the horizontal lines \addplot [thick,black] table[x=...
1
vote
0answers
76 views

Set size of \datavisualization

I am trying to plot the function using \datavisualization like this \datavisualization [school book axes, visualize as smooth line, y axis={label}, x ...
1
vote
0answers
360 views

TeX capacity exceeded using Knitr

I am unable to weave a document containing LaTeX and R code using RStudio due what I think are TeX capacity limitations. Is there a way of fixing this without having to compile using LuaLaTeX which is ...
1
vote
0answers
59 views

Show “log-”ticks in the case of small range

I use the pgfplots package. Is there any solution to show the "log"-ticks when the range of the data are small? One solution consists in increasing manually the range using xmin, xmax, ymin and ymax ...
1
vote
0answers
339 views

Equivalent to seaborn's heatmap in tikz from csv?

Is it possible to make a neat equivalent to python's heatmaps obtained with seaborn from a csv file? Example file data.csv: ,a,b,c,d A, 50,-300,-200,-100 B, -20,0,100,200 C, 5,300,40,800 D, 3,30,50,...
1
vote
0answers
269 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 ...
1
vote
0answers
314 views

pgfplots 3D plots size versus 2D plots size

I wanted to create a 3D plot but it's not possible for me to set the right size. Should I try out until I find the right values for height and width for the 3D plot or is there an easy way to find ...
1
vote
0answers
992 views

Making a phase portrait of two autonomous system of differential equations with latex

I am trying to make a phase portrait of two differential equations. The equations are: x'=x-y y'=1-x^2 I have tried to google it, and looked in here, but haven't found a sufficient answer. I did ...
1
vote
0answers
252 views

3D point plot - visualization

I've some points of the form (a+ib, c) where a,b,c are real numbers. I.e. "(complex number, real number)". I would like to visualize these points in a 3D plot such that the x,y-plane represents the ...
1
vote
0answers
179 views

Is there a way i can make psfrag replace every number in a plot?

I want to replace every number in the axis of a plot. Can psfrag do this? If not, is there any other tool i can use to get the same effect?
1
vote
0answers
449 views

central and non-central chi square distribution in one plot with tikz

What I want is to draw a chi square distribution - both a central and non-central into one plot and draw parts of the surface underneath as solid color. Note: I read Plotting the chi square ...
1
vote
0answers
151 views

plot matrix with epslatex

When plotting a data matrix with the plot command and epslatex terminal the generated image is correct. However, the generated latex file outputs also the source path, i.e. 'Date/data_file.txt'. Any ...
1
vote
0answers
692 views

how to create scatter of points?

I am going to teach econometrics soon and as some of you might know, there is this concept of regression where we try to fit a a best plot on the data. I know how to make a graph with just one point (...
0
votes
0answers
62 views

How to plot geographic coordinates with tikz?

Hello I'm trying to plot geographic coordinates of a route between real locations. I'm struggling to show the graph in full page or zoomed in. I searched a bit on internet and I can't seem to find the ...
0
votes
0answers
30 views

Tikz rotatebox gives blurry output

I wanted to write something slanted on the picture and used rotatebox in the node but it gives me a very weird output. Any solution? Codes and output are attached \begin{tikzpicture} \draw[<->,...
0
votes
0answers
42 views

3D plot with disordered coordinates

is there any way to represent a 3D plot with disordered coordinates? For Example: I have done a FE-analysis. There is one beam with two different temperatures on each site. The results from the FEA is ...
0
votes
0answers
49 views

Geodesics on a cylinder

I want to draw the geodesics of the cylinder. Here's my (simple) TikZ code: \begin{tikzpicture}[scale=0.8] \draw (0,0) ellipse (1.5cm and 0.6cm); \draw (0,4) ellipse (1....
0
votes
0answers
22 views

Plot with Gnuplot directly from TeXshop

I would like to plot with Gnuplot directly in a Texshop document. I have Gnuplot installed, TeXLive2020 on Macbook. I use TeXShop and render the PDF with PDFlatex. When I take a sample code, say the &...
0
votes
0answers
53 views

Can't reduce the size of my Tikz figure using ```clean figure``` from matlab2tikz

I have a MATLAB figure that has 3 subplots in it, each subplot has around 45000 points in a scatterplot. Since most of the points cluster around the origin, I tried using cleanfigure from matlab2tikz; ...
0
votes
0answers
31 views

Interactive 3D scatter plot in latex

I want to make in LaTeX an interactive 3D plot where I can rotate the angle with the mouse. The data is: x = [288, 224, 160, 128] y = [[0.5625, 0.28125, 0.21875, 1.1875, 20.375, 4.46875, 2.5625], [0....
0
votes
0answers
47 views

How to create a curve with edges on Tikz

I am trying to replicate the following image on tikz but I can't get the edges right, I know it may have to be something with the tension but if I change the tension I'll end up adding a lot of more ...
0
votes
0answers
22 views

1-D line plot with markers

First time using tikz package for me, essentially I want to publish this I have been fiddling with the tikz package but can't seem to find the commands for this particular case. Any suggestions?
0
votes
0answers
62 views

Complex graphs in LaTeX

I am trying to write all my notes I'm taking from my physics course, but I got stuck in plotting graphs; is there a way I can plot rapidly graphs like these?