Graphics, Figures & Tables ⇒ plot curve
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Re: plot curve
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
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
Re: plot curve
(considering that this is slightly diffrent then what I want at the beginning, should I open new topic?)
- Attachments
-
- flkskfsfs.JPG (17 KiB) Viewed 9231 times
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
plot curve
Code: Select all
\documentclass[11pt]{standalone}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[>=stealth]
\fill[blue!25] plot[parametric,samples=50,domain=1.5708:3.1416] function {0.5*t*sin(t+0.5*pi),-0.5*t*cos(t+0.5*pi)} -- (0,0) -- cycle;
\draw[blue] plot[parametric,samples=100,domain=0:6.2832] function {0.5*t*sin(t+0.5*pi),-0.5*t*cos(t+0.5*pi)};
\draw[->] (-4,0) -- (4,0) node[right] {$x$};
\draw[->] (0,-4) -- (0,4) node[above] {$y$};
\end{tikzpicture}
\end{document}
- Attachments
-
- The resulting output.
- tikZ-parametric-plot.png (5.09 KiB) Viewed 9227 times
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
plot curve
Code: Select all
\documentclass{scrartcl}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
ticks=none,
axis y line=center,
axis x line=middle,
axis on top,
domain=0:2*pi]
\addplot[fill,mark=none,red!10,samples=100,domain=.5*pi:pi]
({.5*x*sin(deg(x)+90))},{-.5*x*cos(deg(x)+90))}) \closedcycle;
\addplot[mark=none,red,samples=50]
({.5*x*sin(deg(x)+90))},{-.5*x*cos(deg(x)+90))}) ;
\end{axis}
\end{tikzpicture}
\end{document}
plot curve
From this I only get the cooridnate axis, no graph.localghost wrote:This is the very last thing I can offer.And you should really, really read the pgf/tikZ manual.Code: Select all
\documentclass[11pt]{standalone} \usepackage[T1]{fontenc} \usepackage{tikz} \begin{document} \begin{tikzpicture}[>=stealth] \fill[blue!25] plot[parametric,samples=50,domain=1.5708:3.1416] function {0.5*t*sin(t+0.5*pi),-0.5*t*cos(t+0.5*pi)} -- (0,0) -- cycle; \draw[blue] plot[parametric,samples=100,domain=0:6.2832] function {0.5*t*sin(t+0.5*pi),-0.5*t*cos(t+0.5*pi)}; \draw[->] (-4,0) -- (4,0) node[right] {$x$}; \draw[->] (0,-4) -- (0,4) node[above] {$y$}; \end{tikzpicture} \end{document}
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
plot curve
It will require Gnuplot. So your old problem reappears. Too bad.ditka wrote:From this I only get the cooridnate axis, no graph.
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: plot curve
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
plot curve
By reading a mathematics textbook or in this case the corresponding Wikipedia article [1]*. That's a common practice. Your version needed slight adaptations to the printed function.ditka wrote:[…] How did you know which function to use?
[1] Archimedean spiral – Wikipedia, the free encyclopedia
* The German version of this article is more comprehensive. Perhaps in other languages, too.
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
plot curve
And is it possible to fill the place with dots or lines insted of a color?
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
plot curve
The site you linked clearly shows that the function for this rose is r=cos(kθ). So you just have to translate that.ditka wrote:What if I want to use other polar plots, for which I do not know parametric equation(or it maybe do not even exist?)(for example polar rose). […]
Code: Select all
\documentclass[11pt]{standalone}
\usepackage[T1]{fontenc}
\usepackage{pgfplots}
\usepgfplotslibrary{polar}
\usetikzlibrary{patterns}
\begin{document}
\begin{tikzpicture}
\begin{polaraxis}[hide axis]
\addplot+[pattern=dots,pattern color=blue,mark=none,domain=0:360,samples=300]{cos(4*x)};
\end{polaraxis}
\end{tikzpicture}
\end{document}
You really need to learn how to read manuals. All of these questions can be answered with RTFM. Search the pgf/tikZ manual forditka wrote:[…] And is it possible to fill the place with dots or lines insted of a color?
pattern
(see code above).- Attachments
-
- The resulting output.
- polar-rose.png (26.08 KiB) Viewed 9204 times
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10