# ENG/GER : Tikz Export text wrong position / Text bei Tikz Export an falscher Stelle

David shared this question 4 years ago

English : Hello, I am using Geogebra to create figures for my economics thesis. ( Mainly because they look much more sharp and nice). The problem is that text, which is added for explanation is shifting after exporting to tikz and including in a tex document. ( In the pictures below you can see that "price" and "insurancesuppy" have shifted and changed positions) In Geogebra however, they were exactly where I have placed them. What am I doing wrong? Any suggestions ?

Deutsch : Hallo, ich benutze Geogebra um kleine Skizzen/Abbildungen für meine Masterarbeit zu erstellen ( Hauptsächlich, weil es viel schöner und schärfer aussieht). Das Problem ist nun, dass Text, welcher etwa zur Beschreibung der Achsen hinzugefügt wurde, sich beim Exportieren nach Tikz und Einfügen in ein Latex Dokument verschiebt ( Im den Bildern unten sieht man, dass sich "Preis" und "Insurancesupply" verschoben habe. In Geogebra jedoch, ist der Text genau an der Stelle wo er positioniert wurde. Was mache ich falsch ?

Bild in Geogebra :

Export nach Tikz

Bild in Latex mit falschen Positionen / Picture in Latex with wrong position of text

**********

Tikz Code

1. \documentclass[10pt]{article}

\usepackage{pgf,tikz}

\usepackage{mathrsfs}

\usetikzlibrary{arrows}

\pagestyle{empty}

\begin{document}

\definecolor{wwffqq}{rgb}{0.4,1.,0.}

\definecolor{ffzzqq}{rgb}{1.,0.6,0.}

\definecolor{qqqqff}{rgb}{0.,0.,1.}

\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]

\draw[->,color=black] (-1.,0.) -- (10.5,0.);

\foreach \x in {-1.,1.,2.,3.,4.,5.,6.,7.,8.,9.,10.}

\draw[shift={(\x,0)},color=black] (0pt,2pt) -- (0pt,-2pt) node[below] {\footnotesize $\x$};

\draw[->,color=black] (0.,-1.) -- (0.,5.5);

\foreach \y in {-1.,1.,2.,3.,4.,5.}

\draw[shift={(0,\y)},color=black] (2pt,0pt) -- (-2pt,0pt) node[left] {\footnotesize $\y$};

\draw[color=black] (0pt,-10pt) node[right] {\footnotesize $0$};

\clip(-1.,-1.) rectangle (10.5,5.5);

\draw [color=ffzzqq,domain=-1.:10.5] plot(\x,{(--57.8224-3.88*\x)/16.28});

\draw [color=wwffqq,domain=-1.:10.5] plot(\x,{(--22.7264--5.04*\x)/14.48});

\draw (5.56,4.42) node[anchor=north west] {Insurancesuppy};

\draw (-1.,5.14) node[anchor=north west] {Price};

\draw (9.04,-0.44) node[anchor=north west] {Quantity};

\draw (5.06,1.68) node[anchor=north west] {Insurancedemand};

\begin{scriptsize}

\draw [fill=qqqqff] (-2.72,4.2) circle (2.5pt);

\draw[color=qqqqff] (-2.58,4.57) node {$A$};

\draw [fill=qqqqff] (13.56,0.32) circle (2.5pt);

\draw[color=qqqqff] (13.7,0.69) node {$B$};

\draw[color=ffzzqq] (-4.52,4.49) node {$f$};

\draw [fill=qqqqff] (-3.36,0.4) circle (2.5pt);

\draw[color=qqqqff] (-3.22,0.77) node {$C$};

\draw [fill=qqqqff] (11.12,5.44) circle (2.5pt);

\draw[color=qqqqff] (11.26,5.81) node {$D$};

\draw[color=wwffqq] (-4.52,0.35) node {$g$};

\end{scriptsize}

\end{tikzpicture}

\end{document}

Latex Code

1. \documentclass[10pt]{article}

\usepackage{pgf,tikz}

\usepackage{mathrsfs}

\usetikzlibrary{arrows}

\pagestyle{empty}

\begin{document}

\definecolor{wwffqq}{rgb}{0.4,1.,0.}

\definecolor{ffzzqq}{rgb}{1.,0.6,0.}

\definecolor{qqqqff}{rgb}{0.,0.,1.}

\begin{figure}

\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]

\draw[->,color=black] (-1.,0.) -- (10.5,0.);

\foreach \x in {-1.,1.,2.,3.,4.,5.,6.,7.,8.,9.,10.}

\draw[shift={(\x,0)},color=black] (0pt,2pt) -- (0pt,-2pt) node[below] {\footnotesize $\x$};

\draw[->,color=black] (0.,-1.) -- (0.,5.5);

\foreach \y in {-1.,1.,2.,3.,4.,5.}

\draw[shift={(0,\y)},color=black] (2pt,0pt) -- (-2pt,0pt) node[left] {\footnotesize $\y$};

\draw[color=black] (0pt,-10pt) node[right] {\footnotesize $0$};

\clip(-1.,-1.) rectangle (10.5,5.5);

\draw [color=ffzzqq,domain=-1.:10.5] plot(\x,{(--57.8224-3.88*\x)/16.28});

\draw [color=wwffqq,domain=-1.:10.5] plot(\x,{(--22.7264--5.04*\x)/14.48});

\draw (5.56,4.42) node[anchor=north west] {Insurancesuppy};

\draw (-1.,5.14) node[anchor=north west] {Price};

\draw (9.04,-0.44) node[anchor=north west] {Quantity};

\draw (5.06,1.68) node[anchor=north west] {Insurancedemand};

\begin{scriptsize}

\draw [fill=qqqqff] (-2.72,4.2) circle (2.5pt);

\draw[color=qqqqff] (-2.58,4.57) node {$A$};

\draw [fill=qqqqff] (13.56,0.32) circle (2.5pt);

\draw[color=qqqqff] (13.7,0.69) node {$B$};

\draw[color=ffzzqq] (-4.52,4.49) node {$f$};

\draw [fill=qqqqff] (-3.36,0.4) circle (2.5pt);

\draw[color=qqqqff] (-3.22,0.77) node {$C$};

\draw [fill=qqqqff] (11.12,5.44) circle (2.5pt);

\draw[color=qqqqff] (11.26,5.81) node {$D$};

\draw[color=wwffqq] (-4.52,0.35) node {$g$};

\end{scriptsize}

\end{tikzpicture}

\caption{Versicherungsnachfrage und Angebot}

\end{figure}

\end{document}

1

What change in the TikZ code would be needed?

1

Hello Michael Borchers,

thank you for your reply. The problem isn't with the figure above. The problem, more generally speaking is, that if figures get more complex, the shifting of text become a big annoyance. Is there a malfunction of the exporting capability of geogebra ? See the example below.

Everything is fine in Geogebra ( yayyy) :

This is how it looks in Latex : " Efficient Frontier", "Expected Return" and "Market Portfolio" have shifted.

PS. The problem doesn't occur, when I export to .png.

1

It's more like "not fully implemented" than "malfunction". We don't have anyone taking care of the TikZ code right now so it's hard for us to make improvements