{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

6
votes
1answer
354 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
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) ...
5
votes
1answer
248 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
149 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
273 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
233 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
226 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
114 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
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} ...
4
votes
4answers
480 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
995 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
386 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
336 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
247 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
447 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
2k 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
543 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
206 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 ...
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} ...
4
votes
1answer
921 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
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 ...
11
votes
1answer
318 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
317 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
82 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.
11
votes
2answers
856 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
248 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
171 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
1k 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
260 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
606 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
153 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 ...
4
votes
0answers
224 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
275 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
721 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 ...
2
votes
1answer
242 views

Knitr plotting outside margin

I like the look of plots that extend beyond the margins \documentclass{article} \usepackage{lipsum} \usepackage[demo]{graphicx} \begin{document} \begin{figure} \centering ...
3
votes
1answer
750 views

How to set Tikz scatter marker weight?

I'm using tikz to produce scatter plots as shown in this question. I can define the marker size with \tikzset{mark size=8} but now I'm looking for a way to make the line of the marker thicker in a ...
3
votes
1answer
269 views

tick mark/range problem on graph generated using TikZ

I'm having a little difficulty getting a tick mark on a graph generated using TikZ to appear correctly. The code is below and the problem can be seen in the vertical axis of the second graph (b). How ...
7
votes
1answer
688 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? ...
1
vote
0answers
33 views

x axis domain/range in a plot [duplicate]

Please consider the following code of a plot and its result. What I want to be shown in the plot is the actual values of the x axis i.e 1000, 5000, 10000 and not 0.1*10^4, 0.5*10^4 , 1*10^4 to be ...
3
votes
2answers
560 views

Packages to plot functions such as the logistic function (or “S-shaped function”)?

Is it possible to plot the graph of an S-shaped function in LaTeX? If yes, then how? Which packages should I use for that?
7
votes
1answer
373 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} ...
8
votes
1answer
818 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 ...
4
votes
1answer
542 views

Axis labels and ticks in degree, plot in radian

I've got a plot - the x axis is in radian (from pi/2 to pi) and with gnuplot it works like a charm - the problem is - that my x-axis labeling should be in degree (-90, -75,...,90) and i'm kinda stuck. ...
2
votes
1answer
90 views

Vertical labeled markers

I have a plot with four curves, and I wish to add vertical marker to pinpint the exact moment the curve drops below a certain threshold, much like this: I'd like to be able to control the width of ...
4
votes
0answers
372 views

Creating plots in Latex - easy to learn? [closed]

I am currently working on my summer project for which I created the following plot with Mathematica: Now I am not 100% satisfied with the results and one of my professors recommended PGF and TikZ. ...
7
votes
1answer
534 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 ...
5
votes
2answers
379 views

Drawing boxplots with pst-plot

I'd like to draw in the same frame a given number of box plots with the macro \psBoxplot from the pst-plot package. I'm retrieving the sampled data from as many files as different box plots by using ...
6
votes
2answers
506 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: ...
3
votes
1answer
319 views

pgfplots: show x tick labels for data below ymin

I have a very simple bar chart plot. My problem is when I set a ymin value, all x labels whose values are below that threshold will not be displayed. I'd rather have the labels but no values shown. ...