{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

10
votes
1answer
203 views

Why (\x)^2 and \x^2 produce different results in Tikz plot? [duplicate]

(\x)^2 will plot correct parabola, while \x^2 will have negative x branch upside down. Why () are required for this formula to work? \documentclass[10pt]{article} \usepackage[utf8]{inputenc} ...
19
votes
8answers
911 views

Plotting Weierstrass function

I'm trying to plot Weierstrass function using only basic TikZ picture functionality (no gnuplot or whatnot). How do I use sum in a \draw? Do I have to make a new command? Use a loop? An alternative ...
2
votes
1answer
172 views

How to exclude negative values from plot of PGFPlots package?

I'm plotting bar plot using this code: \documentclass[tikz,12pt]{standalone} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[english]{babel} ...
2
votes
1answer
696 views

Adjusting Vertical and Horizontal Space between nodes in tikz flow chart

I got the following flow chart diagram in tikz. MWE \documentclass{standalone} \usepackage[latin1]{inputenc} \usepackage{tikz} \usetikzlibrary{calc, shapes, arrows, positioning} \begin{document} ...
4
votes
1answer
123 views

Plot 2-D data point in just one plan

everyone! I have got a little problem trying to draw in LaTeX. Let me try to explain: I have a xyz-axis, as you can see on the figure below. Plotting any 2-D data point graph in the xy-axis: ...
3
votes
2answers
247 views

Problem with tikz plot in beamer

I'm trying to plot a function using this code \begin{tikzpicture} % Draw the log-normal distribution curve \draw[blue,smooth,thick] plot[id=f1,domain=0.001:6,samples=50] function ...
4
votes
0answers
97 views

Table vs Plot: How to print table of values, with colors representing values

In an effort to collect knowledge that will ultimately allow me to answer this question, I am seeking a way to generate a table where numeric values are plotted as cell-filling colors. The color ...
16
votes
2answers
810 views

How can I produce a graph from a table?

What I want to do is plot a graph for a given data set. This must be simple to do, but I just cannot find a simple explanation of how to do it... I have the following table (no problem so far): ...
2
votes
2answers
129 views

Linewrap in legend in pgfplots [Solved]

I try make plot with long text in legend. \documentclass{report} \usepackage{pgfplots} \pgfplotsset{ every axis legend/.append style={at={(0.5,-0.13)},anchor=north,legend cell align=left}, tick label ...
7
votes
1answer
294 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 ...
3
votes
2answers
323 views

Bar chart from CSV file with adjustable bar width

I have a CSV file with approximately 1500 records that I would like to plot using something like a bar chart, but I don't know where to start at all. Each record contains a width and a height, which ...
6
votes
2answers
804 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}[ ...
5
votes
1answer
108 views

Plot using pgfplots from a text file in long form (vs wide form)?

In the statistical programming language R, there are two different forms to represent data. The wide form looks like the following: subject time age weight height 1 John Smith 1 33 90 ...
4
votes
2answers
250 views

Plot data from a LaTeX table

I have a table in LaTeX format. I would like to plot a few figures using this data, having the five frequencies (125, 250, 500, 1000, 2000, 4000) on the horizontal axis, and the absorption coefficient ...
5
votes
1answer
145 views

Plotting graph and data with PSTricks: Wrong scaling

Consider the following code: \documentclass{article} \usepackage{pst-plot} \begin{document} % options \psset{ xunit = 5, yunit = 50 } % constants. \def\masse{0.183276667} % kg ...
6
votes
1answer
332 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 ...
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) ...
5
votes
1answer
201 views

How to change the color scheme to make this figure more elegant?

Here different colors means different weight of the edge, and the color of the points is arbitrary. The tex code: \documentclass[aps,prl,superscriptaddress]{revtex4} \usepackage{subfigure} ...
3
votes
1answer
111 views

Best way to produce a graph similar to one generated by Maple

I wish to produce the following graph from Maple in my Latex document, here is my Maple code: p := x -> ...
2
votes
2answers
211 views

Why does tikz not plot this even function correctly? [duplicate]

Can someone provide an explanation and a fix for the fact that my plot is not what is expected? The function is symmetric with respect to the y-axis. The plot correctly shows the function for positive ...
2
votes
1answer
185 views

Save TikZ plot points calculated with PGF math library to .table file?

Is it possible to let TikZ save and in subsequent compilation runs use the plot points generated with the PGF math library? A (simple) example of such a function plotted that way is: ...
4
votes
2answers
189 views

Can not plot x^4, sqrt(x) or x^3 + 5x^2 using pgf/tikz

I have recently started using LateX, and I am beginning to use pgf/tikz to create plots. But I have encountered some problems with the functions stated above. I can plot the function f(x)=x^3, but ...
1
vote
1answer
83 views

pgfplots tick lines are behind const plot

The tick lines in the plot are in a layer behind the actual plot. Have a look at this example below: \documentclass[11pt, oneside]{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} ...
7
votes
3answers
827 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} ...
5
votes
4answers
405 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
1answer
655 views

Plotting semilog plot with pgfplot

I am trying to graph frequency response of certain filters. This is the code I currently have: \begin{tikzpicture} \begin{semilogxaxis}[xlabel=Frequency, ylabel=Gain, xmin=1, xmax=20000, ymin=0, ...
5
votes
1answer
268 views

PGF Math: “An internal routine of the floating point unit near”

I am using this snippet: \documentclass{beamer} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ xlabel=$x$, ylabel={$f(x) = x^{-1}$} ] \addplot {x^{-1}}; ...
4
votes
1answer
250 views

Superposing histogram and barplot (with transparency)

I'm having troubles when I try to plot in the same graph a bar plot and an histogram. This is my MWE (you can find my data set at the end of the post). \documentclass{standalone} ...
5
votes
1answer
218 views

How draw lines at certain angle on a function graph in TikZ

How can one draw orthogonal tick marks on a function? For instance in the following plot I would like to make orthogonal tick marks on the function y=x^2, say. \documentclass{article} ...
4
votes
1answer
332 views

Missing bars in pgfplots histograms

I have a problem with pgfplots, when I try to plot some data from a file. I use the following code \begin{figure}[p] \centering \begin{tikzpicture} \begin{axis}[ybar ...
14
votes
5answers
1k views

How to plot x^(1/3)?

I tried to export my Geogebra graphs into tikz-code. In General it works fine, but plot x^1/3 doesn't work: \documentclass[10pt]{article} \usepackage{pgf,tikz} \usetikzlibrary{arrows} ...
0
votes
1answer
317 views

Special characters in knitr generated figure caption

I would like to pass special characters and formatting with the knitr generated captions. I am trying to understand two things: 1) Is it possible to pass LaTeX syntax through the caption? 2) How ...
2
votes
0answers
159 views

Automatically generated plots with Mathematica

I am currently using Mathematica to generate several plots later included in a LaTeX document. The process of exporting each of the graphs to eps/pdf and including these in the document is quite ...
5
votes
3answers
253 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} ...
4
votes
1answer
548 views

Bar plot with error bars and two data rows

I am already close to the solution I'm searching for. I want this graph http://tex.stackexchange.com/a/35749/38544 with two data rows. Thus I took the code, duplicated the addplot-section and removed ...
8
votes
0answers
135 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 ...
11
votes
1answer
274 views

Problem with legend in pgfplots

I want to make plot with fill area. I try this code \documentclass[a4paper,12pt]{report} \usepackage{pgfplots} \definecolor{plotmain}{HTML}{97bbcd} \pgfplotsset{every axis legend/.append ...
0
votes
0answers
28 views

How to prevent plots being printed out of document's sections? [duplicate]

I am preparing a document using knitr in which I have multiple charts within two or more sections. The majority of the plots is printed at the end of the document but I would like them to stay within ...
5
votes
3answers
264 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 ...
1
vote
0answers
73 views

How to set a shaded area around 2d plot curve on a pgfplots figure? [duplicate]

I plotted a 2d figure of a curve but I also want to show variance of the value with a shaded area around the curve line. How can I do it in pgfplots? Here is my current plot.
10
votes
2answers
631 views

plot 3d graphs of functions defined implicitly

How can I plot 3d graphs of functions defined implicitly (quadratic forms, for Linear Algebra course notes -- I'd like to include lots of examples)? As far as I can see it is not possible with ...
3
votes
2answers
232 views

Plot from scratch (without explicit data)

I'm trying to draw a plot which I've been given in a scan: What is the correct way to plot a custom shaped curve --- a freehand tool counterpart. I used quick curve but it's hard to tell extremum ...
2
votes
1answer
166 views

Adding extra ticks based on sum of ybar stacked

I am trying to add minor yticks on my axis based on the end values of a ybar stacked plot. Here is where I'm at: \documentclass[tikz]{standalone} \usepackage{pgfplotstable} \pgfplotstableread{ Year ...
8
votes
1answer
947 views

Problem with a TikZ/Geogebra plot of an exponential function (even if using CVS version definition)

I wanted to graph the function f(x)=(-1+4x^2)*e^2 in a coordinate system. Using "Export Graphics View as pgf/TikZ" in Geogebra I got the following code (here shown after I did some minor changes ...
3
votes
2answers
211 views

Making given y-axis data in dB?

I learned recently how to draw in pgfplots and is really enjoying the output. I generate my data in matlab and then write it to a file. One line of the file will contain two entries, first x-axis data ...
2
votes
1answer
499 views

Example code of PSTricks in MikTeX

everyone, in the past one hour, I have been fighting with the PSTricks package in MikTeX. I found a lot of example code here. For example, I downloaded the gliding ball example tex and I ran it in ...
2
votes
2answers
142 views

How do I group curves in 2-D plots with pgfplots

In the above image, you can see that there are 4 curves. I have two techniques (black and red). I test them on two different experimental scenarios. So corresponding to each scenario, I get one red ...
3
votes
0answers
184 views

Using TikZ with DokuWiki

I am using DokuWiki to write my notes. The one thing that I am missing is the ability to plot. I would like to use TikZ to fill this need, but I have been unable to get exactly what I want. I am using ...
2
votes
2answers
240 views

Binary Sector overlay diagram in a radial plot

I am analyzing some data from a system that can have some binary configurations. I thought that a good strategy would be to visualize the output as a radial plot and overlay its binary configuration ...
8
votes
3answers
578 views

Create heatmap with PSTricks or TikZ

I have a huge amount of 2D-coordinates, associated with a value, e.g.: x | y | value 27.50 52.15 12.51 61.83 13.32 57.56 36.23 21.83 41.73 40.46 85.67 25.20 ... The data is ...