{plot} is for questions concerned with plotting data or functions using TeX. For questions specific to the pgfplots package, use the {pgfplots} tag.
10
votes
1answer
300 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
293 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
118 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
87 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 ...
184
votes
2answers
19k 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 ...
9
votes
4answers
600 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
192 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
264 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), ...
5
votes
1answer
376 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
383 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
270 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
335 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}[
...
12
votes
2answers
780 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 ...
6
votes
3answers
1k 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
285 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
600 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
456 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
425 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 ...
11
votes
1answer
701 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
465 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
...
10
votes
2answers
927 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
366 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.
...
11
votes
2answers
296 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
411 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
327 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 ...
6
votes
1answer
585 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
807 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}$?
0
votes
0answers
302 views
Different kinds of symbols on lines [closed]
I have plots with different line styles. That is, lines with different symbols on them. For example, lines with diamonds, circles or deltas. In the caption of the plot, it is needed to introduce and ...
6
votes
1answer
557 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
787 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}
...
2
votes
1answer
674 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
138 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 ...
9
votes
3answers
389 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 ...
4
votes
1answer
274 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
319 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
469 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
1k 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
1k 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
464 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
247 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
458 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
306 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
1k 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 ...
3
votes
2answers
1k 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
1k 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
536 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
876 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
630 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 ...
12
votes
2answers
2k 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
393 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 ...
