{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

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'); ...
14
votes
4answers
2k views

Plotting the solution of inequalities with WolframAlpha or Maple

I want to plot the solution of two inequalities and include them in a LaTeX paper. I really like they way this looks: Wolfram Alpha. Unfortunately, I have no idea how to export this into a ...
3
votes
1answer
796 views

Strange behavior in smooth pgfplot with sudden changes in the slope

I'm trying to plot some points with sudden changes in the slope. But I get some strange behavior like this: as you can see in the peaks, there is no smoothness in there. However, I think the ...
3
votes
1answer
384 views

PSTricks---plotstyle LSM (Least Square method)

I am discovering PSTricks's plotstyle=LSM to make a regression analysis y=m x + c. Here is my code: \documentclass[12pt]{article} \usepackage{filecontents} \begin{filecontents*}{data.dat} 0.0 0.0 ...
1
vote
1answer
723 views

PSTricks and large numbers in graphics

I am trying to use PsTricks to plot large numbers. In Herbert Voss's PSTricks: Graphics and PostScript for TeX and LaTeX book (German edition, 2007, 4th edition), there is the code: ...
7
votes
3answers
348 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
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 ...
4
votes
2answers
3k views

Bar plot labels and grids

\documentclass[a4paper,11pt]{report} \usepackage{tikz} \usepackage{verbatim} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ title = {Optimalization based upon co-occurences}, ...
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 ...
7
votes
1answer
672 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 ...
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 ...
10
votes
1answer
939 views

TikZ: Fill (closed) parametric plot of catacaustic

Is there a trick to fill the parametric plot of a catacaustic which looks closed but isn’t closed in TiKZ meaning. The Problem is the egdge which looks closed but isn’t it … I guess I can ...
17
votes
2answers
4k views

Is plotting exponential graphs a known source of bugs in TikZ?

I want to plot $y = 2^x$ over a small domain. Unfortunately, even though tikz (v 2.1) seems to be able to calculate 2^{negative numbers} it is not plotting them correctly. My minimal example is: ...
9
votes
1answer
502 views

Using pgfplots with a0poster

I want to use tikz/pgf to plot some graphs in a poster done with a0poster. That is the code: \begin{tikzpicture} \begin{axis}[xlabel=lambda, ylabel=int] \addplot[blue] table [mark=none, col ...
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 ...
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} ...
3
votes
2answers
1k views

Area between curves

I want to fill the area of a region R bounded by x=f(y), x=g(y), y=A and y=B. For example, R is bounded by x=0, x=2/y, y=1 and y=4.
12
votes
2answers
2k views

Plot reciprocal function with tkiz

I need to plot f(x) = 1 / x in LaTeX and am trying to with Tikz. I haven't found a way to set the vertical range, so the values go out of bound around x=0. Using gnuplot directly doesn't seem to be ...
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
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.
8
votes
1answer
1k views

Pgfplots: plot graph inside table

I would like to plot a table with a graph inside it. I am trying to use this example as a guide. This is the current hand-constructed version. UPDATE: I don't have enough reputation to answer my ...
9
votes
1answer
1k views

How to have linked axes on plots?

I plot infrared spectra in many reports and I display the energy units in two ways, wavenumbers $cm^{-1}$ on the bottom x-axis and wavelength (nm) on the upper x-axis. The relationship is ...
13
votes
2answers
2k views

inset plot with pgfplots

I am using pgfplots to plot some data I have, and I wanted to generate a large plot with another plot inside of it, showing a zoom on a region of the large plot. I have noticed that when you do ...
4
votes
2answers
465 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 ...
13
votes
1answer
2k views

Plotting an implicit function using pgfplots

What is the correct way to plot an implicit function using pgfplots? Consider the following example: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} ...
17
votes
4answers
4k views

Fill the area between two curves calculated by pgfplots

This is essentially the same question as fill the area between two curves when their coordinates are known. In that question, the curves were defined by known coordinates. I want to fill the area ...
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?
2
votes
1answer
708 views

Two color line in gnuplot

Is there any way to plot a line graph where each series is plotted with two alternating colors? For example, say I was plotting the population of bees over time and I wanted the line to alternate ...
35
votes
1answer
8k views

Bell Curve/Gaussian Function/Normal Distribution in TikZ/PGF

Can anyone tell me how to plot a gaussian function/bell curve using TikZ/PGF? I'm basically looking to implement something like PSTricks's \psGauss command.
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.
20
votes
2answers
3k views

Fill between two curves in pgfplots.

How to accomplish fill between two curves in pgfplots? For example, I have ... \addplot coordinates {(0,1) (1,1)}; \addplot file {something.dat}; ... and I would like to have filling between those ...
4
votes
1answer
663 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 ...
8
votes
3answers
590 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. ...