{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

1
vote
1answer
45 views

move the “.10^-2”

Move it to the right so it will be aligned with the other yticklabels about 0.2cm or more Thanks \begin{tikzpicture} \begin{groupplot}[group style={group size= 2 by 3,horizontal sep =1.5cm,vertical ...
2
votes
1answer
24 views

plotting statistical data, putting years at the Xticklabel PGFplot

I want to plot these data and i can't figure out how to put the years at the X axis, I want to display all the years not a 5 year step. \begin{tikzpicture} \begin{axis}[width=8cm, x tick label ...
3
votes
2answers
67 views

Not able to plot a parabola

I am making a multiple choice problem. (Here, I display two of the choices.) I am trying to plot parabolas using pgfplots. Why is TikZ not compiling my code? I put a % in front of the parabolas ...
7
votes
5answers
482 views

Plotting the Cantor function

I would like to know if there is an (easy?) way of plotting the Cantor function (devil's staircase) using LaTeX. Doing it manually with TikZ seems like madness somehow and my knowledge of plotting ...
2
votes
1answer
9 views

pgfplot: adjust legend style and add several paths

I read the pgfplots manual the whole day, but unfortunately I am not able to achieve the following: (1) legend style: make the legend-equation align left and modify the rectangular box to another ...
5
votes
2answers
135 views

Need to plot a function in coordinate system

I would like to plot a rational function in LaTeX. I tried different ways with Tikz or pgfplots... nothing works. There are many different ways. Often there are problems with poles / asymptotes etc. ...
1
vote
0answers
40 views

Tikz: Rational Functions (Hyperbola)

I am aware of similar questions, but as they don't exactly use the same syntax as I am trying to do, I can't see what's different between my way of writing functions down and the others. Here's what ...
1
vote
1answer
38 views

Group plot: Replacing the values (labels) on x-axis

I'd like to replace numerical labels (e.g., 1,2,3,4,5) on x-axis with names (e.g., A,B,C,D,E) in a group plot environment on a case-by-case basis. The group plot environment seems to easily support ...
0
votes
1answer
94 views

How can we draw these graphs like in this book?

Can you show me which tools we can use to draw the graphs look like in this book? (see below figure). Sorry, I don't know exactly where I can post this question.
3
votes
1answer
81 views

Tikz functions and coordinate system: Adding points and labels

I managed to adjust some of the existing code a little bit to fit my needs. I can plot simple functions. (1) I want to add labels to the coordinate system, for example e (~ 2.71) to the x-axes and ...
3
votes
1answer
40 views

Why are my symbolic x coordinate labels printed twice in a tikz plot?

I'm trying to plot a bar graph, using symbolic x coordinates. For some reason, the name of some symbolic coordinates appears under the x axis more than once. If I increase the width (e.g. 12cm) ...
1
vote
1answer
50 views

Get node text inside filled region in tikz

I have made this figure from this code: \documentclass[tikz]{standalone} \usetikzlibrary{patterns} \begin{document} \begin{tikzpicture}[domain=-90:200, x=0.025cm, y=0.15cm] \draw[->,very ...
2
votes
1answer
33 views

Duplicate values when writing value near coordinate

I am using this code, taken from my question here. The problem arises when two x values have the same y value. Then the label I want to write near the coordinate overlaps with the other one. How can I ...
3
votes
1answer
40 views

Write a value near a coordinate in a plot

I want to do it from a file, rather from inside the document like I do it now: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.9} \begin{document} \begin{tikzpicture} ...
3
votes
1answer
39 views

How to add one mark to one line in pdfplot

I am attempting to differentiate each line in the graph. Then I try to use marks, however it looks messy. Is there a way to make it looks more tidy? I am open to any suggestion that works. ...
20
votes
3answers
348 views

Plotting a graph with several values of a parameter

I'm trying to plot the function q(t) = (4.9/ (w^2))*(cosh(w*t)-cos(w*t)) for several values of the parameter w. That is, I want to plot whole graphs of q vs t, where I plug in say w=1, w=2, w=100, or ...
1
vote
1answer
44 views

How to arrange the key in this plot?

basically I have plot like this: It looks bad because two reasons: The middle figure, five keys are overlapped with lines The 6 key in the third figure, even they are not overlapped, they are not ...
2
votes
0answers
59 views

How to place two plots inside a node?

I'm eager to have two plots (of the algebraic functions) placed horizontally inside a node. I'd like them to be signed, so something like caption (below the plot) is needed. One of them — "the good ...
0
votes
0answers
36 views

matplotlib2tikz - compilation error for 2D

Situation: I am using matplotlib2tikz to export a two dimensional plot (comparison). Exported to pdf it looks like this: Including the tikz file (and compiling) yields an error though: Package ...
2
votes
1answer
110 views

How I can draw a semitransparent gray sphere shell with a hole using TikZ?

I need to represent a gray sphere of radius R with a hollow circle defined by a cone of angle alpha, and I have the cone part but I do not know how to draw the sphere .... I Have this: ...
3
votes
1answer
50 views

drawing line between plotted points

How do you have the line draw between points that have been plotted on a graph? Here's what I've done so far. \begin{tikzpicture}[>=latex] \centering \begin{axis}[ axis x line=center, axis y ...
0
votes
0answers
68 views

Plotting piecewise functions with TikZ

I would like to use TikZ package in LaTeX to draw the following piecewise functions and their graphs: f:[0, \infty)\rightarrow \mathbb{R} such that f(0)=1, f(x)=0 if x>0; g:[0, 1]\times[0, ...
0
votes
1answer
57 views

How do I draw the graph of the floor function floor(x/2)? [closed]

Im confused as to how to draw some values because they take the same spot. For example: floor(-4/2)=-2 floor(-3/2)=-2 How do i draw it when the values are the same? I am unable to draw the circle ...
1
vote
0answers
53 views

Random lines in a plot [closed]

Hi everyone, I have never used pstricks or tikz and it seems to be the best option to draw the kind of plots that I need. I have been researching and I have not found how to draw this random line ...
2
votes
1answer
48 views

Problems plotting histograms as a line graph?

I would like to plot some percentages as a line graph, so I tried this: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=2.12} \begin{document} \begin{tikzpicture} ...
3
votes
1answer
67 views

How to plot this histograms as a line graph?

Let's say I have this histogram plot: \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ symbolic x coords={a small bar,a medium bar,a large bar}, ...
4
votes
1answer
159 views

Tikz surface plot

Does anyone know how to replicate this Mathematica plot in tikz? (If possible: I'd like to use "pattern=crosshatched dots" to fill in the shaded region.) Below is the Mathematica code: ...
3
votes
2answers
55 views

Problem with `plot` option for `gdraw` in MetaPost

I have the following problem with MetaPost and graph package for it. So I have a source: input graph; beginfig(1) draw begingraph(16cm, 2cm); gdraw "a.txt" plot "+"; endgraph; ...
7
votes
4answers
210 views

tikz/pgfplot — always same distance between marks

Is there a way to get for all tikz-plots in one LaTeX document the same distance between the plot marks, ie the distance between the marks should be independent of sample size. It would be really ...
3
votes
5answers
365 views

TikZ and analytic geometry

I have four given points, for example A(3,2) B(5,4) C(-3, 4) D(-3, 0) Using TikZ/PgfPlots, how can I draw them in the Cartesian coordinate system, show the points, each accompanied by its name ...
6
votes
0answers
138 views

Special effects in TikZ leads to unprintable PDF

So I recently made a picture of the Mexican Hat Potential (related to the Brout-Englert-Higgs Mechanism of particle physics). I am more than satisfied with the graph and everything, but I noticed ...
6
votes
1answer
101 views

Calculate axis limits depending on depicted data

In a pgfplots axis environment, I want to make the axis limits dependent on the depicted data or some other data. Consider the minimum working example \documentclass{standalone} ...
2
votes
1answer
256 views

Plotting f(x) = sin x and f(x) = cos x on pgf/tikz

I'm new to graphing on TikZ/pgf and have been trying to figure this out but can't seem to find any helpful info for what I want. I want to plot the above functions over one period, i.e. on the ...
4
votes
1answer
250 views

Best program for 3D plotting for LaTeX [closed]

I'm cross-posting this (also on Mathematics stack exchange, but not really getting the answers I'm looking for, so thinking I may have posted in the wrong community originally). I've hit a roadblock ...
8
votes
1answer
99 views

Plotting several 2d curves (with different colors) in a 3d graph

I'm trying to reproduce 3D plots with several 2d curves, like in Plotting several 2D functions in a 3D graph. The end result looks like this: The questions are: I would like to change X labels ...
1
vote
1answer
38 views

Make axis longer in 3dplot

How can one adjust the length of the axes in a plot made with pgfplots/TikZ without affecting the plot itself?
0
votes
0answers
22 views

Make axis semi-visible/dashed in TikZ 3dplot [duplicate]

Is it possible to make the axis fully visible for a certain range while merely dashed for some other range? Suppose the axes x,y,z all go from the origin 0 to 1. But I want them to be dashed between 0 ...
7
votes
2answers
306 views

How to draw this particular Mexican hat potential?

I know there are some other mexican hat questions here, but none of the answers seems complete to me. I would like to draw the following figure with TikZ with similar axis and labeling. How can one do ...
4
votes
1answer
97 views

Drawing Line Plot with cosmetic enhancements

Per title says, I want to draw a line plot and two additional versions of it. More specifically: I would like to plot some(preferably a big number of) nodes between the unit interval. I want ...
0
votes
1answer
55 views

Plotting different lines on a single plot [closed]

I kindly need help with plotting different lines on a single plot For instance, I have a = 1; theta = [0 30 60 90]; d1 = a.*sind(theta); d2 = a.*cosd(theta); plot (d1,d2) However, I also want ...
1
vote
0answers
52 views

plotting matlab trisurf and trimesh in latex

I am trying to plot some data in latex. In Matlab the plots are generated by using the function trisurf and trimesh. What is the best way to generate or to import these plots into a latex document ...
2
votes
1answer
56 views

How to plot with tikz without graduations in the axis?

I'm trying to plot a function with tikz and let the plot as clean as possible, but I can't remove the lines along the axis. Can anyone help with this? \begin{tikzpicture} \begin{axis}[ axis ...
0
votes
0answers
52 views

Is it possible to include .bmp figure?

Do any need a special package to include .bmp figures in a document? Because it gaves me an error if I try to include them in the document. I tried saving the figures as .jpg, but the quality is ...
2
votes
0answers
75 views

Plotting trajectory with latitude longitude [closed]

I am interested to plot time series data of moving object using latitude and longitude data...I have looked and haven't found anything before I give up I thought I would ask here...Is there a package? ...
2
votes
0answers
46 views

pgf stacked bar plot not displayed correctly - wrong intersection with x-axis

I'm trying to generate a bar plot with the code below. As you can see does the bar plot not start at zero, as it should. It starts below zero!!! Can anybody help me? ...
2
votes
1answer
52 views

plotting complicating funtions

Is it possible to plot the function 1/{1+\frac{1}{x}} from 0 to 20 using tikzpicture, when I do it I just get a straight line \documentclass{article} \usepackage{pgfplots} \begin{document} ...
2
votes
1answer
140 views

How to set the size in Octave, using Gnuplot for graphics from Octave?

I am using Octave for all my calculations and plotting. By telling Octave graphics_toolkit gnuplot I can create a *.tex-document by print -dtikz filename.tex Which I can then use by ...
5
votes
2answers
134 views

sinc function amplitude wrong in pgfplots

It seems that pgfplots has a problem with plotting the sinc function, aka sin(x)/x. Why is the amplitude wrong? It should be 1 at x=0. As to my knowledge the y-scale is nonsense (compare ...
10
votes
1answer
285 views

Visualize singular vector fields with TikZ or PsTricks and friends

I am trying to find a good way to make really visually appealing plots of singular vector fields. For example electric fields of point like charges. I already tried this in python without too much ...
2
votes
0answers
38 views

Is there a way i can make psfrag replace every number in a plot?

I want to replace every number in the axis of a plot. Can psfrag do this? If not, is there any other tool i can use to get the same effect?