Graphics, Figures & TablesHow to do such function-like-plot?

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
cakebytheocean
Posts: 6
Joined: Thu Jan 31, 2019 10:09 pm

How to do such function-like-plot?

Post by cakebytheocean »

I am wondering how to do such function-like plot. The function is not a concrete math function, but should somehow look like a curve.
plot.png
plot.png (40.63 KiB) Viewed 2976 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

How to do such function-like-plot?

Post by Stefan Kottwitz »

I would use the pgfplots package, and plot using a few coordinates and the smooth option. The fillbetween library can do the filling. Perhaps I can post an example tomorrow.

Stefan
LaTeX.org admin
cakebytheocean
Posts: 6
Joined: Thu Jan 31, 2019 10:09 pm

How to do such function-like-plot?

Post by cakebytheocean »

Stefan Kottwitz wrote:I would use the pgfplots package, and plot using a few coordinates and the smooth option. The fillbetween library can do the filling. Perhaps I can post an example tomorrow.

Stefan

Thanks!
cakebytheocean
Posts: 6
Joined: Thu Jan 31, 2019 10:09 pm

How to do such function-like-plot?

Post by cakebytheocean »

Stefan Kottwitz wrote:I would use the pgfplots package, and plot using a few coordinates and the smooth option. The fillbetween library can do the filling. Perhaps I can post an example tomorrow.

Stefan

Thanks!
cakebytheocean
Posts: 6
Joined: Thu Jan 31, 2019 10:09 pm

How to do such function-like-plot?

Post by cakebytheocean »

Stefan Kottwitz wrote:I would use the pgfplots package, and plot using a few coordinates and the smooth option. The fillbetween library can do the filling. Perhaps I can post an example tomorrow.

Stefan

Thanks!
cakebytheocean
Posts: 6
Joined: Thu Jan 31, 2019 10:09 pm

How to do such function-like-plot?

Post by cakebytheocean »

Stefan Kottwitz wrote:I would use the pgfplots package, and plot using a few coordinates and the smooth option. The fillbetween library can do the filling. Perhaps I can post an example tomorrow.

Stefan

\begin{center}
\pgfplotsset{ticks=none, width=10cm}
\begin{tikzpicture}[scale=1.2]
\begin{axis}[
% legend style={
% at={(10,)},
% anchor=north east,at={(axis description cs:0,-0.1)}}]
xlabel=$buffer\;\;size$,ylabel=$page\;\;falut\;\;rate$]

\addplot[blue, mark=none,smooth,ultra thick, domain=1:10] {1/(x * x))};

\addplot[red, mark=none, smooth,ultra thick, domain=1:10]{1/(x * x * x))};

\addplot[black, mark=none, smooth,ultra thick, domain=1:10]{1/(x * x * x * x))};
\legend{$Random$,$Replacement\;Strategies$,$Opt$}
\end{axis}
\end{tikzpicture}
\end{center}

My current solution is that, but as said I have no idea how to simulate such non-exact function. My solution looks like, but the distance of plots is not so large as the given graph.
Post Reply