{plot} is for questions concerned with plotting data or functions using TeX. For questions specific to the pgfplots package, use the {pgfplots} tag.

learn more… | top users | synonyms

8
votes
1answer
706 views

How to project a function over a 3D plane

When I looked up the method to express two variable functions as a sequence of intersecting horizontal planes, I thought to use PGFplots to construct a simple set of "slices" of a generic function ...
8
votes
1answer
808 views

Pgfplots contour gnuplot crazy labels

This is driving me mad. I am tryng to create some contour plots, but I get them full of labels, so that they are unreadable! I can't even see the lines or read the values because they are too much. I ...
8
votes
3answers
593 views

How to speed up a large plot?

I have a large plot. It is a big file and it renders slowly. What is the best method to slim it down without loosing to much of its visual properties ? I know that PDF and PS support cubic splines. ...
8
votes
1answer
308 views

proper tool for charts in tex

I have scanned data graphics in a large ms written in TeX (of course). For copyright reasons I need to redraw these. My publisher may (sadly) decide not to use my source directly, so will need access ...
8
votes
0answers
133 views

Is there a better way to display this information? [closed]

I have drawn this picture in tikz. Is there a more visually pleasing and intuitively appealing way of displaying this information? I feel what I have drawn is dull and boring. I have to include more ...
7
votes
3answers
779 views

Weird result plotting sin(x) using tikz/pgf [duplicate]

Trying to plot the sin(x) function, I get this result: The MWE is here: \documentclass{standalone} \usepackage{ pgfplots} \begin{document} \begin{tikzpicture} \begin{axis} ...
7
votes
2answers
180 views

Why does a plot of a reciprocal function using pgfplots look wrong?

I am trying to plot the function 1/x^2 but the result is obviously wrong, here is how it looks like here is the code \begin{center} \begin{tikzpicture} \begin{axis}[ %xlabel=$x$, ...
7
votes
5answers
2k views

How can I draw dirac deltas with arrow heads with pgfplots

I would like to draw this in pgfplots: I've tried this, but I can't figure out how to get the arrowheads. \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} ...
7
votes
2answers
1k views

Easy creation of logarithmic grid with TikZ

Is it possible to create a logarithmic grid using the command below with TikZ? \draw (-0.1,-0.1) grid (4.1,4.1); It would be great to be able to create a logarithmic grid without having to specify ...
7
votes
3answers
350 views

Which plotting tool is more likely to stay stable in the basics: MetaPost, PStricks or pgfplots?

I have been looking at the three (major ?) tools---MetaPost, PStricks or pgfplots for plotting data together with LaTeX. My experience is this: MetaPost code can demand lots of lines for simple ...
7
votes
2answers
411 views

Comparison of pgf plotting packages

I know three ways to do function plots based on the TikZ/pgf package: TikZ/pgf directly pgfplots tkz-fct Which of those options is the most powerful? Why? Can you give typical cases where one ...
7
votes
5answers
1k views

Tangents to a circle from a point outside of it (tikz)

I'm trying to plot in TikZ the two tangents to a fixed circle passing through a given point. In some details, given an arbitrary circle centered at C with with radius r, and a point P outside of the ...
7
votes
2answers
183 views

Plotting 3-dimensional Sets

I am using MikTex and Texworks with pgfplots to try and plot 3 and 2-dimensional sets Could some of you nice fellas help me out? I am trying to plot: I can print out the page and draw per hand ...
7
votes
2answers
476 views

How to plot a discontinuous function curve and diagram of Markov chain with TikZ?

Please apologize my ingnorance of tips to use for asking questions. I would like to realise the plots and the diagram like those shown on page 158, 160 and 161 on this document Chaine de ...
7
votes
1answer
596 views

Graph showing functions over the same x and y ranges

I want to draw functions and have used this code. But I don't like to give every function a separate domain, I want to say this function has ymax=4 and ymin=-3. Who can help me? ...
7
votes
1answer
2k views

Center nodes near coords in a stacked ybar plot

I'm trying to center the node values, at the middle of each bar, in a stacked plot. However I can only put those nodes in the top of each bar. Is it possible to move those down? To the center of each ...
7
votes
1answer
4k views

Plot a function of a binary logarithm with TikZ

How do I plot a function of a binary logarithm with TikZ? Say that I want to plot f(x) = log_2 x.
7
votes
1answer
312 views

How to draw dash-dotted curves using MetaPost?

Is it possible to (easily) draw dash-dotted curves in MetaPost, i.e. curves that alternate between a dash and a dot? For either dashed or dotted curves, I use the draw command and end it with dashed ...
7
votes
1answer
593 views

How can I place numbers into marks of a plot?

I have the following plot with this latex-source: \documentclass{minimal} \usepackage{tikz} \usetikzlibrary{plotmarks} %%%< \usepackage{verbatim} \usepackage[active,tightpage]{preview} ...
7
votes
1answer
334 views

TikZ doesn't find all intersections between plot and a line

Why doesn't TikZ find all intersections. They are obviously there … \documentclass[border=10mm]{standalone} \usepackage{tikz} \usetikzlibrary{intersections} \begin{document} ...
7
votes
1answer
1k views

How can I display tick marks on only one axis of a pgfplots graph?

How can I display tick marks on only one axis of a pgfplots graph? Here is some simple code to work with: \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} ...
7
votes
1answer
1k views

Draw outside axis with pgfplots

I have the following diagram, and would like to extend the red line so it crosses the axes and goes on for a bit at the start and the end like in the second picture, but I would like the red and blue ...
7
votes
1answer
676 views

tikz: plot stepped gauss

I need to plot a stepped gauss curve as shown below. Yet I want to do this dynamically (in text) so I can alter it later. I know how to plot a smooth gauss but I really need the stepped one. Also a ...
7
votes
1answer
212 views

Color and legend for 3d surface

I'm trying to plot a 3d surface using pgfplots and this is what I have done so far: \usepgfplotslibrary{patchplots} \begin{tikzpicture} \begin{axis}[% width=12cm,height=12cm, xlabel={$J_1$}, ...
7
votes
1answer
293 views

Huge table/matrix with colored boxes

I have a huge CSV file with about 25.5k records that (structurally) looks like the sample below. In essence, I want to display the values of the columns U,V,W,X,Y,Z of each row as a colored box. The ...
7
votes
1answer
116 views

Tikz: Correct arrows at the end of parametric curves?

\documentclass[11pt]{amsart} \usepackage{tikz} \begin{document} \begin{tikzpicture} [scale=4] \draw[domain=0:0.4, smooth, variable=\t, samples=200, ->] plot({(1/sqrt(2)*(\t-\t^3)}, ...
7
votes
1answer
458 views

Create a Shmoo plot with pgfplots/tikz

I'm interested in creating a Shmoo-plot using LaTeX. I have looked through the PGFplot-examples but couldn't find any that looked suitable as a starting template. Google produces nothing as well, and ...
6
votes
2answers
432 views

Rindler coordinate chart (family of parametric curves) in TikZ

Is it possible to make a plot like this with TikZ or other drawing packages? This plot visualizes a two parameter family of curves, given by T = x Sinh(t) X = x Cosh(t) The pink curves are ...
6
votes
3answers
353 views

Calculate function with integers as input and plotting

I'd like to plot the function 1/2*x(x+1) in for integer values ranging from 3 to 20 and in particular I'd like the function to be plotted in those points. I have managed to create the following graph ...
6
votes
2answers
4k views

Proper way to change axis in plot tikz

I am trying to reconstruct the image below in tikz, and I think I have done a fairly decent job. The problem is that my code is a mess. Is there any simple clean way to produce this image? My ...
6
votes
1answer
478 views

Plotting a straight line to the peak point of a graph

For the MWE below: \documentclass{report} \usepackage[left=2.5cm,right=2cm,top=2cm,bottom=2cm]{geometry} \usepackage[T1]{fontenc} \usepackage{pgfplots} ...
6
votes
2answers
783 views

Draw angle between two lines in a circle

I'm trying to draw an angle between two lines. I have this code so far, but i cant draw a angle. How do I do it? I'm using PGF/TikZ. \begin{figure} \begin{tikzpicture} \begin{axis}[ ...
6
votes
2answers
463 views

Plot basic complex transformation in LaTeX

I want to first draw a shaded region on a xy-plane: 0≤x 0≤y≤π and then the image of the above region mapped onto a uv-plane by the transformation f=exp(z), i.e. the shaded region: ...
6
votes
1answer
635 views

Making the y-axis range of a plot have more values in some parts

For the MWE below: \documentclass{report} \usepackage[left=2.5cm,right=2cm,top=2cm,bottom=2cm]{geometry} \usepackage[T1]{fontenc} \usepackage{pgfplots} \begin{document} \begin{figure}[H] ...
6
votes
3answers
1k views

Plot a matrix of real values with TikZ/PGF like imshow in matlab

How can I plot a matrix of real values with TikZ/PGF such that it looks like plotted with imshow in MATLAB? \addplot3 does something similar, but I'd like to have that in a color-coded 2D plot.
6
votes
1answer
51 views

How do I stack two figures on top of each other, rather than side to side?

I'd like my figures to be one on top of the other, rather than next to each other, so that they are larger and spread along the page width. How do I do this? Here is my code: \begin{figure}[H] ...
6
votes
1answer
1k views

error bar colors in scatter plot

A data file contains four columns: x, y, error on y, class. class is an integer which I feed to scatter src so i get a graph that has different colors for different classes. However, the error bars ...
6
votes
1answer
93 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) ...
6
votes
1answer
886 views

Add fancy design to pgfplots (shadows, rounded corners, reflections)

In our company we would like to run the client reportings in LaTeX, which works quite well, but we are struggeling with the design requirements for plots - we use pgfplots. Our aim is to get those ...
6
votes
1answer
565 views

Labeling a function's plot generated by “plot function” [duplicate]

Possible Duplicate: How to label a path drawn using tikz with \draw plot? Consider plotting a parabola using the following code: \begin{scope}[domain=-2:2] ...
6
votes
1answer
331 views

Plot functions and data together using PSTricks

I would like to create the following graph using PSTricks: The data, which can be downloaded from http://gupl.dk/705644/, should be plotted together with the three graphs. I have managed to plot ...
5
votes
5answers
219 views

How to plot a complicated multi-variable function in a tex document automatically, not just importing an image

I have the following Tex functions and I want to plot them in my tex thesis, but I don't know how. I mean, I want the Tex to draw the function, not just to include an external image to it. ...
5
votes
4answers
403 views

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

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

Why must the independent variable of a function to be plotted be a macro in TikZ?

Consider the following code (taken from Jake's answer) and focus on the variable of the function to be plotted. \documentclass[border=5pt,tikz]{standalone} \begin{document} \begin{tikzpicture} ...
5
votes
2answers
7k views

How to plot f(x)=sin(x), k(x)=cos(x) and u(x)=x² with TikZ

How can we plot the following three functions f(x) = sin(x) k(x) = cos(x) u(x) = x² for x ∈ [0,1] on a single plot with the help of TikZ?
5
votes
2answers
218 views

Error: “Dimension too large…” when plotting EXPONENTIALS with TikZ

Despite having read answers to 4-5 relate questions, I still can't get why my code does not compile. Here it is: \documentclass[11pt,twoside]{book} \usepackage[paperheight=24cm, paperwidth=35cm, ...
5
votes
2answers
2k views

Fill area of curve above a line using pgfplots

This question is related to Fill between two curves in pgfplots. which started me of. However, I need to have just the area above the reference line filled. \begin{tikzpicture} ...
5
votes
2answers
176 views

Fourier Spectrum conversion from 3D to 2D

I am delighted to have the link ORIGINAL LINK However, I have modified the graph to suit my purpose but it's still in xyz-plane. Actually, I want to have the same graph in xy-plane. My MWE is as ...
5
votes
3answers
262 views

How do I draw graphs?

I'm new to Latex and I think I am going to use it for my physics classes in school. I have found a really good template: https://www.sharelatex.com/templates/journals/aip/ (I use sharelatex) which is ...
5
votes
2answers
143 views

Is it possible to extrapolate data for a 3d-plot in pgfplots?

I am having several measurements to plot and would like to use something like a 3d surface from pgfplots. I am having a frame as outer border and a grid as measurement raster. The measured values are ...