Improving a TikZ picture, which is based on a GeoGebra file












3















I want to do a little graphical illustration of fixed points of the cubic function. Hence, I made a GeoGebra file that looks like: enter image description here



Based on that I would like to get a TikZ picture, so GeoGebra created the following code:



documentclass[10pt]{article}
usepackage{pgf,tikz,pgfplots}
pgfplotsset{compat=1.15}
usepackage{mathrsfs}
usetikzlibrary{arrows}
pagestyle{empty}
begin{document}
definecolor{uuuuuu}{rgb}{0.26666666666666666,0.26666666666666666,0.26666666666666666}
begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=3.393473219840507cm,y=3.1433709561724212cm, scale = 0.9, transform shape]
begin{axis}[
x=3.393473219840507cm,y=3.1433709561724212cm,
axis lines=middle,
xmin=-1.3734914110429448,
xmax=1.62708588957055,
ymin=-1.1911483659319086,
ymax=1.353890101224171,
xtick={-1.0,0.0,1.0},
ytick={-1.0,0.0,1.0},]
clip(-1.5734914110429448,-1.1911483659319086) rectangle (2.162708588957055,3.353890101224171);
draw[line width=0.8pt,smooth,samples=100,domain=-1.5734914110429448:1.962708588957055] plot(x,{(x)^(3.0)});
draw [line width=0.8pt,domain=-1.5734914110429448:1.962708588957055] plot(x,{(-0.--1.*x)/1.});
draw (-1.3945119631901841,-0.6566295470542595) node[anchor=north west] {fixed point at $x = -1$};
draw [->,line width=0.4pt] (-1.1269670132777865,-0.8093097675291255) -- (-1.0267447347382272,-0.9581246659666529);
draw (1.1573010736196316,0.8952972509370971) node[anchor=north west] {fixed point at $x = 1$};
draw (0.162066871165644,-0.20714781299805446) node[anchor=north west] {fixed point at $x = 0$};
draw (1.3389923312883434,1.3508530624805482) node[anchor=north west] {$y = x $};
draw (0.5803595092024538,1.3417419462496791) node[anchor=north west] {$f(x) = x^3$};
draw (0.01834095092024525,1.36300121745504) node[anchor=north west] {$f(x)$};
draw (1.5159338957055212,0.14514868126221436) node[anchor=north west] {$x$};
draw [->,line width=0.4pt] (0.1593550613496931,-0.23144412294703853) -- (0.02376457055214709,-0.027962527124297032);
draw [->,line width=0.4pt] (1.1491656441717788,0.843667592295506) -- (1.0298460122699384,0.9742602582712953);
draw [line width=0.8pt,dash pattern=on 1pt off 1pt] (-1.,-1.)-- (-1.,0.);
draw [line width=0.8pt,dash pattern=on 1pt off 1pt] (1.,1.)-- (1.,0.);
begin{scriptsize}
draw [fill=uuuuuu] (1.,1.) circle (2.0pt);
draw [fill=uuuuuu] (-1.,-1.) circle (2.0pt);
draw [fill=uuuuuu] (0.,0.) circle (2.0pt);
end{scriptsize}
end{axis}
end{tikzpicture}
end{document}


That results in



enter image description here



which looks almost like I want it to look like apart from the texts (fixed point at …).



How can I improve the code in order to position the texts (fixed point at …) like in Figure 1 (including the linebreak after "at")? I tried a few little things but nothing seems to work.










share|improve this question

























  • I would take that! I know it's certainly not the shortest or simplest way to do things like that, but it's the only way I can do it at the moment …

    – offline
    Apr 1 at 10:19
















3















I want to do a little graphical illustration of fixed points of the cubic function. Hence, I made a GeoGebra file that looks like: enter image description here



Based on that I would like to get a TikZ picture, so GeoGebra created the following code:



documentclass[10pt]{article}
usepackage{pgf,tikz,pgfplots}
pgfplotsset{compat=1.15}
usepackage{mathrsfs}
usetikzlibrary{arrows}
pagestyle{empty}
begin{document}
definecolor{uuuuuu}{rgb}{0.26666666666666666,0.26666666666666666,0.26666666666666666}
begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=3.393473219840507cm,y=3.1433709561724212cm, scale = 0.9, transform shape]
begin{axis}[
x=3.393473219840507cm,y=3.1433709561724212cm,
axis lines=middle,
xmin=-1.3734914110429448,
xmax=1.62708588957055,
ymin=-1.1911483659319086,
ymax=1.353890101224171,
xtick={-1.0,0.0,1.0},
ytick={-1.0,0.0,1.0},]
clip(-1.5734914110429448,-1.1911483659319086) rectangle (2.162708588957055,3.353890101224171);
draw[line width=0.8pt,smooth,samples=100,domain=-1.5734914110429448:1.962708588957055] plot(x,{(x)^(3.0)});
draw [line width=0.8pt,domain=-1.5734914110429448:1.962708588957055] plot(x,{(-0.--1.*x)/1.});
draw (-1.3945119631901841,-0.6566295470542595) node[anchor=north west] {fixed point at $x = -1$};
draw [->,line width=0.4pt] (-1.1269670132777865,-0.8093097675291255) -- (-1.0267447347382272,-0.9581246659666529);
draw (1.1573010736196316,0.8952972509370971) node[anchor=north west] {fixed point at $x = 1$};
draw (0.162066871165644,-0.20714781299805446) node[anchor=north west] {fixed point at $x = 0$};
draw (1.3389923312883434,1.3508530624805482) node[anchor=north west] {$y = x $};
draw (0.5803595092024538,1.3417419462496791) node[anchor=north west] {$f(x) = x^3$};
draw (0.01834095092024525,1.36300121745504) node[anchor=north west] {$f(x)$};
draw (1.5159338957055212,0.14514868126221436) node[anchor=north west] {$x$};
draw [->,line width=0.4pt] (0.1593550613496931,-0.23144412294703853) -- (0.02376457055214709,-0.027962527124297032);
draw [->,line width=0.4pt] (1.1491656441717788,0.843667592295506) -- (1.0298460122699384,0.9742602582712953);
draw [line width=0.8pt,dash pattern=on 1pt off 1pt] (-1.,-1.)-- (-1.,0.);
draw [line width=0.8pt,dash pattern=on 1pt off 1pt] (1.,1.)-- (1.,0.);
begin{scriptsize}
draw [fill=uuuuuu] (1.,1.) circle (2.0pt);
draw [fill=uuuuuu] (-1.,-1.) circle (2.0pt);
draw [fill=uuuuuu] (0.,0.) circle (2.0pt);
end{scriptsize}
end{axis}
end{tikzpicture}
end{document}


That results in



enter image description here



which looks almost like I want it to look like apart from the texts (fixed point at …).



How can I improve the code in order to position the texts (fixed point at …) like in Figure 1 (including the linebreak after "at")? I tried a few little things but nothing seems to work.










share|improve this question

























  • I would take that! I know it's certainly not the shortest or simplest way to do things like that, but it's the only way I can do it at the moment …

    – offline
    Apr 1 at 10:19














3












3








3


0






I want to do a little graphical illustration of fixed points of the cubic function. Hence, I made a GeoGebra file that looks like: enter image description here



Based on that I would like to get a TikZ picture, so GeoGebra created the following code:



documentclass[10pt]{article}
usepackage{pgf,tikz,pgfplots}
pgfplotsset{compat=1.15}
usepackage{mathrsfs}
usetikzlibrary{arrows}
pagestyle{empty}
begin{document}
definecolor{uuuuuu}{rgb}{0.26666666666666666,0.26666666666666666,0.26666666666666666}
begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=3.393473219840507cm,y=3.1433709561724212cm, scale = 0.9, transform shape]
begin{axis}[
x=3.393473219840507cm,y=3.1433709561724212cm,
axis lines=middle,
xmin=-1.3734914110429448,
xmax=1.62708588957055,
ymin=-1.1911483659319086,
ymax=1.353890101224171,
xtick={-1.0,0.0,1.0},
ytick={-1.0,0.0,1.0},]
clip(-1.5734914110429448,-1.1911483659319086) rectangle (2.162708588957055,3.353890101224171);
draw[line width=0.8pt,smooth,samples=100,domain=-1.5734914110429448:1.962708588957055] plot(x,{(x)^(3.0)});
draw [line width=0.8pt,domain=-1.5734914110429448:1.962708588957055] plot(x,{(-0.--1.*x)/1.});
draw (-1.3945119631901841,-0.6566295470542595) node[anchor=north west] {fixed point at $x = -1$};
draw [->,line width=0.4pt] (-1.1269670132777865,-0.8093097675291255) -- (-1.0267447347382272,-0.9581246659666529);
draw (1.1573010736196316,0.8952972509370971) node[anchor=north west] {fixed point at $x = 1$};
draw (0.162066871165644,-0.20714781299805446) node[anchor=north west] {fixed point at $x = 0$};
draw (1.3389923312883434,1.3508530624805482) node[anchor=north west] {$y = x $};
draw (0.5803595092024538,1.3417419462496791) node[anchor=north west] {$f(x) = x^3$};
draw (0.01834095092024525,1.36300121745504) node[anchor=north west] {$f(x)$};
draw (1.5159338957055212,0.14514868126221436) node[anchor=north west] {$x$};
draw [->,line width=0.4pt] (0.1593550613496931,-0.23144412294703853) -- (0.02376457055214709,-0.027962527124297032);
draw [->,line width=0.4pt] (1.1491656441717788,0.843667592295506) -- (1.0298460122699384,0.9742602582712953);
draw [line width=0.8pt,dash pattern=on 1pt off 1pt] (-1.,-1.)-- (-1.,0.);
draw [line width=0.8pt,dash pattern=on 1pt off 1pt] (1.,1.)-- (1.,0.);
begin{scriptsize}
draw [fill=uuuuuu] (1.,1.) circle (2.0pt);
draw [fill=uuuuuu] (-1.,-1.) circle (2.0pt);
draw [fill=uuuuuu] (0.,0.) circle (2.0pt);
end{scriptsize}
end{axis}
end{tikzpicture}
end{document}


That results in



enter image description here



which looks almost like I want it to look like apart from the texts (fixed point at …).



How can I improve the code in order to position the texts (fixed point at …) like in Figure 1 (including the linebreak after "at")? I tried a few little things but nothing seems to work.










share|improve this question
















I want to do a little graphical illustration of fixed points of the cubic function. Hence, I made a GeoGebra file that looks like: enter image description here



Based on that I would like to get a TikZ picture, so GeoGebra created the following code:



documentclass[10pt]{article}
usepackage{pgf,tikz,pgfplots}
pgfplotsset{compat=1.15}
usepackage{mathrsfs}
usetikzlibrary{arrows}
pagestyle{empty}
begin{document}
definecolor{uuuuuu}{rgb}{0.26666666666666666,0.26666666666666666,0.26666666666666666}
begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=3.393473219840507cm,y=3.1433709561724212cm, scale = 0.9, transform shape]
begin{axis}[
x=3.393473219840507cm,y=3.1433709561724212cm,
axis lines=middle,
xmin=-1.3734914110429448,
xmax=1.62708588957055,
ymin=-1.1911483659319086,
ymax=1.353890101224171,
xtick={-1.0,0.0,1.0},
ytick={-1.0,0.0,1.0},]
clip(-1.5734914110429448,-1.1911483659319086) rectangle (2.162708588957055,3.353890101224171);
draw[line width=0.8pt,smooth,samples=100,domain=-1.5734914110429448:1.962708588957055] plot(x,{(x)^(3.0)});
draw [line width=0.8pt,domain=-1.5734914110429448:1.962708588957055] plot(x,{(-0.--1.*x)/1.});
draw (-1.3945119631901841,-0.6566295470542595) node[anchor=north west] {fixed point at $x = -1$};
draw [->,line width=0.4pt] (-1.1269670132777865,-0.8093097675291255) -- (-1.0267447347382272,-0.9581246659666529);
draw (1.1573010736196316,0.8952972509370971) node[anchor=north west] {fixed point at $x = 1$};
draw (0.162066871165644,-0.20714781299805446) node[anchor=north west] {fixed point at $x = 0$};
draw (1.3389923312883434,1.3508530624805482) node[anchor=north west] {$y = x $};
draw (0.5803595092024538,1.3417419462496791) node[anchor=north west] {$f(x) = x^3$};
draw (0.01834095092024525,1.36300121745504) node[anchor=north west] {$f(x)$};
draw (1.5159338957055212,0.14514868126221436) node[anchor=north west] {$x$};
draw [->,line width=0.4pt] (0.1593550613496931,-0.23144412294703853) -- (0.02376457055214709,-0.027962527124297032);
draw [->,line width=0.4pt] (1.1491656441717788,0.843667592295506) -- (1.0298460122699384,0.9742602582712953);
draw [line width=0.8pt,dash pattern=on 1pt off 1pt] (-1.,-1.)-- (-1.,0.);
draw [line width=0.8pt,dash pattern=on 1pt off 1pt] (1.,1.)-- (1.,0.);
begin{scriptsize}
draw [fill=uuuuuu] (1.,1.) circle (2.0pt);
draw [fill=uuuuuu] (-1.,-1.) circle (2.0pt);
draw [fill=uuuuuu] (0.,0.) circle (2.0pt);
end{scriptsize}
end{axis}
end{tikzpicture}
end{document}


That results in



enter image description here



which looks almost like I want it to look like apart from the texts (fixed point at …).



How can I improve the code in order to position the texts (fixed point at …) like in Figure 1 (including the linebreak after "at")? I tried a few little things but nothing seems to work.







tikz-pgf geogebra






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 1 at 10:28







offline

















asked Apr 1 at 10:15









offlineoffline

545




545













  • I would take that! I know it's certainly not the shortest or simplest way to do things like that, but it's the only way I can do it at the moment …

    – offline
    Apr 1 at 10:19



















  • I would take that! I know it's certainly not the shortest or simplest way to do things like that, but it's the only way I can do it at the moment …

    – offline
    Apr 1 at 10:19

















I would take that! I know it's certainly not the shortest or simplest way to do things like that, but it's the only way I can do it at the moment …

– offline
Apr 1 at 10:19





I would take that! I know it's certainly not the shortest or simplest way to do things like that, but it's the only way I can do it at the moment …

– offline
Apr 1 at 10:19










1 Answer
1






active

oldest

votes


















3














This is a proposal.



documentclass[tikz]{standalone}
usetikzlibrary{calc}
begin{document}
begin{tikzpicture}[>=stealth,scale=3]
draw[->] (0,-1.2)--(0,1.4) node[below right] {$f(x)$};
draw[->] (-1.6,0)--(2,0) node[above left] {$x$};
draw[thick] plot[samples=2,domain=-1.2:1.4] (x,x);
draw[thick] plot[smooth,samples=500,domain=-1.06:1.12] (x,x^3);
fill (-1,-1) circle (.5pt) coordinate (a) (0,0) circle (.5pt) coordinate (b) (1,1) circle (.5pt) coordinate (c);
draw[dashed] (-1,-1)--(-1,0) (1,0)--(1,1);
draw (-1,-.03) node[below] {$-1$}--(-1,.03) (1,-.03) node[below] {$1$}--(1,.03);
draw (-.03,-1) node[left] {$-1$}--(.03,-1) (-.03,1) node[left] {$1$}--(.03,1);
draw (1.1,{1.1^3}) node[left] {$f(x)=x^3$};
draw (1.3,1.3) node[below right] {$y=x$};
draw[<-] ($(a)+(150:.05)$)--++(150:.2) node[above left,align=left] {fixed point\at $x=-1$};
draw[<-] ($(b)+(-30:.05)$)--++(-30:.2) node[below right,align=left] {fixed point\at $x=0$};
draw[<-] ($(c)+(-30:.05)$)--++(-30:.2) node[below right,align=left] {fixed point\at $x=1$};
end{tikzpicture}
end{document}


enter image description here



Some notes:





  • draw plot helps us draw plot even without pgfplots.

  • Library calc helps us calculate coordinates. Read more here

  • Nodes can be multi-line, however you need to add alignment option (align=...) and/or text width option. Read more here.






share|improve this answer


























  • @Kpym Yes, one can use draw[thick] (-1.2,-1.2) -- (1.4,1.4). I used plot so that the OP could understand how to draw a plot, with two examples. Anyway with pdfLaTeX the compilation process is still very quick.

    – JouleV
    Apr 2 at 3:54











  • @Kpym samples=1 is enough :) I just edited my answer.

    – JouleV
    Apr 2 at 13:21











  • @Kpym Thanks. You taught me something today :))

    – JouleV
    Apr 2 at 13:26











  • @Kpym I never consider a comment from a 18k rep user as a stupid comment. Thanks again - I just had a check on page 337 of the manual, and the initial value of samples is indeed 25.

    – JouleV
    Apr 2 at 13:29











  • @JouleV In this case I continue : [smooth,samples=500] is overfilling for x^3 and even in general. A pdf with only this curve for [smooth,samples=500] is 13k, [samples=500] is 6k and [smooth] is 2k. And you can't see the difference between this 3 curves.

    – Kpym
    Apr 2 at 13:40












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f482555%2fimproving-a-tikz-picture-which-is-based-on-a-geogebra-file%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









3














This is a proposal.



documentclass[tikz]{standalone}
usetikzlibrary{calc}
begin{document}
begin{tikzpicture}[>=stealth,scale=3]
draw[->] (0,-1.2)--(0,1.4) node[below right] {$f(x)$};
draw[->] (-1.6,0)--(2,0) node[above left] {$x$};
draw[thick] plot[samples=2,domain=-1.2:1.4] (x,x);
draw[thick] plot[smooth,samples=500,domain=-1.06:1.12] (x,x^3);
fill (-1,-1) circle (.5pt) coordinate (a) (0,0) circle (.5pt) coordinate (b) (1,1) circle (.5pt) coordinate (c);
draw[dashed] (-1,-1)--(-1,0) (1,0)--(1,1);
draw (-1,-.03) node[below] {$-1$}--(-1,.03) (1,-.03) node[below] {$1$}--(1,.03);
draw (-.03,-1) node[left] {$-1$}--(.03,-1) (-.03,1) node[left] {$1$}--(.03,1);
draw (1.1,{1.1^3}) node[left] {$f(x)=x^3$};
draw (1.3,1.3) node[below right] {$y=x$};
draw[<-] ($(a)+(150:.05)$)--++(150:.2) node[above left,align=left] {fixed point\at $x=-1$};
draw[<-] ($(b)+(-30:.05)$)--++(-30:.2) node[below right,align=left] {fixed point\at $x=0$};
draw[<-] ($(c)+(-30:.05)$)--++(-30:.2) node[below right,align=left] {fixed point\at $x=1$};
end{tikzpicture}
end{document}


enter image description here



Some notes:





  • draw plot helps us draw plot even without pgfplots.

  • Library calc helps us calculate coordinates. Read more here

  • Nodes can be multi-line, however you need to add alignment option (align=...) and/or text width option. Read more here.






share|improve this answer


























  • @Kpym Yes, one can use draw[thick] (-1.2,-1.2) -- (1.4,1.4). I used plot so that the OP could understand how to draw a plot, with two examples. Anyway with pdfLaTeX the compilation process is still very quick.

    – JouleV
    Apr 2 at 3:54











  • @Kpym samples=1 is enough :) I just edited my answer.

    – JouleV
    Apr 2 at 13:21











  • @Kpym Thanks. You taught me something today :))

    – JouleV
    Apr 2 at 13:26











  • @Kpym I never consider a comment from a 18k rep user as a stupid comment. Thanks again - I just had a check on page 337 of the manual, and the initial value of samples is indeed 25.

    – JouleV
    Apr 2 at 13:29











  • @JouleV In this case I continue : [smooth,samples=500] is overfilling for x^3 and even in general. A pdf with only this curve for [smooth,samples=500] is 13k, [samples=500] is 6k and [smooth] is 2k. And you can't see the difference between this 3 curves.

    – Kpym
    Apr 2 at 13:40
















3














This is a proposal.



documentclass[tikz]{standalone}
usetikzlibrary{calc}
begin{document}
begin{tikzpicture}[>=stealth,scale=3]
draw[->] (0,-1.2)--(0,1.4) node[below right] {$f(x)$};
draw[->] (-1.6,0)--(2,0) node[above left] {$x$};
draw[thick] plot[samples=2,domain=-1.2:1.4] (x,x);
draw[thick] plot[smooth,samples=500,domain=-1.06:1.12] (x,x^3);
fill (-1,-1) circle (.5pt) coordinate (a) (0,0) circle (.5pt) coordinate (b) (1,1) circle (.5pt) coordinate (c);
draw[dashed] (-1,-1)--(-1,0) (1,0)--(1,1);
draw (-1,-.03) node[below] {$-1$}--(-1,.03) (1,-.03) node[below] {$1$}--(1,.03);
draw (-.03,-1) node[left] {$-1$}--(.03,-1) (-.03,1) node[left] {$1$}--(.03,1);
draw (1.1,{1.1^3}) node[left] {$f(x)=x^3$};
draw (1.3,1.3) node[below right] {$y=x$};
draw[<-] ($(a)+(150:.05)$)--++(150:.2) node[above left,align=left] {fixed point\at $x=-1$};
draw[<-] ($(b)+(-30:.05)$)--++(-30:.2) node[below right,align=left] {fixed point\at $x=0$};
draw[<-] ($(c)+(-30:.05)$)--++(-30:.2) node[below right,align=left] {fixed point\at $x=1$};
end{tikzpicture}
end{document}


enter image description here



Some notes:





  • draw plot helps us draw plot even without pgfplots.

  • Library calc helps us calculate coordinates. Read more here

  • Nodes can be multi-line, however you need to add alignment option (align=...) and/or text width option. Read more here.






share|improve this answer


























  • @Kpym Yes, one can use draw[thick] (-1.2,-1.2) -- (1.4,1.4). I used plot so that the OP could understand how to draw a plot, with two examples. Anyway with pdfLaTeX the compilation process is still very quick.

    – JouleV
    Apr 2 at 3:54











  • @Kpym samples=1 is enough :) I just edited my answer.

    – JouleV
    Apr 2 at 13:21











  • @Kpym Thanks. You taught me something today :))

    – JouleV
    Apr 2 at 13:26











  • @Kpym I never consider a comment from a 18k rep user as a stupid comment. Thanks again - I just had a check on page 337 of the manual, and the initial value of samples is indeed 25.

    – JouleV
    Apr 2 at 13:29











  • @JouleV In this case I continue : [smooth,samples=500] is overfilling for x^3 and even in general. A pdf with only this curve for [smooth,samples=500] is 13k, [samples=500] is 6k and [smooth] is 2k. And you can't see the difference between this 3 curves.

    – Kpym
    Apr 2 at 13:40














3












3








3







This is a proposal.



documentclass[tikz]{standalone}
usetikzlibrary{calc}
begin{document}
begin{tikzpicture}[>=stealth,scale=3]
draw[->] (0,-1.2)--(0,1.4) node[below right] {$f(x)$};
draw[->] (-1.6,0)--(2,0) node[above left] {$x$};
draw[thick] plot[samples=2,domain=-1.2:1.4] (x,x);
draw[thick] plot[smooth,samples=500,domain=-1.06:1.12] (x,x^3);
fill (-1,-1) circle (.5pt) coordinate (a) (0,0) circle (.5pt) coordinate (b) (1,1) circle (.5pt) coordinate (c);
draw[dashed] (-1,-1)--(-1,0) (1,0)--(1,1);
draw (-1,-.03) node[below] {$-1$}--(-1,.03) (1,-.03) node[below] {$1$}--(1,.03);
draw (-.03,-1) node[left] {$-1$}--(.03,-1) (-.03,1) node[left] {$1$}--(.03,1);
draw (1.1,{1.1^3}) node[left] {$f(x)=x^3$};
draw (1.3,1.3) node[below right] {$y=x$};
draw[<-] ($(a)+(150:.05)$)--++(150:.2) node[above left,align=left] {fixed point\at $x=-1$};
draw[<-] ($(b)+(-30:.05)$)--++(-30:.2) node[below right,align=left] {fixed point\at $x=0$};
draw[<-] ($(c)+(-30:.05)$)--++(-30:.2) node[below right,align=left] {fixed point\at $x=1$};
end{tikzpicture}
end{document}


enter image description here



Some notes:





  • draw plot helps us draw plot even without pgfplots.

  • Library calc helps us calculate coordinates. Read more here

  • Nodes can be multi-line, however you need to add alignment option (align=...) and/or text width option. Read more here.






share|improve this answer















This is a proposal.



documentclass[tikz]{standalone}
usetikzlibrary{calc}
begin{document}
begin{tikzpicture}[>=stealth,scale=3]
draw[->] (0,-1.2)--(0,1.4) node[below right] {$f(x)$};
draw[->] (-1.6,0)--(2,0) node[above left] {$x$};
draw[thick] plot[samples=2,domain=-1.2:1.4] (x,x);
draw[thick] plot[smooth,samples=500,domain=-1.06:1.12] (x,x^3);
fill (-1,-1) circle (.5pt) coordinate (a) (0,0) circle (.5pt) coordinate (b) (1,1) circle (.5pt) coordinate (c);
draw[dashed] (-1,-1)--(-1,0) (1,0)--(1,1);
draw (-1,-.03) node[below] {$-1$}--(-1,.03) (1,-.03) node[below] {$1$}--(1,.03);
draw (-.03,-1) node[left] {$-1$}--(.03,-1) (-.03,1) node[left] {$1$}--(.03,1);
draw (1.1,{1.1^3}) node[left] {$f(x)=x^3$};
draw (1.3,1.3) node[below right] {$y=x$};
draw[<-] ($(a)+(150:.05)$)--++(150:.2) node[above left,align=left] {fixed point\at $x=-1$};
draw[<-] ($(b)+(-30:.05)$)--++(-30:.2) node[below right,align=left] {fixed point\at $x=0$};
draw[<-] ($(c)+(-30:.05)$)--++(-30:.2) node[below right,align=left] {fixed point\at $x=1$};
end{tikzpicture}
end{document}


enter image description here



Some notes:





  • draw plot helps us draw plot even without pgfplots.

  • Library calc helps us calculate coordinates. Read more here

  • Nodes can be multi-line, however you need to add alignment option (align=...) and/or text width option. Read more here.







share|improve this answer














share|improve this answer



share|improve this answer








edited Apr 2 at 13:26

























answered Apr 1 at 10:33









JouleVJouleV

12.3k22663




12.3k22663













  • @Kpym Yes, one can use draw[thick] (-1.2,-1.2) -- (1.4,1.4). I used plot so that the OP could understand how to draw a plot, with two examples. Anyway with pdfLaTeX the compilation process is still very quick.

    – JouleV
    Apr 2 at 3:54











  • @Kpym samples=1 is enough :) I just edited my answer.

    – JouleV
    Apr 2 at 13:21











  • @Kpym Thanks. You taught me something today :))

    – JouleV
    Apr 2 at 13:26











  • @Kpym I never consider a comment from a 18k rep user as a stupid comment. Thanks again - I just had a check on page 337 of the manual, and the initial value of samples is indeed 25.

    – JouleV
    Apr 2 at 13:29











  • @JouleV In this case I continue : [smooth,samples=500] is overfilling for x^3 and even in general. A pdf with only this curve for [smooth,samples=500] is 13k, [samples=500] is 6k and [smooth] is 2k. And you can't see the difference between this 3 curves.

    – Kpym
    Apr 2 at 13:40



















  • @Kpym Yes, one can use draw[thick] (-1.2,-1.2) -- (1.4,1.4). I used plot so that the OP could understand how to draw a plot, with two examples. Anyway with pdfLaTeX the compilation process is still very quick.

    – JouleV
    Apr 2 at 3:54











  • @Kpym samples=1 is enough :) I just edited my answer.

    – JouleV
    Apr 2 at 13:21











  • @Kpym Thanks. You taught me something today :))

    – JouleV
    Apr 2 at 13:26











  • @Kpym I never consider a comment from a 18k rep user as a stupid comment. Thanks again - I just had a check on page 337 of the manual, and the initial value of samples is indeed 25.

    – JouleV
    Apr 2 at 13:29











  • @JouleV In this case I continue : [smooth,samples=500] is overfilling for x^3 and even in general. A pdf with only this curve for [smooth,samples=500] is 13k, [samples=500] is 6k and [smooth] is 2k. And you can't see the difference between this 3 curves.

    – Kpym
    Apr 2 at 13:40

















@Kpym Yes, one can use draw[thick] (-1.2,-1.2) -- (1.4,1.4). I used plot so that the OP could understand how to draw a plot, with two examples. Anyway with pdfLaTeX the compilation process is still very quick.

– JouleV
Apr 2 at 3:54





@Kpym Yes, one can use draw[thick] (-1.2,-1.2) -- (1.4,1.4). I used plot so that the OP could understand how to draw a plot, with two examples. Anyway with pdfLaTeX the compilation process is still very quick.

– JouleV
Apr 2 at 3:54













@Kpym samples=1 is enough :) I just edited my answer.

– JouleV
Apr 2 at 13:21





@Kpym samples=1 is enough :) I just edited my answer.

– JouleV
Apr 2 at 13:21













@Kpym Thanks. You taught me something today :))

– JouleV
Apr 2 at 13:26





@Kpym Thanks. You taught me something today :))

– JouleV
Apr 2 at 13:26













@Kpym I never consider a comment from a 18k rep user as a stupid comment. Thanks again - I just had a check on page 337 of the manual, and the initial value of samples is indeed 25.

– JouleV
Apr 2 at 13:29





@Kpym I never consider a comment from a 18k rep user as a stupid comment. Thanks again - I just had a check on page 337 of the manual, and the initial value of samples is indeed 25.

– JouleV
Apr 2 at 13:29













@JouleV In this case I continue : [smooth,samples=500] is overfilling for x^3 and even in general. A pdf with only this curve for [smooth,samples=500] is 13k, [samples=500] is 6k and [smooth] is 2k. And you can't see the difference between this 3 curves.

– Kpym
Apr 2 at 13:40





@JouleV In this case I continue : [smooth,samples=500] is overfilling for x^3 and even in general. A pdf with only this curve for [smooth,samples=500] is 13k, [samples=500] is 6k and [smooth] is 2k. And you can't see the difference between this 3 curves.

– Kpym
Apr 2 at 13:40


















draft saved

draft discarded




















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f482555%2fimproving-a-tikz-picture-which-is-based-on-a-geogebra-file%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to send String Array data to Server using php in android

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

Is anime1.com a legal site for watching anime?