Drawing a function without knowing its definition
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.

I would be so happy of any help.
tikz-pgf graphics draw tikz-graphdrawing
|
show 6 more comments
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.

I would be so happy of any help.
tikz-pgf graphics draw tikz-graphdrawing
1
You can draw a set of connected curves. Withinandoutin 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 knowinandout. 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
|
show 6 more comments
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.

I would be so happy of any help.
tikz-pgf graphics draw tikz-graphdrawing
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.

I would be so happy of any help.
tikz-pgf graphics draw tikz-graphdrawing
tikz-pgf graphics draw tikz-graphdrawing
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. Withinandoutin 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 knowinandout. 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
|
show 6 more comments
1
You can draw a set of connected curves. Withinandoutin 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 knowinandout. 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
|
show 6 more comments
1 Answer
1
active
oldest
votes
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:

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}

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.
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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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:

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}

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.
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
add a comment |
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:

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}

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.
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
add a comment |
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:

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}

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.
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:

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}

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.
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
1
You can draw a set of connected curves. With
inandoutin 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
inandout. 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