diff --git a/tikz/2d-x-square-with-circle/2d-x-square-with-circle.png b/tikz/2d-x-square-with-circle/2d-x-square-with-circle.png new file mode 100644 index 0000000..1c3b037 Binary files /dev/null and b/tikz/2d-x-square-with-circle/2d-x-square-with-circle.png differ diff --git a/tikz/2d-x-square-with-circle/2d-x-square-with-circle.tex b/tikz/2d-x-square-with-circle/2d-x-square-with-circle.tex new file mode 100644 index 0000000..3abd13d --- /dev/null +++ b/tikz/2d-x-square-with-circle/2d-x-square-with-circle.tex @@ -0,0 +1,40 @@ +\documentclass[varwidth=true, border=2pt]{standalone} + +\usepackage{pgfplots} +\usepackage{tikz} + +\begin{document} +\begin{tikzpicture} + \begin{axis}[ + legend pos=south west, + axis x line=middle, + axis y line=middle, + grid = major, + %width=9cm, + %height=9cm, + grid style={dashed, gray!30}, + xmin=-1.5, % start the diagram at this x-coordinate + xmax= 1.5, % end the diagram at this x-coordinate + %ymin=-0.25, % start the diagram at this y-coordinate + %ymax= 2.25, % end the diagram at this y-coordinate + axis background/.style={fill=white}, + xlabel=$x$, + ylabel=$y$, + %xticklabels={-2,-1.6,...,7}, + %yticklabels={-8,-7,...,8}, + tick align=outside, + minor tick num=-3, + enlargelimits=true, + tension=0.08] + \addplot[domain=-1.5:1.5, red, thick,samples=50] {x*x}; + \draw[blue, thick] \pgfextra{ + \pgfpathellipse{\pgfplotspointaxisxy{0}{1}} + {\pgfplotspointaxisdirectionxy{0.87}{0}} + {\pgfplotspointaxisdirectionxy{0}{0.87}} + % see also the documentation of + % 'axis direction cs' which + % allows a simpler way to draw this ellipse + }; + \end{axis} +\end{tikzpicture} +\end{document} diff --git a/tikz/2d-x-square-with-circle/Makefile b/tikz/2d-x-square-with-circle/Makefile new file mode 100644 index 0000000..fbbccf5 --- /dev/null +++ b/tikz/2d-x-square-with-circle/Makefile @@ -0,0 +1,31 @@ +SOURCE = 2d-x-square-with-circle +DELAY = 80 +DENSITY = 300 +WIDTH = 512 + +make: + pdflatex $(SOURCE).tex -output-format=pdf + make clean + +clean: + rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot + +gif: + pdfcrop $(SOURCE).pdf + convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif + make clean + +png: + make + make svg + inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png + +transparentGif: + convert $(SOURCE).pdf -transparent white result.gif + make clean + +svg: + #inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg + pdf2svg $(SOURCE).pdf $(SOURCE).svg + # Necessary, as pdf2svg does not always create valid svgs: + inkscape $(SOURCE).svg --export-plain-svg=$(SOURCE).svg diff --git a/tikz/2d-x-square-with-circle/Readme.md b/tikz/2d-x-square-with-circle/Readme.md new file mode 100644 index 0000000..f9a2a42 --- /dev/null +++ b/tikz/2d-x-square-with-circle/Readme.md @@ -0,0 +1,3 @@ +Compiled example +---------------- +![Example](2d-x-square-with-circle.png)