Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [plot]

{plot} is for questions concerned with plotting data or functions using TeX. For questions specific to the pgfplots package, use the {pgfplots} tag.

0
votes
0answers
44 views

Plotting functions on IPE

IPE Drawing Tool is a free open source software for graphing. It follows friendly with TeX programming and writing, and that's when my question comes along. I've been trying, for a few days now, to ...
2
votes
1answer
44 views

Plot of function in tikz has kink

When plotting the square root function I get a kink, in this MWE at ca. x=0.2 (this depends on the domain). Is there a way avoiding this? \documentclass{article} \usepackage{tikz} \begin{...
2
votes
2answers
36 views

pgfplots: Restrict “each nth point” to specific domain only?

I have a huge amount of data. Therefore I want to reduce the data displayed by decreasing the amount of points with each nth point = {!value!}". Minimum Working Example (MWE): \documentclass[tikz]{...
1
vote
0answers
31 views

How can i make a tornado plot?

I am trying to make a tornado plot that shows what the price will become when i change diffrent values, i want the x axis to be like the picture underneath with 77 as my base cost, but i can not ...
3
votes
1answer
35 views

Effective way to plot values with a vast difference between them

Here's a nice simple bar graph. It's effective when the plotted values are in the same kind of ballpark, but when there's an outlier, it can put things out of wack. For instance, I want to plot some ...
3
votes
1answer
30 views

tkz euclide How to give arrowheads on both sides to axes?

I'm using tkz-base and trying to plot inequation on x axis. I wanted to show arrowheads on both sides but when drawing X axis I get arrowhead only on right side. How do I get on both sides? I tried ...
3
votes
1answer
45 views

tikz: from scientific notation to decimal form

How can I get the first abscissa value in decimal form as 0.05 in (0.05,31.9)? It is set to the scientist notation automatically. \documentclass[border=2mm]{standalone} \usepackage{amsmath} \...
1
vote
1answer
22 views

tikz: draw plot by given coordinates points

I'm trying to draw, in a T=f(x) plane graphic, a curve passing through four points whose coordinates have been obtained experimentally. The x axis range is 0 to 0.5, the y axis range is 0 to 80. This ...
4
votes
1answer
84 views

Plot graph near zero

I want to plot the following function with TikZ. \begin{tikzpicture}[scale=0.7, declare function={ func(\z) = 1/(2*(abs(\z)^3)) * ( (1+abs(\z)) - 2*ln(1+abs(\z)) - 1/(1+abs(\...
4
votes
2answers
215 views

pgfplots: How to draw exponential graph with 60° start angle?

I want to draw a simplified Michaelis-Menten kinetic (monod-function) to compare it with a linear function. Minimum Working Example (MWE): \documentclass{standalone} \usepackage{pgfplots} \...
7
votes
2answers
273 views

pgfplots: How to draw a tangent graph below two others?

Assumed I want to draw three simple graphs based on the following illustration: How can I plot those three graphs? I've tried to create something like this: Minimum Working Example (MWE): \...
4
votes
1answer
30 views

Pgfplot - How to exactly align the legend in a plot

I have a legend in my pgfplots and want to manually position it at a point where the legend does not cover any text or measurement points. I know the axis property legend pos=north west, but it's not ...
1
vote
0answers
38 views

Sum of sub-bars on top of stacked bars in tikz

I want to be able to display the sum of the values on top of the bars. Below is my code and under that, an illustrated image that displays the values I want to show. Can this be done? \documentclass{...
0
votes
0answers
35 views

Matlab2tikz // Error divsion by 0.0

I created a minimal working example in Matlab: [x,y] = meshgrid(-2:0.1:2,-2:0.1:2); fx = x.*y; fy = x.*y; figure quiver(x,y,fx,fy) matlab2tikz('plot.tex'); This works great and creates the plot....
5
votes
2answers
199 views

TikZ plot too verbose

I was wondering if there was a more succinct way to express the following plot (I'm using the plain format): \input tikz \tikzpicture \draw[help lines, ystep=.5] (-.2,-10) grid (12.5,15); \draw[-&...
0
votes
3answers
68 views

Ploting the roots of a polynomial

I want to plot the roots of any given polynomial on the complex plane. Example: Let $P(x)=x^4-x^3-1$ be given. I want to plot on the $Oxy$ complex plane all four roots of this polynomial. I suppose ...
3
votes
1answer
71 views

What is the domain in a tikz parametric plot?

I don't understand what's going on here. If the domain of the parametric parameter \t is 0:100, then the function sin(2pi*t) should oscillate about 100 times, but it only oscillates a couple. What am ...
7
votes
3answers
388 views

Plot a function of two variables equal 0

I would like to plot the function x2(1 − x2) − y2 = 0 in LaTeX. I tried running following code \documentclass{article} \usepackage[margin=0.5in]{geometry} \usepackage[utf8]{inputenc} \...
2
votes
3answers
171 views

How to use a mathematical expression as xticklabel

I have prepared a code including some data resulting in a bar plot. I want to use a mathematical expression as xticklabels but my code does not work. How can I figure this point out? Here is my code: ...
0
votes
1answer
44 views

text in the same line under figure

How can I modify the code that all words in the same line , i.e. u=0.3230mm in the same line \begin{figure}[h] \centering \subfloat[$u = 0.3230 mm$ ] ..... \end{figure}[h] thanks a ...
1
vote
1answer
58 views

How could I graph z=sqrt(x^2-y^2) using Pgftools? I believe I've all suggestions on the internet but to no avail

I have tried graphing it with the parametric notation (i.e. ({x},{y},{sort(x^2-y^2)}) and as seen on my code below but nothing renders the image shown on graphing calculators. \begin{tikzpicture}[...
1
vote
1answer
62 views

How can I 3D plot y=4x^2+z^2 using Pgfplots?

I am trying to 3D plot y=4x^2+z^2 using Pgftools but I'm unable to use z as an independent variable in the function. \begin{tikzpicture}[scale=1.5] \begin{axis}[ grid=major, 3d box=complete, ...
0
votes
1answer
23 views

pgfplots rotating the whole page instead of only the axis

I'm facing a weird problem when generating a bar chart in pgfplots. In my chart I have a lot of labels in the x axis, which I try to rotate 90 degrees using the command xticklabel style={rotate=90,...
4
votes
2answers
99 views

Align plots within tikz pictures one above the other

I have an issue I trust you will solve. I am plotting two graphs in order to represent Bode diagrams. For correspondance of abscissa they should be one above the other. I can align the figures but ...
3
votes
1answer
61 views

Epicycle and deferent with Tikz - Function syntax

I want to build an epicyclic graph and found a useful trigonometric function on the web (URL is in comment in my MWE). My personal issue is that I can't write a complex function as a "plot" argument. ...
2
votes
3answers
125 views

TikZ PGF: How to hide parts of 3D graph when lower than surface?

Assumed we have this kind of 3D surface: Minimum Working Example: \documentclass[tikz]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[zmin=0,zmax=0.5,...
0
votes
0answers
44 views

plot a data file as a contour plot in a specific region

I have a set of data and want to be plotted in a specific region. I draw the region using tikz and when I want to add the data as a contour plot in the region, I don't get the results. How can I Plot ...
1
vote
2answers
99 views

TiKZ plot x^a* cos(ln(x))

I wanted to plot the function X^(-1.5)*cos(ln(X)) I can do successfully X^(1.5)*cos(ln(X)), but if I put a negative exponent the code does not work. I wanted to plot a function that increases close ...
2
votes
2answers
98 views

Plotting each value for x-axis when plotting from file with TikZ

I want to plot data from file using TikZ, and I successfully do. However, I want to plot every value for the x-axis along the x-axis and remove the comma that appears for each number. My current ...
0
votes
0answers
38 views

The scale of the X-axis bar is far away

I am attempting to create a box plot with very large numbers(using tikzpicture), so I expect their to be smaller numbers on the X-axis but the scale denoted on the graph. THe problem is that scale is ...
5
votes
1answer
139 views

How to generate a xy diagram with multiple grouped data sets?

Based on the answer of Stefan Pinnow in 'How to group several charts into one chart?', I tried to generate a diagram with multiple grouped data. Therefore, I modified the diagram but I have some ...
4
votes
2answers
201 views

Using a data file as input in tikz

I have a sorted data in a file (named data.dat). These data should be plotted vertically. I prepared a code in latex using tikz that works. The problem is each data is typed one by one in the main ...
4
votes
3answers
1k views

plotting a linear programming problem

I am a beginner in latex , but I am learning as I go, I want to plot the following linear programing problem: (plot : to make a graphic) f(x,y) = 2x - 3y -> max x + y <= 12 x,y >=0 here ...
1
vote
1answer
98 views

Drawing of some ellipsoid in tikz

I want to plot some ellipsoids like the following ones in tikz but I don't know how can I do it. How can they be plotted in tikz?
3
votes
2answers
105 views

problem with plotting y=tan(x)

Καλημέρα! I 'm trying to draw the curve y=tan(x). When I draw the curve at the domain (-π/2,π/2) everything is OK (see the 1st code and the image). When I draw the curve at other domains (e.g. (π/2,...
0
votes
1answer
199 views

drawing roc curve analysis

I tried to draw the roc curve with latex but i didn't find any solution. Can any one help please. My code doesn't work and i didn't find a curve like this figure. Could you help me please. Thank you ...
1
vote
1answer
60 views

Adjusting TikZ Figure

I use following script (see also here) below, to draw this figure: \documentclass{article} \usepackage{pgfplots} \usepackage{pgfplotstable} \usepackage{tikz} \usetikzlibrary{positioning} \begin{...
2
votes
1answer
29 views

Graphs using pgfplots: Failure when using x as a negative power

I'm trying to plot the decharging curve of a capacitor. The code is as follows: \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{...
5
votes
2answers
629 views

How can I create this graphic?

The picture shows a normal linear regression. Although it is easy to compute on paper, I have no idea how to code a linear regression in order to get an output shown as in the picture. I would be ...
5
votes
5answers
427 views

Plotting exponential functions

Can anyone give me a clue on how to plot this function: It can be with any package, as the ones I've tried to use don't work (pgfplots gives me TeX capacity exceeded, sorry), my attempts with other ...
1
vote
1answer
98 views

Scaling the x-Axis in a more logarithmic way

While I have found some answers for equidistant scaling, I did not find an answer which I was able to transfer directly to my problem. I have one interval going from 10^-8 to 3*10^-8 , one from 3*10^-...
6
votes
3answers
847 views

Help! How to draw the plot of y=(ax+b)/(cx+d) and give an example!

I find in pst-plot.pdf, pst-func.pdf document but there is no its tutorial. So I hope anyone help me to draw the plot of it.(its code :-)) ). Thanks. Example: y=(x-2)/(2x+1) Can anyone draw it by ...
0
votes
1answer
26 views

Specifying the proper xticks label distance

I have a Tikz plot which looks (roughly) as follows: \documentclass[12pt]{article} \usepackage{amsmath} \usepackage{graphicx} \usepackage{hyperref} \usepackage[latin1]{inputenc} \usepackage{tikz} \...
24
votes
8answers
2k views

What are the benefits of PGFPlots/TikZ compared to importing PDF?

What are the benefits of using tools like pgfplots or tikz directly in LaTeX compared to importing PDF/PGF generated by say matplotlib? This answer believed that the main reason is to match the plots ...
4
votes
2answers
401 views

How to plot diagram like a “#” in tikz

I don't know how to plot diagram like a "#", anyone could give some tips? Thank you!
2
votes
0answers
97 views

Plotting errors bars with “plot” without using axis environment from pgfplots

In the axis environment of the pgfplots package there is a simple way to add error bars: \documentclass{minimal} \usepackage{filecontents,pgfplots,tikz} \usetikzlibrary{plotmarks} \begin{...
2
votes
2answers
123 views

Graphing sqrt function: not coming out properly

I have been looking at other posts and have modified my code accordingly, but I still can't get it to work. I think there is an issue that has not been addressed in any of the posts that I have found. ...
0
votes
1answer
25 views

How do I place legend keys above bars/next to lines in Tikz?

I want to follow best practices in plotting graphics using Tikz (see here http://www.eugenewei.com/blog/2017/11/13/remove-the-legend). I'd like to 'remove the legend to become one': instead of ...
0
votes
2answers
124 views

Draw a gray box with nodes

I am a new user to tikzplot. Does anyone know how to make the grey box with the nodes inside the box. Thanks
2
votes
1answer
136 views

Drawing Line Plot with uncertainty

Does anyone have an idea how to generate a graph with the 'uncertainty' area like in the picture shown: i have no idea where to start! Thanks for any inspiration! Cheers! Martin