Help! How to draw the plot of y=(ax+b)/(cx+d) and give an example!











up vote
6
down vote

favorite












I find in pst-plot.pdf, pst-func.pdf document but there is no its tutorial. So I hope anyone help me to draw the plot of it.(its code :-)) ). Thanks.



Example:
y=(x-2)/(2x+1)



enter image description here



Can anyone draw it by Pstricks environment?










share|improve this question




















  • 2




    Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with documentclass{...} and ending with end{document}. Note this is a Q&A site, not a please do this for me service. What do you have so far.
    – albert
    Nov 17 at 14:41










  • Sorry, i don't know its code so i hope anyone know about it to help me.
    – chishimotoji
    Nov 17 at 14:47










  • Vietnamese TikZ tutorial: Link
    – Dũng Vũ
    Nov 17 at 15:01










  • There is no the plot of functions y=(ax+b)/(cx+d). :))
    – chishimotoji
    Nov 17 at 15:07















up vote
6
down vote

favorite












I find in pst-plot.pdf, pst-func.pdf document but there is no its tutorial. So I hope anyone help me to draw the plot of it.(its code :-)) ). Thanks.



Example:
y=(x-2)/(2x+1)



enter image description here



Can anyone draw it by Pstricks environment?










share|improve this question




















  • 2




    Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with documentclass{...} and ending with end{document}. Note this is a Q&A site, not a please do this for me service. What do you have so far.
    – albert
    Nov 17 at 14:41










  • Sorry, i don't know its code so i hope anyone know about it to help me.
    – chishimotoji
    Nov 17 at 14:47










  • Vietnamese TikZ tutorial: Link
    – Dũng Vũ
    Nov 17 at 15:01










  • There is no the plot of functions y=(ax+b)/(cx+d). :))
    – chishimotoji
    Nov 17 at 15:07













up vote
6
down vote

favorite









up vote
6
down vote

favorite











I find in pst-plot.pdf, pst-func.pdf document but there is no its tutorial. So I hope anyone help me to draw the plot of it.(its code :-)) ). Thanks.



Example:
y=(x-2)/(2x+1)



enter image description here



Can anyone draw it by Pstricks environment?










share|improve this question















I find in pst-plot.pdf, pst-func.pdf document but there is no its tutorial. So I hope anyone help me to draw the plot of it.(its code :-)) ). Thanks.



Example:
y=(x-2)/(2x+1)



enter image description here



Can anyone draw it by Pstricks environment?







tikz-pgf pstricks plot pst-plot






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 17 at 16:15









Artificial Stupidity

4,62011035




4,62011035










asked Nov 17 at 13:56









chishimotoji

308111




308111








  • 2




    Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with documentclass{...} and ending with end{document}. Note this is a Q&A site, not a please do this for me service. What do you have so far.
    – albert
    Nov 17 at 14:41










  • Sorry, i don't know its code so i hope anyone know about it to help me.
    – chishimotoji
    Nov 17 at 14:47










  • Vietnamese TikZ tutorial: Link
    – Dũng Vũ
    Nov 17 at 15:01










  • There is no the plot of functions y=(ax+b)/(cx+d). :))
    – chishimotoji
    Nov 17 at 15:07














  • 2




    Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with documentclass{...} and ending with end{document}. Note this is a Q&A site, not a please do this for me service. What do you have so far.
    – albert
    Nov 17 at 14:41










  • Sorry, i don't know its code so i hope anyone know about it to help me.
    – chishimotoji
    Nov 17 at 14:47










  • Vietnamese TikZ tutorial: Link
    – Dũng Vũ
    Nov 17 at 15:01










  • There is no the plot of functions y=(ax+b)/(cx+d). :))
    – chishimotoji
    Nov 17 at 15:07








2




2




Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with documentclass{...} and ending with end{document}. Note this is a Q&A site, not a please do this for me service. What do you have so far.
– albert
Nov 17 at 14:41




Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with documentclass{...} and ending with end{document}. Note this is a Q&A site, not a please do this for me service. What do you have so far.
– albert
Nov 17 at 14:41












Sorry, i don't know its code so i hope anyone know about it to help me.
– chishimotoji
Nov 17 at 14:47




Sorry, i don't know its code so i hope anyone know about it to help me.
– chishimotoji
Nov 17 at 14:47












Vietnamese TikZ tutorial: Link
– Dũng Vũ
Nov 17 at 15:01




Vietnamese TikZ tutorial: Link
– Dũng Vũ
Nov 17 at 15:01












There is no the plot of functions y=(ax+b)/(cx+d). :))
– chishimotoji
Nov 17 at 15:07




There is no the plot of functions y=(ax+b)/(cx+d). :))
– chishimotoji
Nov 17 at 15:07










3 Answers
3






active

oldest

votes

















up vote
15
down vote



accepted










documentclass{article}


usepackage{pgfplots}



begin{document}

begin{center}
begin{tikzpicture}[scale=2]
begin{axis}[axis lines=middle]
addplot[smooth,domain=-4:-8/11,purple,very thick] {(x-2)/(2*x+1)};
addplot[smooth,domain=-2/7:4,purple,very thick] {(x-2)/(2*x+1)};
draw[blue] (axis cs:-0.5,-6)--(axis cs:-0.5,6)
(axis cs:-4,0.5)--(axis cs:4,0.5);
fill[red] (axis cs:-0.5,0.5) circle(1mm);
end{axis}
end{tikzpicture}
end{center}
end{document}


enter image description here






share|improve this answer

















  • 1




    Thank you for your answer.
    – chishimotoji
    Nov 17 at 14:56






  • 2




    @TrongVuong If you agree with this answer, then you accept it and vote for answer.
    – minhthien_2016
    Nov 17 at 15:58




















up vote
7
down vote













documentclass[pstricks,border=12pt]{standalone}
usepackage{pst-plot}

begin{document}
begin{pspicture}[algebraic](-6,-6)(6,6)
psaxes{->}(0,0)(-5.5,-5.5)(5.5,5.5)[$x$,0][$y$,90]
psline[linecolor=red,linewidth=0.2pt](-0.5,-5.5)(-0.5,5.5)
psline[linecolor=red,linewidth=0.2pt](-5.5,0.5)(5.5,0.5)
psplot[plotpoints=1001,linecolor=blue,linewidth=2pt,
yMaxValue=5.25]{-5.5}{5}{(x-2)/(2*x+1)}
psdots[linecolor=red](-0.5,0.5)(0,0)(0,-2)(1,0)(2,0)
end{pspicture}
end{document}


enter image description here






share|improve this answer





















  • Good answer. Thanks
    – chishimotoji
    Nov 17 at 23:03


















up vote
7
down vote













A PSTricks answer for the PSTricks question.



documentclass[pstricks,border=12pt]{standalone}
usepackage{pst-plot}
deff{(x-2)/(2*x+1)}

begin{document}
begin{pspicture}[algebraic](-4,-4)(6,5.5)
psaxes{->}(0,0)(-4,-4)(5.5,5)[$x$,0][$y$,90]
psline[linestyle=dashed,linecolor=red](-0.5,-4)(-0.5,5)
psline[linestyle=dashed,linecolor=red](-4,0.5)(5,0.5)
psset{linecolor=blue,linewidth=2pt}
psplot{-4}{-7 9 div}{f}
psplot{-2 9 div}{5}{f}
end{pspicture}
end{document}


enter image description here



NOTE



Increasing plotpoints sometimes is not a wise method because it will increase the size of its output (either PDF or SVG).



More flexible solution



documentclass[pstricks,border=12pt]{standalone}
usepackage{pst-plot}
deff(#1){((#1-2)/(2*(#1)+1))}% y=f(x)
defg(#1){((2+#1)/(1-2*(#1)))}% y=g(x) in which g is the inverse of f.

pstVerb{/I2P {AlgParser cvx exec} def}% infix to postfix operator

begin{document}
begin{pspicture}[algebraic](-4,-4)(6,6)
psaxes{->}(0,0)(-4,-4)(5.5,5.5)[$x$,0][$y$,90]
psline[linestyle=dashed,linecolor=red](-0.5,-4)(-0.5,5)
psline[linestyle=dashed,linecolor=red](-4,0.5)(5,0.5)
psset{linecolor=blue,linewidth=2pt}
psplot{-4}{g(5) I2P}{f(x)}
psplot{g(-4) I2P}{5}{f(x)}
end{pspicture}
end{document}





share|improve this answer























  • Thank you bro.:))
    – chishimotoji
    Nov 17 at 22:51






  • 1




    Hey guy! In JPi's answer, the plot of function overlay x-axes and y-axes at y=6,x=4. Can you fix your code at y=5,y=-4?
    – chishimotoji
    Nov 18 at 4:53










  • Big thanks. :-))
    – chishimotoji
    Nov 18 at 5:20











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',
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%2f460456%2fhelp-how-to-draw-the-plot-of-y-axb-cxd-and-give-an-example%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























3 Answers
3






active

oldest

votes








3 Answers
3






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
15
down vote



accepted










documentclass{article}


usepackage{pgfplots}



begin{document}

begin{center}
begin{tikzpicture}[scale=2]
begin{axis}[axis lines=middle]
addplot[smooth,domain=-4:-8/11,purple,very thick] {(x-2)/(2*x+1)};
addplot[smooth,domain=-2/7:4,purple,very thick] {(x-2)/(2*x+1)};
draw[blue] (axis cs:-0.5,-6)--(axis cs:-0.5,6)
(axis cs:-4,0.5)--(axis cs:4,0.5);
fill[red] (axis cs:-0.5,0.5) circle(1mm);
end{axis}
end{tikzpicture}
end{center}
end{document}


enter image description here






share|improve this answer

















  • 1




    Thank you for your answer.
    – chishimotoji
    Nov 17 at 14:56






  • 2




    @TrongVuong If you agree with this answer, then you accept it and vote for answer.
    – minhthien_2016
    Nov 17 at 15:58

















up vote
15
down vote



accepted










documentclass{article}


usepackage{pgfplots}



begin{document}

begin{center}
begin{tikzpicture}[scale=2]
begin{axis}[axis lines=middle]
addplot[smooth,domain=-4:-8/11,purple,very thick] {(x-2)/(2*x+1)};
addplot[smooth,domain=-2/7:4,purple,very thick] {(x-2)/(2*x+1)};
draw[blue] (axis cs:-0.5,-6)--(axis cs:-0.5,6)
(axis cs:-4,0.5)--(axis cs:4,0.5);
fill[red] (axis cs:-0.5,0.5) circle(1mm);
end{axis}
end{tikzpicture}
end{center}
end{document}


enter image description here






share|improve this answer

















  • 1




    Thank you for your answer.
    – chishimotoji
    Nov 17 at 14:56






  • 2




    @TrongVuong If you agree with this answer, then you accept it and vote for answer.
    – minhthien_2016
    Nov 17 at 15:58















up vote
15
down vote



accepted







up vote
15
down vote



accepted






documentclass{article}


usepackage{pgfplots}



begin{document}

begin{center}
begin{tikzpicture}[scale=2]
begin{axis}[axis lines=middle]
addplot[smooth,domain=-4:-8/11,purple,very thick] {(x-2)/(2*x+1)};
addplot[smooth,domain=-2/7:4,purple,very thick] {(x-2)/(2*x+1)};
draw[blue] (axis cs:-0.5,-6)--(axis cs:-0.5,6)
(axis cs:-4,0.5)--(axis cs:4,0.5);
fill[red] (axis cs:-0.5,0.5) circle(1mm);
end{axis}
end{tikzpicture}
end{center}
end{document}


enter image description here






share|improve this answer












documentclass{article}


usepackage{pgfplots}



begin{document}

begin{center}
begin{tikzpicture}[scale=2]
begin{axis}[axis lines=middle]
addplot[smooth,domain=-4:-8/11,purple,very thick] {(x-2)/(2*x+1)};
addplot[smooth,domain=-2/7:4,purple,very thick] {(x-2)/(2*x+1)};
draw[blue] (axis cs:-0.5,-6)--(axis cs:-0.5,6)
(axis cs:-4,0.5)--(axis cs:4,0.5);
fill[red] (axis cs:-0.5,0.5) circle(1mm);
end{axis}
end{tikzpicture}
end{center}
end{document}


enter image description here







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 17 at 14:54









JPi

9,46421448




9,46421448








  • 1




    Thank you for your answer.
    – chishimotoji
    Nov 17 at 14:56






  • 2




    @TrongVuong If you agree with this answer, then you accept it and vote for answer.
    – minhthien_2016
    Nov 17 at 15:58
















  • 1




    Thank you for your answer.
    – chishimotoji
    Nov 17 at 14:56






  • 2




    @TrongVuong If you agree with this answer, then you accept it and vote for answer.
    – minhthien_2016
    Nov 17 at 15:58










1




1




Thank you for your answer.
– chishimotoji
Nov 17 at 14:56




Thank you for your answer.
– chishimotoji
Nov 17 at 14:56




2




2




@TrongVuong If you agree with this answer, then you accept it and vote for answer.
– minhthien_2016
Nov 17 at 15:58






@TrongVuong If you agree with this answer, then you accept it and vote for answer.
– minhthien_2016
Nov 17 at 15:58












up vote
7
down vote













documentclass[pstricks,border=12pt]{standalone}
usepackage{pst-plot}

begin{document}
begin{pspicture}[algebraic](-6,-6)(6,6)
psaxes{->}(0,0)(-5.5,-5.5)(5.5,5.5)[$x$,0][$y$,90]
psline[linecolor=red,linewidth=0.2pt](-0.5,-5.5)(-0.5,5.5)
psline[linecolor=red,linewidth=0.2pt](-5.5,0.5)(5.5,0.5)
psplot[plotpoints=1001,linecolor=blue,linewidth=2pt,
yMaxValue=5.25]{-5.5}{5}{(x-2)/(2*x+1)}
psdots[linecolor=red](-0.5,0.5)(0,0)(0,-2)(1,0)(2,0)
end{pspicture}
end{document}


enter image description here






share|improve this answer





















  • Good answer. Thanks
    – chishimotoji
    Nov 17 at 23:03















up vote
7
down vote













documentclass[pstricks,border=12pt]{standalone}
usepackage{pst-plot}

begin{document}
begin{pspicture}[algebraic](-6,-6)(6,6)
psaxes{->}(0,0)(-5.5,-5.5)(5.5,5.5)[$x$,0][$y$,90]
psline[linecolor=red,linewidth=0.2pt](-0.5,-5.5)(-0.5,5.5)
psline[linecolor=red,linewidth=0.2pt](-5.5,0.5)(5.5,0.5)
psplot[plotpoints=1001,linecolor=blue,linewidth=2pt,
yMaxValue=5.25]{-5.5}{5}{(x-2)/(2*x+1)}
psdots[linecolor=red](-0.5,0.5)(0,0)(0,-2)(1,0)(2,0)
end{pspicture}
end{document}


enter image description here






share|improve this answer





















  • Good answer. Thanks
    – chishimotoji
    Nov 17 at 23:03













up vote
7
down vote










up vote
7
down vote









documentclass[pstricks,border=12pt]{standalone}
usepackage{pst-plot}

begin{document}
begin{pspicture}[algebraic](-6,-6)(6,6)
psaxes{->}(0,0)(-5.5,-5.5)(5.5,5.5)[$x$,0][$y$,90]
psline[linecolor=red,linewidth=0.2pt](-0.5,-5.5)(-0.5,5.5)
psline[linecolor=red,linewidth=0.2pt](-5.5,0.5)(5.5,0.5)
psplot[plotpoints=1001,linecolor=blue,linewidth=2pt,
yMaxValue=5.25]{-5.5}{5}{(x-2)/(2*x+1)}
psdots[linecolor=red](-0.5,0.5)(0,0)(0,-2)(1,0)(2,0)
end{pspicture}
end{document}


enter image description here






share|improve this answer












documentclass[pstricks,border=12pt]{standalone}
usepackage{pst-plot}

begin{document}
begin{pspicture}[algebraic](-6,-6)(6,6)
psaxes{->}(0,0)(-5.5,-5.5)(5.5,5.5)[$x$,0][$y$,90]
psline[linecolor=red,linewidth=0.2pt](-0.5,-5.5)(-0.5,5.5)
psline[linecolor=red,linewidth=0.2pt](-5.5,0.5)(5.5,0.5)
psplot[plotpoints=1001,linecolor=blue,linewidth=2pt,
yMaxValue=5.25]{-5.5}{5}{(x-2)/(2*x+1)}
psdots[linecolor=red](-0.5,0.5)(0,0)(0,-2)(1,0)(2,0)
end{pspicture}
end{document}


enter image description here







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 17 at 16:33









Herbert

266k23405714




266k23405714












  • Good answer. Thanks
    – chishimotoji
    Nov 17 at 23:03


















  • Good answer. Thanks
    – chishimotoji
    Nov 17 at 23:03
















Good answer. Thanks
– chishimotoji
Nov 17 at 23:03




Good answer. Thanks
– chishimotoji
Nov 17 at 23:03










up vote
7
down vote













A PSTricks answer for the PSTricks question.



documentclass[pstricks,border=12pt]{standalone}
usepackage{pst-plot}
deff{(x-2)/(2*x+1)}

begin{document}
begin{pspicture}[algebraic](-4,-4)(6,5.5)
psaxes{->}(0,0)(-4,-4)(5.5,5)[$x$,0][$y$,90]
psline[linestyle=dashed,linecolor=red](-0.5,-4)(-0.5,5)
psline[linestyle=dashed,linecolor=red](-4,0.5)(5,0.5)
psset{linecolor=blue,linewidth=2pt}
psplot{-4}{-7 9 div}{f}
psplot{-2 9 div}{5}{f}
end{pspicture}
end{document}


enter image description here



NOTE



Increasing plotpoints sometimes is not a wise method because it will increase the size of its output (either PDF or SVG).



More flexible solution



documentclass[pstricks,border=12pt]{standalone}
usepackage{pst-plot}
deff(#1){((#1-2)/(2*(#1)+1))}% y=f(x)
defg(#1){((2+#1)/(1-2*(#1)))}% y=g(x) in which g is the inverse of f.

pstVerb{/I2P {AlgParser cvx exec} def}% infix to postfix operator

begin{document}
begin{pspicture}[algebraic](-4,-4)(6,6)
psaxes{->}(0,0)(-4,-4)(5.5,5.5)[$x$,0][$y$,90]
psline[linestyle=dashed,linecolor=red](-0.5,-4)(-0.5,5)
psline[linestyle=dashed,linecolor=red](-4,0.5)(5,0.5)
psset{linecolor=blue,linewidth=2pt}
psplot{-4}{g(5) I2P}{f(x)}
psplot{g(-4) I2P}{5}{f(x)}
end{pspicture}
end{document}





share|improve this answer























  • Thank you bro.:))
    – chishimotoji
    Nov 17 at 22:51






  • 1




    Hey guy! In JPi's answer, the plot of function overlay x-axes and y-axes at y=6,x=4. Can you fix your code at y=5,y=-4?
    – chishimotoji
    Nov 18 at 4:53










  • Big thanks. :-))
    – chishimotoji
    Nov 18 at 5:20















up vote
7
down vote













A PSTricks answer for the PSTricks question.



documentclass[pstricks,border=12pt]{standalone}
usepackage{pst-plot}
deff{(x-2)/(2*x+1)}

begin{document}
begin{pspicture}[algebraic](-4,-4)(6,5.5)
psaxes{->}(0,0)(-4,-4)(5.5,5)[$x$,0][$y$,90]
psline[linestyle=dashed,linecolor=red](-0.5,-4)(-0.5,5)
psline[linestyle=dashed,linecolor=red](-4,0.5)(5,0.5)
psset{linecolor=blue,linewidth=2pt}
psplot{-4}{-7 9 div}{f}
psplot{-2 9 div}{5}{f}
end{pspicture}
end{document}


enter image description here



NOTE



Increasing plotpoints sometimes is not a wise method because it will increase the size of its output (either PDF or SVG).



More flexible solution



documentclass[pstricks,border=12pt]{standalone}
usepackage{pst-plot}
deff(#1){((#1-2)/(2*(#1)+1))}% y=f(x)
defg(#1){((2+#1)/(1-2*(#1)))}% y=g(x) in which g is the inverse of f.

pstVerb{/I2P {AlgParser cvx exec} def}% infix to postfix operator

begin{document}
begin{pspicture}[algebraic](-4,-4)(6,6)
psaxes{->}(0,0)(-4,-4)(5.5,5.5)[$x$,0][$y$,90]
psline[linestyle=dashed,linecolor=red](-0.5,-4)(-0.5,5)
psline[linestyle=dashed,linecolor=red](-4,0.5)(5,0.5)
psset{linecolor=blue,linewidth=2pt}
psplot{-4}{g(5) I2P}{f(x)}
psplot{g(-4) I2P}{5}{f(x)}
end{pspicture}
end{document}





share|improve this answer























  • Thank you bro.:))
    – chishimotoji
    Nov 17 at 22:51






  • 1




    Hey guy! In JPi's answer, the plot of function overlay x-axes and y-axes at y=6,x=4. Can you fix your code at y=5,y=-4?
    – chishimotoji
    Nov 18 at 4:53










  • Big thanks. :-))
    – chishimotoji
    Nov 18 at 5:20













up vote
7
down vote










up vote
7
down vote









A PSTricks answer for the PSTricks question.



documentclass[pstricks,border=12pt]{standalone}
usepackage{pst-plot}
deff{(x-2)/(2*x+1)}

begin{document}
begin{pspicture}[algebraic](-4,-4)(6,5.5)
psaxes{->}(0,0)(-4,-4)(5.5,5)[$x$,0][$y$,90]
psline[linestyle=dashed,linecolor=red](-0.5,-4)(-0.5,5)
psline[linestyle=dashed,linecolor=red](-4,0.5)(5,0.5)
psset{linecolor=blue,linewidth=2pt}
psplot{-4}{-7 9 div}{f}
psplot{-2 9 div}{5}{f}
end{pspicture}
end{document}


enter image description here



NOTE



Increasing plotpoints sometimes is not a wise method because it will increase the size of its output (either PDF or SVG).



More flexible solution



documentclass[pstricks,border=12pt]{standalone}
usepackage{pst-plot}
deff(#1){((#1-2)/(2*(#1)+1))}% y=f(x)
defg(#1){((2+#1)/(1-2*(#1)))}% y=g(x) in which g is the inverse of f.

pstVerb{/I2P {AlgParser cvx exec} def}% infix to postfix operator

begin{document}
begin{pspicture}[algebraic](-4,-4)(6,6)
psaxes{->}(0,0)(-4,-4)(5.5,5.5)[$x$,0][$y$,90]
psline[linestyle=dashed,linecolor=red](-0.5,-4)(-0.5,5)
psline[linestyle=dashed,linecolor=red](-4,0.5)(5,0.5)
psset{linecolor=blue,linewidth=2pt}
psplot{-4}{g(5) I2P}{f(x)}
psplot{g(-4) I2P}{5}{f(x)}
end{pspicture}
end{document}





share|improve this answer














A PSTricks answer for the PSTricks question.



documentclass[pstricks,border=12pt]{standalone}
usepackage{pst-plot}
deff{(x-2)/(2*x+1)}

begin{document}
begin{pspicture}[algebraic](-4,-4)(6,5.5)
psaxes{->}(0,0)(-4,-4)(5.5,5)[$x$,0][$y$,90]
psline[linestyle=dashed,linecolor=red](-0.5,-4)(-0.5,5)
psline[linestyle=dashed,linecolor=red](-4,0.5)(5,0.5)
psset{linecolor=blue,linewidth=2pt}
psplot{-4}{-7 9 div}{f}
psplot{-2 9 div}{5}{f}
end{pspicture}
end{document}


enter image description here



NOTE



Increasing plotpoints sometimes is not a wise method because it will increase the size of its output (either PDF or SVG).



More flexible solution



documentclass[pstricks,border=12pt]{standalone}
usepackage{pst-plot}
deff(#1){((#1-2)/(2*(#1)+1))}% y=f(x)
defg(#1){((2+#1)/(1-2*(#1)))}% y=g(x) in which g is the inverse of f.

pstVerb{/I2P {AlgParser cvx exec} def}% infix to postfix operator

begin{document}
begin{pspicture}[algebraic](-4,-4)(6,6)
psaxes{->}(0,0)(-4,-4)(5.5,5.5)[$x$,0][$y$,90]
psline[linestyle=dashed,linecolor=red](-0.5,-4)(-0.5,5)
psline[linestyle=dashed,linecolor=red](-4,0.5)(5,0.5)
psset{linecolor=blue,linewidth=2pt}
psplot{-4}{g(5) I2P}{f(x)}
psplot{g(-4) I2P}{5}{f(x)}
end{pspicture}
end{document}






share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 18 at 5:31

























answered Nov 17 at 16:11









Artificial Stupidity

4,62011035




4,62011035












  • Thank you bro.:))
    – chishimotoji
    Nov 17 at 22:51






  • 1




    Hey guy! In JPi's answer, the plot of function overlay x-axes and y-axes at y=6,x=4. Can you fix your code at y=5,y=-4?
    – chishimotoji
    Nov 18 at 4:53










  • Big thanks. :-))
    – chishimotoji
    Nov 18 at 5:20


















  • Thank you bro.:))
    – chishimotoji
    Nov 17 at 22:51






  • 1




    Hey guy! In JPi's answer, the plot of function overlay x-axes and y-axes at y=6,x=4. Can you fix your code at y=5,y=-4?
    – chishimotoji
    Nov 18 at 4:53










  • Big thanks. :-))
    – chishimotoji
    Nov 18 at 5:20
















Thank you bro.:))
– chishimotoji
Nov 17 at 22:51




Thank you bro.:))
– chishimotoji
Nov 17 at 22:51




1




1




Hey guy! In JPi's answer, the plot of function overlay x-axes and y-axes at y=6,x=4. Can you fix your code at y=5,y=-4?
– chishimotoji
Nov 18 at 4:53




Hey guy! In JPi's answer, the plot of function overlay x-axes and y-axes at y=6,x=4. Can you fix your code at y=5,y=-4?
– chishimotoji
Nov 18 at 4:53












Big thanks. :-))
– chishimotoji
Nov 18 at 5:20




Big thanks. :-))
– chishimotoji
Nov 18 at 5:20


















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.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • 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%2f460456%2fhelp-how-to-draw-the-plot-of-y-axb-cxd-and-give-an-example%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

AnyDesk - Fatal Program Failure

How to calibrate 16:9 built-in touch-screen to a 4:3 resolution?

QoS: MAC-Priority for clients behind a repeater