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.

53 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
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 ...
4
votes
0answers
2k 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
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 ...
3
votes
0answers
123 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
104 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
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. ...
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
0answers
89 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 ...
2
votes
0answers
129 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
185 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
115 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
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 ...
2
votes
0answers
511 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
376 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
304 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
397 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
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?...
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 ...
1
vote
0answers
81 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
41 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
57 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
54 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
63 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
73 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
234 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
55 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
302 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
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 ...
1
vote
0answers
256 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
852 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
232 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
172 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
389 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
140 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
616 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
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 ...
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} ...
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
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{...
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
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
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 ...
0
votes
0answers
62 views

Matlab2tikz // Error divsion by 0.0

I created a minimal working example in Matlab: [x,y] = meshgrid(-2:0.1:2,-2:0.1:2); fx = x.*y; fy = x.*y; figure quiver(x,y,fx,fy) matlab2tikz('plot.tex'); This works great and creates the plot....
0
votes
0answers
131 views

plot a data file as a contour plot in a specific region

I have a set of data and want to be plotted in a specific region. I draw the region using tikz and when I want to add the data as a contour plot in the region, I don't get the results. How can I Plot ...
0
votes
0answers
41 views

The scale of the X-axis bar is far away

I am attempting to create a box plot with very large numbers(using tikzpicture), so I expect their to be smaller numbers on the X-axis but the scale denoted on the graph. THe problem is that scale is ...
0
votes
0answers
769 views

EMF figures in LaTex

I am slowly learning and shifting to latex. Figures I have produced till now are all .emf format and now I am unable to load them into latex. Kindly suggest what could be done. Please do not suggest ...
0
votes
0answers
83 views

How to draw a 3D plane, whose coordinates must also obey an inequality?

I'm trying to plot the plane x+y+z=0 subject to the constraint x < y < z. This should yield a triangular plane that extends out from the origin. I don't understand how to render this in tikz-...