{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
1k views

How to generate stem plots with TikZ like stem() in Matlab?

Given a set of (x,y) coordinates stored in a file, how could I generate a stem plot from those coordinates? I would like to achieve something similar as the matlab's stem function: ...
8
votes
1answer
814 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
971 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
613 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
326 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
139 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
1k 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
198 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
2k 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
357 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
3answers
300 views

How can I plot the F distribution

I wish to plot the F distribution by declaring its density function. However with the following code I get an error saying that fdst has not been declared: \documentclass[border=5mm]{standalone} ...
7
votes
2answers
431 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
2k 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
203 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
543 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
3k 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
684 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
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
355 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
620 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
372 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

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
727 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
297 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
342 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
206 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
532 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
464 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
271 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} ...
6
votes
2answers
8k 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?
6
votes
3answers
1k 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, ...
6
votes
2answers
294 views

drawing smooth path through symmetric points, gives non symmetric curve

I want to make a graphic going through some points. I've choose the points symmetric, to have a symmetric curve, but the curve is not. I could define some extra points, but their must be a better ...
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
3answers
398 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
1answer
538 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
1k 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
503 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
668 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
2k 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
75 views

Equivalent to “shorten <=” for intermediate points

Halo everybody, I try to plot a data set using tikz & pgf. I want that the points in the plot are connected, but the line shouldn't touch the points. I can achieve this for the first and the last ...
6
votes
1answer
373 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
2answers
202 views

Nodes near coord overlapping…how to shift up

I am using nodes near coords but as you can see the values on the bottom are overlapping. I have tried placing them manually but that hasn't worked either...How to just shift up the nodes so they do ...
6
votes
1answer
2k 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
2answers
96 views

Scale the Axis in Tikz

I have the following problem: \begin{center} \begin{tikzpicture}[scale=0.5, >=latex] \draw[->] (-6,0) -- (6,0) node[right] {\scriptsize $x$}; \draw[->] (0,-5) -- (0,15) node[above] ...
6
votes
1answer
109 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
980 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
78 views

PGFplots: How to add a legend to “superimposed” plots

I have "superimposed" different plots on the same graph (i.e., I have two axises environments in one tikzpicture environment.) Now I would like to add a single legend for both of the plots and ...
6
votes
1answer
1k views

TikZ plot: centering and units on axis

I have the following. I'm trying to center the plot and putting \begin{center} around the TikZ image does not work. Also I'm trying to change the units of the x-axis. The x-axis is used to ...
6
votes
1answer
670 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] ...