{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

11
votes
1answer
2k views

pgfplots - Placing Nodes on x Coordinates of a Plot

I want to plot some graphs in pgfplots and want to place nodes on the exact same x coordinate of the plot. The position of the note has to be set in x direction but free in y direction. Here is one ...
0
votes
1answer
395 views

Winbugs plots in latex

I conducted a bayesian analysis and obtained some plots in winbugs. Does any one how to put the history graphs in WinBUGS in Latex? I could not save the plots as pdf.
8
votes
1answer
261 views

Tikz plots distorted mark

Consider the following code: \documentclass{minimal} \usepackage{tikz} \usetikzlibrary{plotmarks} \begin{document} \tikz{\draw (0,0) -- plot[mark=o] (0.5,0) -- (1,0);} \end{document} It seems ...
4
votes
4answers
2k views

Multiple subfigures not appearing on the same line

Multiple figures under a single caption. I have tried a code to put two images in a together under a same caption. The subfigures do not appear on the same line. The code is : ...
9
votes
1answer
731 views

Plot functions and their point of intersection

We are plotting three functions as follows \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[enlargelimits=false] \addplot[domain=0:1,blue] {(1-x)/5}; ...
8
votes
1answer
783 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 ...
5
votes
1answer
663 views

Scaled ticks with ymin and ymax

For a publication I am preparing multiple plots with PGFPlots and would like to have them all look alike, i.e. having the same axis and identical ticks. For this I intended to use ymin and ymax, but ...
0
votes
0answers
76 views

Is there any good XY plot tools using latex [duplicate]

Possible Duplicate: Comparison of plotting packages? Let us say I have x-axis data and the corresponding y-axis data. I was wondering if latex had any graphing abilities. I might want to ...
4
votes
0answers
77 views

LaTex Pgfplots Two axes 1 legend [duplicate]

Possible Duplicate: Using a pgfplots-style legend in a plain-old tikzpicture I'm trying to accomplish this: I have a plot with two y-axes. The first y has two plots, the second has one. I ...
22
votes
3answers
2k views

How can I make plots with TikZ which look like the new Mathematica 9 plots

The new Mathematica 9 is out! I would love to know how to make similar plots to the one's advertized, particularly the following: and Here is a simple plot to get started. %& -shell-escape ...
12
votes
2answers
6k views

How to plot data from a CSV file using tikz and csvsimple?

Here is a minimal example : \begin{filecontents*}{data.csv} a,b,c,d 1,4,5,1 2,3,1,5 3,5,6,1 4,1,4,9 5,3,4,7 \end{filecontents*} \documentclass{article} \usepackage[utf8]{inputenc} ...
5
votes
2answers
296 views

How to plot the graph below?

May I know how to draw the graph as shown below? below is a code I have try but with look and feel that is quite far away from the example: \begin{tikzpicture} \begin{axis}[ legend pos=north ...
6
votes
3answers
349 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 ...
17
votes
1answer
1k views

Drawing timeline

I have a dataset which consists of repeating events over time. Each event takes an arbitrary amount of time. I could plot this using gnuplot but am unable to produce correct keys because of the ...
12
votes
1answer
1k views

Plot non-continuous function with TikZ

How can I plot a non-continuous function with TikZ (using continuous lines for continous stretches of the function and dashed lines for discontinuities)? Does anybody know an efficient method?
9
votes
2answers
579 views

pgfplots plots function not correct

This code \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} \begin{axis} \addplot [domain=15:30, samples=1000] ...
3
votes
1answer
314 views

pgfplots: how to set default number of samples?

For most of the functions I have to plot with \addplot of pgfplots, I have to set [samples=200] to make them look smooth enough. I was wondering if there is some option to set the default sample ...
3
votes
2answers
115 views

What is an appropriate way of plotting a number as a function of year?

I am trying to plot a certain number as a function of year for different entities. In this example, it is the number of missions to the Moon for different agencies per year. What I have come up with ...
227
votes
2answers
25k views

Create xkcd style diagram in TeX

The unique style of the diagrams at xkcd has an informative but nice hand-drawn touch. I guess they are actually drawn by hand but just recently on our partner site for Mathematica someone asked how ...
10
votes
4answers
2k views

How to plot atan(x), sqrt(x) using PSTricks?

For example, this code works: \documentclass{minimal} \usepackage{pstricks} \usepackage{pst-plot} \begin{document} \begin{pspicture}(-5,-5)(5,5) \psgrid[griddots=10,gridlabels=0pt, subgriddiv=0, ...
3
votes
1answer
267 views

Curve synthesis - Adding many (mostly piecewise linear) curves

It's a follow-up to a previous question. If I could have a macro out of the solution over there, it would have been great but then I couldn't make it. The following code (to be added to the one in ...
9
votes
1answer
475 views

Curve synthesis - Adding two curves to get another one

Case 1: Let's say I have a few coordinates (A), (B), (C), (W), (X), (Y), and (Z) (possibily obtained through intersection, rotation, and whatnots). I draw two piecewise linear curves through (A), ...
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 ...
6
votes
1answer
630 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
1answer
467 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} ...
3
votes
1answer
572 views

How to plot coordinate between two xticks?

I want to plot some data using pgfplot. Here is a code I have written: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat = 1.3} \begin{document} \begin{tikzpicture} \begin{axis}[ ...
13
votes
2answers
1k views

TikZ: How to draw a sine curve in 3D?

I know how to draw a sine curve in TikZ and I know how to rotate it in the plane of the paper. I would now like to draw a sine curve that oscillates in the depth of the paper - to give the impression ...
10
votes
3answers
7k views

draw a plot with point

i try to draw something like this : to do that i have write some code using tikz,unfortunately i dont get what i want \documentclass{report} \usepackage{tikz} \usetikzlibrary{automata,topaths} ...
8
votes
1answer
430 views

Tikz / pgfplot: plot Alternating Sequence

Is there any possibility to plot an alternating sequence? Picture: Alternating sequence: I don't need exacly the same output as above. I tried the following: \begin{tikzpicture} \begin{axis}[ ...
5
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 ...
3
votes
1answer
946 views

TikZ: bars width and size of plot

This is a followup on my previous question. I have tried to plot my data and I see the following now. Would it be possible to define the size of the area that is used for the plot? I have tried to ...
3
votes
1answer
538 views

TikZ: plot datapoints with bars

I'm currently generating data files which have points as follows 5 1 3 2 2 1.4 ... Each line 2 values of which the first is indicating the time and the second some value. I'm currently (as I'm ...
13
votes
2answers
1k views

Floor function plot with TikZ

I can't seem to figure out why, but TikZ isn't properly plotting the floor function. Here is my code: \begin{tikzpicture}[xscale=1,yscale=1] \draw[step=.5cm,gray,very thin] (0,0) grid (8,8); ...
2
votes
3answers
1k views

Problems with including a tikz tex file generated by Octave (MatLab clone)

I have plotted a figure in Octave and printed it as a TikZ figure (see the device option) to a tex file called comparison_tikz.tex, and I have imported it into my document with the line ...
17
votes
2answers
2k views

Animated plotting with LaTex?

I am not a LaTeX pro, that's why I don't know if the following is possible and how I could do it. I have a graphic (a plot, jpg) and it shows a time series. I know in PowerPoint it is possible that ...
4
votes
1answer
740 views

How to put auto width to floatingfigure?

I'm trying to wrap an generated graphic with text. But I cannot find what I have to put instead of 6cm in \begin{floatingfigure}[l]{6cm} to let LaTeX designate correct width like it does with height. ...
13
votes
2answers
455 views

Better way of embedding OpenOffice plots into LaTeX?

Right now, I create plots in the spreadsheet, copy them to OpenOffice Draw, save as images, and then put them (as images) into my .tex file. But that leads to problems with resolution (labels too ...
7
votes
1answer
589 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} ...
3
votes
1answer
459 views

TikZ: plot data files with spaces in path

I tried to plot a data file with spaces is the file path. \draw[line width=0.4mm] plot[] file{/home/schlumpf/test folder/daten.txt}; My problem is the space in the file path. How can I plot this ...
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: ...
2
votes
1answer
1k views

latex code for graphing rational function

I've seen in TikZ and pgf Manual for version 1.18 a code for graphing some functions but it does not provide an example for a rational function. Can someone help me graph $x+\frac{1}{x}$?
6
votes
1answer
877 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 ...
5
votes
1answer
1k views

Define node at relative coordinates of \draw plot

I am not able to fix that simple plot. I think I missed something, but I can't point out what ! Could you tell me why (a) is not at midway of the red line ? \documentclass{article} ...
3
votes
1answer
1k views

tikz draw plot not correct

I am trying to plot a naca0012 airfoil profile by its analytic function ( cf wikipedia ) using tikz and I can't understand why I get the following results. I precise that I get the same results if I ...
3
votes
2answers
152 views

Centering a very wide plot

I would like to center the plot in the following code. How can I do that without changing the dimensions of the page for the parts containing text ? I must keep the dimensions of the plot as it ...
10
votes
3answers
565 views

How can I make circle plots?

I have not idea how to call these things, but I just saw a paper with the following figure and I was wondering how one would go about doing it in LaTeX. The closest thing I saw on TeXample.net was ...
6
votes
1answer
553 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] ...
7
votes
2answers
410 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 ...
2
votes
1answer
673 views

Plotting area in the plane where two inequalities in two variables hold

I would like to plot the area in the plane where two inequalities hold, both involving two variables. I would like to do it the way Wolfram Alpha does it, but within a LaTeX document. I have looked ...
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'); ...