Überarbeitungsverlauf[Zurück]
Klicke auf Einblenden/Ausblenden von Überarbeitungen 2

14 Sep '20, 20:45

cis's gravatar image

cis
9.6k103460491

Verblüffenderweise braucht man dafür keine Zusatzpakete oder -syntax: TikZ selbst stellt alles bereit, was dafür nötig ist. <br> Die folgende -bestechend einfache- Methode (von [hier][1]) beruht darauf, dass man die Einheitslängen für x bzw. y als Bildbreite bzw. -höhe festlegt: `x={(image.south east)}, y={(image.north west)}` <br> Damit erhält man auch leicht ein Hilfskoordinatensystem. [![alt text][2]][2] \documentclass[tikz, margin=10mm]{standalone} \begin{document} \begin{tikzpicture} \node[anchor=south west,inner sep=0] (image) at (0,0) {\includegraphics[width=0.9\textwidth]{example-image.jpg}}; \begin{scope}[x={(image.south east)},y={(image.north west)}] % Help CoSy \draw[help lines,xstep=.1,ystep=.1] (0,0) grid (1,1); \foreach \x in {0,1,...,9} { \node [anchor=north] at (\x/10,0) {0.\x}; } \foreach \y in {0,1,...,9} { \node [anchor=east] at (0,\y/10) {0.\y}; } \draw[red, thick, rounded corners] (0.2,0.9) rectangle (0.35,0.75); \end{scope} \end{tikzpicture} \end{document} [1]: https://tex.stackexchange.com/a/9562/46023 [2]: https://texwelt.de/upfiles/55555a5_1.png
Klicke auf Einblenden/Ausblenden von Überarbeitungen 1

14 Sep '20, 20:44

cis's gravatar image

cis
9.6k103460491

Verblüffenderweise braucht man keine Zusatzpakete oder -syntax: TikZ selbst stellt alles bereit, was dafür nötig ist. <br> Die folgende -bestechend einfache- Methode (von [hier][1]) beruht darauf, dass man die Einheitslängen für x bzw. y als Bildbreite bzw. -höhe festlegt: `x={(image.south east)}, y={(image.north west)}` <br> Damit erhält man auch leicht ein Hilfskoordinatensystem. [![alt text][2]][2] \documentclass[tikz, margin=10mm]{standalone} \begin{document} \begin{tikzpicture} \node[anchor=south west,inner sep=0] (image) at (0,0) {\includegraphics[width=0.9\textwidth]{example-image.jpg}}; \begin{scope}[x={(image.south east)},y={(image.north west)}] % Help CoSy \draw[help lines,xstep=.1,ystep=.1] (0,0) grid (1,1); \foreach \x in {0,1,...,9} { \node [anchor=north] at (\x/10,0) {0.\x}; } \foreach \y in {0,1,...,9} { \node [anchor=east] at (0,\y/10) {0.\y}; } \draw[red, thick, rounded corners] (0.2,0.9) rectangle (0.35,0.75); \end{scope} \end{tikzpicture} \end{document} [1]: https://tex.stackexchange.com/a/9562/46023 [2]: https://texwelt.de/upfiles/55555a5_1.png