Drawing a function without knowing its definition












6















I don't know TikZ in depth so I barely can play with it. The following is a transfer characteristic of an inverter gate. I have researched on the Internet to find the function's explicit definition without success.



I am trying to draw the curve, without knowing the definition. Yet there is one requirement: the slope at two points of the curve is −1.



transfer_func



I would be so happy of any help.










share|improve this question




















  • 1





    You can draw a set of connected curves. With in and out in TikZ, the slope = -1 is easy to achieve.

    – JouleV
    17 hours ago











  • Can you refer me examples of how it's used? It is foreign to me.

    – mandresybilly
    17 hours ago











  • @JouleV On this handout I found a way to draw a function by specifying discrete points and let PGF/Tikz draw the rest. Yet, I don't know in and out. Coud you please help me on this? Thanks in advance.

    – mandresybilly
    16 hours ago











  • do you have any more information about the function? this would probably help others in answering your question, i.e. finding the composite curve equation. I am far from being an expert, but I believe, without the equation, you might be better off drawing the curve in e.g. inkscape and then including it in your LaTeX document. Do you have any code to show that shows what you have tried, yet?

    – thymaro
    16 hours ago






  • 1





    oh ok, then the presenter should have the equation, I hope. For general information on how to use tikz, I recommend youtube tutorials and/or texample.net/tikz/examples

    – thymaro
    16 hours ago
















6















I don't know TikZ in depth so I barely can play with it. The following is a transfer characteristic of an inverter gate. I have researched on the Internet to find the function's explicit definition without success.



I am trying to draw the curve, without knowing the definition. Yet there is one requirement: the slope at two points of the curve is −1.



transfer_func



I would be so happy of any help.










share|improve this question




















  • 1





    You can draw a set of connected curves. With in and out in TikZ, the slope = -1 is easy to achieve.

    – JouleV
    17 hours ago











  • Can you refer me examples of how it's used? It is foreign to me.

    – mandresybilly
    17 hours ago











  • @JouleV On this handout I found a way to draw a function by specifying discrete points and let PGF/Tikz draw the rest. Yet, I don't know in and out. Coud you please help me on this? Thanks in advance.

    – mandresybilly
    16 hours ago











  • do you have any more information about the function? this would probably help others in answering your question, i.e. finding the composite curve equation. I am far from being an expert, but I believe, without the equation, you might be better off drawing the curve in e.g. inkscape and then including it in your LaTeX document. Do you have any code to show that shows what you have tried, yet?

    – thymaro
    16 hours ago






  • 1





    oh ok, then the presenter should have the equation, I hope. For general information on how to use tikz, I recommend youtube tutorials and/or texample.net/tikz/examples

    – thymaro
    16 hours ago














6












6








6


0






I don't know TikZ in depth so I barely can play with it. The following is a transfer characteristic of an inverter gate. I have researched on the Internet to find the function's explicit definition without success.



I am trying to draw the curve, without knowing the definition. Yet there is one requirement: the slope at two points of the curve is −1.



transfer_func



I would be so happy of any help.










share|improve this question
















I don't know TikZ in depth so I barely can play with it. The following is a transfer characteristic of an inverter gate. I have researched on the Internet to find the function's explicit definition without success.



I am trying to draw the curve, without knowing the definition. Yet there is one requirement: the slope at two points of the curve is −1.



transfer_func



I would be so happy of any help.







tikz-pgf graphics draw tikz-graphdrawing






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 8 hours ago









JouleV

3,8141936




3,8141936










asked 18 hours ago









mandresybillymandresybilly

14612




14612








  • 1





    You can draw a set of connected curves. With in and out in TikZ, the slope = -1 is easy to achieve.

    – JouleV
    17 hours ago











  • Can you refer me examples of how it's used? It is foreign to me.

    – mandresybilly
    17 hours ago











  • @JouleV On this handout I found a way to draw a function by specifying discrete points and let PGF/Tikz draw the rest. Yet, I don't know in and out. Coud you please help me on this? Thanks in advance.

    – mandresybilly
    16 hours ago











  • do you have any more information about the function? this would probably help others in answering your question, i.e. finding the composite curve equation. I am far from being an expert, but I believe, without the equation, you might be better off drawing the curve in e.g. inkscape and then including it in your LaTeX document. Do you have any code to show that shows what you have tried, yet?

    – thymaro
    16 hours ago






  • 1





    oh ok, then the presenter should have the equation, I hope. For general information on how to use tikz, I recommend youtube tutorials and/or texample.net/tikz/examples

    – thymaro
    16 hours ago














  • 1





    You can draw a set of connected curves. With in and out in TikZ, the slope = -1 is easy to achieve.

    – JouleV
    17 hours ago











  • Can you refer me examples of how it's used? It is foreign to me.

    – mandresybilly
    17 hours ago











  • @JouleV On this handout I found a way to draw a function by specifying discrete points and let PGF/Tikz draw the rest. Yet, I don't know in and out. Coud you please help me on this? Thanks in advance.

    – mandresybilly
    16 hours ago











  • do you have any more information about the function? this would probably help others in answering your question, i.e. finding the composite curve equation. I am far from being an expert, but I believe, without the equation, you might be better off drawing the curve in e.g. inkscape and then including it in your LaTeX document. Do you have any code to show that shows what you have tried, yet?

    – thymaro
    16 hours ago






  • 1





    oh ok, then the presenter should have the equation, I hope. For general information on how to use tikz, I recommend youtube tutorials and/or texample.net/tikz/examples

    – thymaro
    16 hours ago








1




1





You can draw a set of connected curves. With in and out in TikZ, the slope = -1 is easy to achieve.

– JouleV
17 hours ago





You can draw a set of connected curves. With in and out in TikZ, the slope = -1 is easy to achieve.

– JouleV
17 hours ago













Can you refer me examples of how it's used? It is foreign to me.

– mandresybilly
17 hours ago





Can you refer me examples of how it's used? It is foreign to me.

– mandresybilly
17 hours ago













@JouleV On this handout I found a way to draw a function by specifying discrete points and let PGF/Tikz draw the rest. Yet, I don't know in and out. Coud you please help me on this? Thanks in advance.

– mandresybilly
16 hours ago





@JouleV On this handout I found a way to draw a function by specifying discrete points and let PGF/Tikz draw the rest. Yet, I don't know in and out. Coud you please help me on this? Thanks in advance.

– mandresybilly
16 hours ago













do you have any more information about the function? this would probably help others in answering your question, i.e. finding the composite curve equation. I am far from being an expert, but I believe, without the equation, you might be better off drawing the curve in e.g. inkscape and then including it in your LaTeX document. Do you have any code to show that shows what you have tried, yet?

– thymaro
16 hours ago





do you have any more information about the function? this would probably help others in answering your question, i.e. finding the composite curve equation. I am far from being an expert, but I believe, without the equation, you might be better off drawing the curve in e.g. inkscape and then including it in your LaTeX document. Do you have any code to show that shows what you have tried, yet?

– thymaro
16 hours ago




1




1





oh ok, then the presenter should have the equation, I hope. For general information on how to use tikz, I recommend youtube tutorials and/or texample.net/tikz/examples

– thymaro
16 hours ago





oh ok, then the presenter should have the equation, I hope. For general information on how to use tikz, I recommend youtube tutorials and/or texample.net/tikz/examples

– thymaro
16 hours ago










1 Answer
1






active

oldest

votes


















13














To get the exact slope without the definition of the function, you can use to[out=...,in=...] by TikZ. The following diagram may show you all about to:



enter image description here



You want slope of the plot is −1 at some points. You can have it by to[out=135,in=-45] if you are going up, or to[out=-45,in=135] if you are going down. This can be proved by using some simple maths.



So your plot can be "encoded" to TikZ as



documentclass[tikz,margin=3mm]{standalone}
usepackage{mathptmx}
begin{document}
begin{tikzpicture}
defslope (#1,#2); {
draw(#1-0.4,#2+0.4)--(#1+0.4,#2-0.4);
draw (#1,#2) node[above right] {Slope $=-1$};
}
draw[-latex] (0,0) node[below left] {0}--(0,6) node[left] {$v_O$};
draw[-latex] (0,0)--(6,0) node[below] {$v_I$};
draw[dashed] (0,5) node[left] {$V_{OH}$}--(1.5,5)--(1.5,0) node[below] {$V_{IL}$};
draw[dashed] (0,2.5) node[left] {$V_M$}--(2.5,2.5)--(2.5,0) node[below] {$V_M$};
draw[dashed] (0,0.5) node[left] {$V_{OL}$}--(5,0.5)--(5,0) node[below] {$V_{OH}$};
draw (0.5,0) node[below] {$V_{OL}$}--(0.5,.1);
draw[dashed] (3.5,0) node[below] {$V_{IH}$}--(3.5,1);
draw[very thick,cyan] (5.5,.5)--(5,.5) to[out=180,in=-45] (3.5,1) to[out=135,in=-70] (2.5,2.5);
draw[very thick,cyan] (0,5)--(1.4,5) to[out=0,in=135] (1.6,4.9) to[out=-45,in=110] (2.5,2.5);
slope (1.5,5);
slope (3.5,1);
draw (0,0)--(4,4) node[above right] {Slope $=$ 1};
end{tikzpicture}
end{document}


enter image description here



It is not really a replicate of your figure, but I think it is close enough.



By the way, you can use many other awesome methods to draw such a plot (but I'm afraid making the slope equal to −1 is more difficult). A good summary of such methods can be found in this very nice answer.






share|improve this answer





















  • 2





    You're so great. You were faster than me. I will spend the rest of the afternoon trying to reproduce and understand the lines of your code.

    – mandresybilly
    14 hours ago











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%2f475602%2fdrawing-a-function-without-knowing-its-definition%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









13














To get the exact slope without the definition of the function, you can use to[out=...,in=...] by TikZ. The following diagram may show you all about to:



enter image description here



You want slope of the plot is −1 at some points. You can have it by to[out=135,in=-45] if you are going up, or to[out=-45,in=135] if you are going down. This can be proved by using some simple maths.



So your plot can be "encoded" to TikZ as



documentclass[tikz,margin=3mm]{standalone}
usepackage{mathptmx}
begin{document}
begin{tikzpicture}
defslope (#1,#2); {
draw(#1-0.4,#2+0.4)--(#1+0.4,#2-0.4);
draw (#1,#2) node[above right] {Slope $=-1$};
}
draw[-latex] (0,0) node[below left] {0}--(0,6) node[left] {$v_O$};
draw[-latex] (0,0)--(6,0) node[below] {$v_I$};
draw[dashed] (0,5) node[left] {$V_{OH}$}--(1.5,5)--(1.5,0) node[below] {$V_{IL}$};
draw[dashed] (0,2.5) node[left] {$V_M$}--(2.5,2.5)--(2.5,0) node[below] {$V_M$};
draw[dashed] (0,0.5) node[left] {$V_{OL}$}--(5,0.5)--(5,0) node[below] {$V_{OH}$};
draw (0.5,0) node[below] {$V_{OL}$}--(0.5,.1);
draw[dashed] (3.5,0) node[below] {$V_{IH}$}--(3.5,1);
draw[very thick,cyan] (5.5,.5)--(5,.5) to[out=180,in=-45] (3.5,1) to[out=135,in=-70] (2.5,2.5);
draw[very thick,cyan] (0,5)--(1.4,5) to[out=0,in=135] (1.6,4.9) to[out=-45,in=110] (2.5,2.5);
slope (1.5,5);
slope (3.5,1);
draw (0,0)--(4,4) node[above right] {Slope $=$ 1};
end{tikzpicture}
end{document}


enter image description here



It is not really a replicate of your figure, but I think it is close enough.



By the way, you can use many other awesome methods to draw such a plot (but I'm afraid making the slope equal to −1 is more difficult). A good summary of such methods can be found in this very nice answer.






share|improve this answer





















  • 2





    You're so great. You were faster than me. I will spend the rest of the afternoon trying to reproduce and understand the lines of your code.

    – mandresybilly
    14 hours ago
















13














To get the exact slope without the definition of the function, you can use to[out=...,in=...] by TikZ. The following diagram may show you all about to:



enter image description here



You want slope of the plot is −1 at some points. You can have it by to[out=135,in=-45] if you are going up, or to[out=-45,in=135] if you are going down. This can be proved by using some simple maths.



So your plot can be "encoded" to TikZ as



documentclass[tikz,margin=3mm]{standalone}
usepackage{mathptmx}
begin{document}
begin{tikzpicture}
defslope (#1,#2); {
draw(#1-0.4,#2+0.4)--(#1+0.4,#2-0.4);
draw (#1,#2) node[above right] {Slope $=-1$};
}
draw[-latex] (0,0) node[below left] {0}--(0,6) node[left] {$v_O$};
draw[-latex] (0,0)--(6,0) node[below] {$v_I$};
draw[dashed] (0,5) node[left] {$V_{OH}$}--(1.5,5)--(1.5,0) node[below] {$V_{IL}$};
draw[dashed] (0,2.5) node[left] {$V_M$}--(2.5,2.5)--(2.5,0) node[below] {$V_M$};
draw[dashed] (0,0.5) node[left] {$V_{OL}$}--(5,0.5)--(5,0) node[below] {$V_{OH}$};
draw (0.5,0) node[below] {$V_{OL}$}--(0.5,.1);
draw[dashed] (3.5,0) node[below] {$V_{IH}$}--(3.5,1);
draw[very thick,cyan] (5.5,.5)--(5,.5) to[out=180,in=-45] (3.5,1) to[out=135,in=-70] (2.5,2.5);
draw[very thick,cyan] (0,5)--(1.4,5) to[out=0,in=135] (1.6,4.9) to[out=-45,in=110] (2.5,2.5);
slope (1.5,5);
slope (3.5,1);
draw (0,0)--(4,4) node[above right] {Slope $=$ 1};
end{tikzpicture}
end{document}


enter image description here



It is not really a replicate of your figure, but I think it is close enough.



By the way, you can use many other awesome methods to draw such a plot (but I'm afraid making the slope equal to −1 is more difficult). A good summary of such methods can be found in this very nice answer.






share|improve this answer





















  • 2





    You're so great. You were faster than me. I will spend the rest of the afternoon trying to reproduce and understand the lines of your code.

    – mandresybilly
    14 hours ago














13












13








13







To get the exact slope without the definition of the function, you can use to[out=...,in=...] by TikZ. The following diagram may show you all about to:



enter image description here



You want slope of the plot is −1 at some points. You can have it by to[out=135,in=-45] if you are going up, or to[out=-45,in=135] if you are going down. This can be proved by using some simple maths.



So your plot can be "encoded" to TikZ as



documentclass[tikz,margin=3mm]{standalone}
usepackage{mathptmx}
begin{document}
begin{tikzpicture}
defslope (#1,#2); {
draw(#1-0.4,#2+0.4)--(#1+0.4,#2-0.4);
draw (#1,#2) node[above right] {Slope $=-1$};
}
draw[-latex] (0,0) node[below left] {0}--(0,6) node[left] {$v_O$};
draw[-latex] (0,0)--(6,0) node[below] {$v_I$};
draw[dashed] (0,5) node[left] {$V_{OH}$}--(1.5,5)--(1.5,0) node[below] {$V_{IL}$};
draw[dashed] (0,2.5) node[left] {$V_M$}--(2.5,2.5)--(2.5,0) node[below] {$V_M$};
draw[dashed] (0,0.5) node[left] {$V_{OL}$}--(5,0.5)--(5,0) node[below] {$V_{OH}$};
draw (0.5,0) node[below] {$V_{OL}$}--(0.5,.1);
draw[dashed] (3.5,0) node[below] {$V_{IH}$}--(3.5,1);
draw[very thick,cyan] (5.5,.5)--(5,.5) to[out=180,in=-45] (3.5,1) to[out=135,in=-70] (2.5,2.5);
draw[very thick,cyan] (0,5)--(1.4,5) to[out=0,in=135] (1.6,4.9) to[out=-45,in=110] (2.5,2.5);
slope (1.5,5);
slope (3.5,1);
draw (0,0)--(4,4) node[above right] {Slope $=$ 1};
end{tikzpicture}
end{document}


enter image description here



It is not really a replicate of your figure, but I think it is close enough.



By the way, you can use many other awesome methods to draw such a plot (but I'm afraid making the slope equal to −1 is more difficult). A good summary of such methods can be found in this very nice answer.






share|improve this answer















To get the exact slope without the definition of the function, you can use to[out=...,in=...] by TikZ. The following diagram may show you all about to:



enter image description here



You want slope of the plot is −1 at some points. You can have it by to[out=135,in=-45] if you are going up, or to[out=-45,in=135] if you are going down. This can be proved by using some simple maths.



So your plot can be "encoded" to TikZ as



documentclass[tikz,margin=3mm]{standalone}
usepackage{mathptmx}
begin{document}
begin{tikzpicture}
defslope (#1,#2); {
draw(#1-0.4,#2+0.4)--(#1+0.4,#2-0.4);
draw (#1,#2) node[above right] {Slope $=-1$};
}
draw[-latex] (0,0) node[below left] {0}--(0,6) node[left] {$v_O$};
draw[-latex] (0,0)--(6,0) node[below] {$v_I$};
draw[dashed] (0,5) node[left] {$V_{OH}$}--(1.5,5)--(1.5,0) node[below] {$V_{IL}$};
draw[dashed] (0,2.5) node[left] {$V_M$}--(2.5,2.5)--(2.5,0) node[below] {$V_M$};
draw[dashed] (0,0.5) node[left] {$V_{OL}$}--(5,0.5)--(5,0) node[below] {$V_{OH}$};
draw (0.5,0) node[below] {$V_{OL}$}--(0.5,.1);
draw[dashed] (3.5,0) node[below] {$V_{IH}$}--(3.5,1);
draw[very thick,cyan] (5.5,.5)--(5,.5) to[out=180,in=-45] (3.5,1) to[out=135,in=-70] (2.5,2.5);
draw[very thick,cyan] (0,5)--(1.4,5) to[out=0,in=135] (1.6,4.9) to[out=-45,in=110] (2.5,2.5);
slope (1.5,5);
slope (3.5,1);
draw (0,0)--(4,4) node[above right] {Slope $=$ 1};
end{tikzpicture}
end{document}


enter image description here



It is not really a replicate of your figure, but I think it is close enough.



By the way, you can use many other awesome methods to draw such a plot (but I'm afraid making the slope equal to −1 is more difficult). A good summary of such methods can be found in this very nice answer.







share|improve this answer














share|improve this answer



share|improve this answer








edited 8 hours ago

























answered 15 hours ago









JouleVJouleV

3,8141936




3,8141936








  • 2





    You're so great. You were faster than me. I will spend the rest of the afternoon trying to reproduce and understand the lines of your code.

    – mandresybilly
    14 hours ago














  • 2





    You're so great. You were faster than me. I will spend the rest of the afternoon trying to reproduce and understand the lines of your code.

    – mandresybilly
    14 hours ago








2




2





You're so great. You were faster than me. I will spend the rest of the afternoon trying to reproduce and understand the lines of your code.

– mandresybilly
14 hours ago





You're so great. You were faster than me. I will spend the rest of the afternoon trying to reproduce and understand the lines of your code.

– mandresybilly
14 hours ago


















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%2f475602%2fdrawing-a-function-without-knowing-its-definition%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

Callistus I

Tabula Rosettana

How to label and detect the document text images