Graph of Chebyshev's first polynomials, almost like the wikipedia graph
$begingroup$
I want to graph the first polynomials of Chebyshev almost like the graph of wikipedia
https://en.wikipedia.org/wiki/File:Chebyshev_Polynomials_of_the_First_Kind.svg
I have tried it this way
Plot[Evaluate[Table[ChebyshevT[n - 1, x], {n, 5}]], {x, 0, 1},
PlotStyle -> {Blue, Orange, Green, Magenta, Purple},
PlotTheme -> "Scientific"]
LineLegend[{Blue, Orange, Green, Magenta,
Purple},{"T0","T1","T2","T3","T4"}]
I can't put the legends on top of the graphic like in wikipedia or at least put them in a single line.
I have tried with the Show command but I have not succeeded. I appreciate any help.
plotting graphics functions legending
$endgroup$
add a comment |
$begingroup$
I want to graph the first polynomials of Chebyshev almost like the graph of wikipedia
https://en.wikipedia.org/wiki/File:Chebyshev_Polynomials_of_the_First_Kind.svg
I have tried it this way
Plot[Evaluate[Table[ChebyshevT[n - 1, x], {n, 5}]], {x, 0, 1},
PlotStyle -> {Blue, Orange, Green, Magenta, Purple},
PlotTheme -> "Scientific"]
LineLegend[{Blue, Orange, Green, Magenta,
Purple},{"T0","T1","T2","T3","T4"}]
I can't put the legends on top of the graphic like in wikipedia or at least put them in a single line.
I have tried with the Show command but I have not succeeded. I appreciate any help.
plotting graphics functions legending
$endgroup$
1
$begingroup$
Have you seen that the source Mathematica code is actually on the wikipedia image page that you linked to?
$endgroup$
– Carl Lange
Feb 5 at 9:21
add a comment |
$begingroup$
I want to graph the first polynomials of Chebyshev almost like the graph of wikipedia
https://en.wikipedia.org/wiki/File:Chebyshev_Polynomials_of_the_First_Kind.svg
I have tried it this way
Plot[Evaluate[Table[ChebyshevT[n - 1, x], {n, 5}]], {x, 0, 1},
PlotStyle -> {Blue, Orange, Green, Magenta, Purple},
PlotTheme -> "Scientific"]
LineLegend[{Blue, Orange, Green, Magenta,
Purple},{"T0","T1","T2","T3","T4"}]
I can't put the legends on top of the graphic like in wikipedia or at least put them in a single line.
I have tried with the Show command but I have not succeeded. I appreciate any help.
plotting graphics functions legending
$endgroup$
I want to graph the first polynomials of Chebyshev almost like the graph of wikipedia
https://en.wikipedia.org/wiki/File:Chebyshev_Polynomials_of_the_First_Kind.svg
I have tried it this way
Plot[Evaluate[Table[ChebyshevT[n - 1, x], {n, 5}]], {x, 0, 1},
PlotStyle -> {Blue, Orange, Green, Magenta, Purple},
PlotTheme -> "Scientific"]
LineLegend[{Blue, Orange, Green, Magenta,
Purple},{"T0","T1","T2","T3","T4"}]
I can't put the legends on top of the graphic like in wikipedia or at least put them in a single line.
I have tried with the Show command but I have not succeeded. I appreciate any help.
plotting graphics functions legending
plotting graphics functions legending
edited Feb 5 at 2:10
Michael E2
148k12198477
148k12198477
asked Feb 5 at 2:08
Jacob SchwartzJacob Schwartz
475
475
1
$begingroup$
Have you seen that the source Mathematica code is actually on the wikipedia image page that you linked to?
$endgroup$
– Carl Lange
Feb 5 at 9:21
add a comment |
1
$begingroup$
Have you seen that the source Mathematica code is actually on the wikipedia image page that you linked to?
$endgroup$
– Carl Lange
Feb 5 at 9:21
1
1
$begingroup$
Have you seen that the source Mathematica code is actually on the wikipedia image page that you linked to?
$endgroup$
– Carl Lange
Feb 5 at 9:21
$begingroup$
Have you seen that the source Mathematica code is actually on the wikipedia image page that you linked to?
$endgroup$
– Carl Lange
Feb 5 at 9:21
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
Update: A more streamlined version
Plot[Evaluate@ChebyshevT[Range[0, 4], x], {x, 0, 1},
PlotStyle -> {Blue, Orange, Green, Magenta, Purple},
Frame -> True, Axes -> False,
GridLines -> Automatic, GridLinesStyle -> Directive[Gray, Dashed],
PlotLegends -> Placed[LineLegend[{"T0", "T1", "T2", "T3", "T4"}], Top]]
Original answer:
Plot[Evaluate[Table[ChebyshevT[n - 1, x], {n, 5}]], {x, 0, 1},
PlotStyle -> {Blue, Orange, Green, Magenta, Purple},
PlotTheme -> "Scientific",
PlotLegends -> Placed[LineLegend[{Blue, Orange, Green, Magenta, Purple}, {"T0", "T1",
"T2", "T3", "T4"}], Top]]
Also
Legended[Plot[Evaluate[Table[ChebyshevT[n - 1, x], {n, 5}]], {x, 0, 1},
PlotStyle -> {Blue, Orange, Green, Magenta, Purple},
PlotTheme -> "Scientific"], Placed[
LineLegend[{Blue, Orange, Green, Magenta, Purple}, {"T0", "T1",
"T2", "T3", "T4"}, LegendLayout -> {"Row", 1}], Top]]
same picture
$endgroup$
2
$begingroup$
With a few bells:Plot[Evaluate@ Table[Tooltip[ChebyshevT[n, x]], {n, 0, 4}], {x, -1, 1}, PlotTheme -> "Scientific", FrameLabel -> (Style[#, 12, Bold] & /@ {x, ChebyshevT[n, x]}), PlotLegends -> Placed[Table[Subscript[T, n], {n, 0, 5}], Top]]
$endgroup$
– Bob Hanlon
Feb 5 at 3:57
add a comment |
$begingroup$
Plot[
Evaluate[Table[ChebyshevT[n - 1, x], {n, 5}]], {x, 0, 1},
PlotStyle -> {Blue, Orange, Green, Magenta, Purple},
PlotTheme -> "Scientific",
PlotLegends -> Placed[
LineLegend[{Blue, Orange, Green, Magenta, Purple}, {"T0", "T1", "T2", "T3", "T4"}],
Top
]
]

Also
Legended[
Plot[Evaluate[Table[ChebyshevT[n - 1, x], {n, 5}]], {x, 0, 1},
PlotStyle -> {Blue, Orange, Green, Magenta, Purple},
PlotTheme -> "Scientific"
],
Placed[
LineLegend[{Blue, Orange, Green, Magenta, Purple}, {"T0", "T1", "T2", "T3", "T4"},
LegendLayout -> {"Row", 1}], Top
]
]
same picture
$endgroup$
1
$begingroup$
welcome to mma.se. This is copy/pasted verbatim from the accepted answer above.
$endgroup$
– kglr
Feb 5 at 9:26
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "387"
};
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%2fmathematica.stackexchange.com%2fquestions%2f190897%2fgraph-of-chebyshevs-first-polynomials-almost-like-the-wikipedia-graph%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Update: A more streamlined version
Plot[Evaluate@ChebyshevT[Range[0, 4], x], {x, 0, 1},
PlotStyle -> {Blue, Orange, Green, Magenta, Purple},
Frame -> True, Axes -> False,
GridLines -> Automatic, GridLinesStyle -> Directive[Gray, Dashed],
PlotLegends -> Placed[LineLegend[{"T0", "T1", "T2", "T3", "T4"}], Top]]
Original answer:
Plot[Evaluate[Table[ChebyshevT[n - 1, x], {n, 5}]], {x, 0, 1},
PlotStyle -> {Blue, Orange, Green, Magenta, Purple},
PlotTheme -> "Scientific",
PlotLegends -> Placed[LineLegend[{Blue, Orange, Green, Magenta, Purple}, {"T0", "T1",
"T2", "T3", "T4"}], Top]]
Also
Legended[Plot[Evaluate[Table[ChebyshevT[n - 1, x], {n, 5}]], {x, 0, 1},
PlotStyle -> {Blue, Orange, Green, Magenta, Purple},
PlotTheme -> "Scientific"], Placed[
LineLegend[{Blue, Orange, Green, Magenta, Purple}, {"T0", "T1",
"T2", "T3", "T4"}, LegendLayout -> {"Row", 1}], Top]]
same picture
$endgroup$
2
$begingroup$
With a few bells:Plot[Evaluate@ Table[Tooltip[ChebyshevT[n, x]], {n, 0, 4}], {x, -1, 1}, PlotTheme -> "Scientific", FrameLabel -> (Style[#, 12, Bold] & /@ {x, ChebyshevT[n, x]}), PlotLegends -> Placed[Table[Subscript[T, n], {n, 0, 5}], Top]]
$endgroup$
– Bob Hanlon
Feb 5 at 3:57
add a comment |
$begingroup$
Update: A more streamlined version
Plot[Evaluate@ChebyshevT[Range[0, 4], x], {x, 0, 1},
PlotStyle -> {Blue, Orange, Green, Magenta, Purple},
Frame -> True, Axes -> False,
GridLines -> Automatic, GridLinesStyle -> Directive[Gray, Dashed],
PlotLegends -> Placed[LineLegend[{"T0", "T1", "T2", "T3", "T4"}], Top]]
Original answer:
Plot[Evaluate[Table[ChebyshevT[n - 1, x], {n, 5}]], {x, 0, 1},
PlotStyle -> {Blue, Orange, Green, Magenta, Purple},
PlotTheme -> "Scientific",
PlotLegends -> Placed[LineLegend[{Blue, Orange, Green, Magenta, Purple}, {"T0", "T1",
"T2", "T3", "T4"}], Top]]
Also
Legended[Plot[Evaluate[Table[ChebyshevT[n - 1, x], {n, 5}]], {x, 0, 1},
PlotStyle -> {Blue, Orange, Green, Magenta, Purple},
PlotTheme -> "Scientific"], Placed[
LineLegend[{Blue, Orange, Green, Magenta, Purple}, {"T0", "T1",
"T2", "T3", "T4"}, LegendLayout -> {"Row", 1}], Top]]
same picture
$endgroup$
2
$begingroup$
With a few bells:Plot[Evaluate@ Table[Tooltip[ChebyshevT[n, x]], {n, 0, 4}], {x, -1, 1}, PlotTheme -> "Scientific", FrameLabel -> (Style[#, 12, Bold] & /@ {x, ChebyshevT[n, x]}), PlotLegends -> Placed[Table[Subscript[T, n], {n, 0, 5}], Top]]
$endgroup$
– Bob Hanlon
Feb 5 at 3:57
add a comment |
$begingroup$
Update: A more streamlined version
Plot[Evaluate@ChebyshevT[Range[0, 4], x], {x, 0, 1},
PlotStyle -> {Blue, Orange, Green, Magenta, Purple},
Frame -> True, Axes -> False,
GridLines -> Automatic, GridLinesStyle -> Directive[Gray, Dashed],
PlotLegends -> Placed[LineLegend[{"T0", "T1", "T2", "T3", "T4"}], Top]]
Original answer:
Plot[Evaluate[Table[ChebyshevT[n - 1, x], {n, 5}]], {x, 0, 1},
PlotStyle -> {Blue, Orange, Green, Magenta, Purple},
PlotTheme -> "Scientific",
PlotLegends -> Placed[LineLegend[{Blue, Orange, Green, Magenta, Purple}, {"T0", "T1",
"T2", "T3", "T4"}], Top]]
Also
Legended[Plot[Evaluate[Table[ChebyshevT[n - 1, x], {n, 5}]], {x, 0, 1},
PlotStyle -> {Blue, Orange, Green, Magenta, Purple},
PlotTheme -> "Scientific"], Placed[
LineLegend[{Blue, Orange, Green, Magenta, Purple}, {"T0", "T1",
"T2", "T3", "T4"}, LegendLayout -> {"Row", 1}], Top]]
same picture
$endgroup$
Update: A more streamlined version
Plot[Evaluate@ChebyshevT[Range[0, 4], x], {x, 0, 1},
PlotStyle -> {Blue, Orange, Green, Magenta, Purple},
Frame -> True, Axes -> False,
GridLines -> Automatic, GridLinesStyle -> Directive[Gray, Dashed],
PlotLegends -> Placed[LineLegend[{"T0", "T1", "T2", "T3", "T4"}], Top]]
Original answer:
Plot[Evaluate[Table[ChebyshevT[n - 1, x], {n, 5}]], {x, 0, 1},
PlotStyle -> {Blue, Orange, Green, Magenta, Purple},
PlotTheme -> "Scientific",
PlotLegends -> Placed[LineLegend[{Blue, Orange, Green, Magenta, Purple}, {"T0", "T1",
"T2", "T3", "T4"}], Top]]
Also
Legended[Plot[Evaluate[Table[ChebyshevT[n - 1, x], {n, 5}]], {x, 0, 1},
PlotStyle -> {Blue, Orange, Green, Magenta, Purple},
PlotTheme -> "Scientific"], Placed[
LineLegend[{Blue, Orange, Green, Magenta, Purple}, {"T0", "T1",
"T2", "T3", "T4"}, LegendLayout -> {"Row", 1}], Top]]
same picture
edited Feb 5 at 9:35
answered Feb 5 at 2:15
kglrkglr
186k10203422
186k10203422
2
$begingroup$
With a few bells:Plot[Evaluate@ Table[Tooltip[ChebyshevT[n, x]], {n, 0, 4}], {x, -1, 1}, PlotTheme -> "Scientific", FrameLabel -> (Style[#, 12, Bold] & /@ {x, ChebyshevT[n, x]}), PlotLegends -> Placed[Table[Subscript[T, n], {n, 0, 5}], Top]]
$endgroup$
– Bob Hanlon
Feb 5 at 3:57
add a comment |
2
$begingroup$
With a few bells:Plot[Evaluate@ Table[Tooltip[ChebyshevT[n, x]], {n, 0, 4}], {x, -1, 1}, PlotTheme -> "Scientific", FrameLabel -> (Style[#, 12, Bold] & /@ {x, ChebyshevT[n, x]}), PlotLegends -> Placed[Table[Subscript[T, n], {n, 0, 5}], Top]]
$endgroup$
– Bob Hanlon
Feb 5 at 3:57
2
2
$begingroup$
With a few bells:
Plot[Evaluate@ Table[Tooltip[ChebyshevT[n, x]], {n, 0, 4}], {x, -1, 1}, PlotTheme -> "Scientific", FrameLabel -> (Style[#, 12, Bold] & /@ {x, ChebyshevT[n, x]}), PlotLegends -> Placed[Table[Subscript[T, n], {n, 0, 5}], Top]]
$endgroup$
– Bob Hanlon
Feb 5 at 3:57
$begingroup$
With a few bells:
Plot[Evaluate@ Table[Tooltip[ChebyshevT[n, x]], {n, 0, 4}], {x, -1, 1}, PlotTheme -> "Scientific", FrameLabel -> (Style[#, 12, Bold] & /@ {x, ChebyshevT[n, x]}), PlotLegends -> Placed[Table[Subscript[T, n], {n, 0, 5}], Top]]
$endgroup$
– Bob Hanlon
Feb 5 at 3:57
add a comment |
$begingroup$
Plot[
Evaluate[Table[ChebyshevT[n - 1, x], {n, 5}]], {x, 0, 1},
PlotStyle -> {Blue, Orange, Green, Magenta, Purple},
PlotTheme -> "Scientific",
PlotLegends -> Placed[
LineLegend[{Blue, Orange, Green, Magenta, Purple}, {"T0", "T1", "T2", "T3", "T4"}],
Top
]
]

Also
Legended[
Plot[Evaluate[Table[ChebyshevT[n - 1, x], {n, 5}]], {x, 0, 1},
PlotStyle -> {Blue, Orange, Green, Magenta, Purple},
PlotTheme -> "Scientific"
],
Placed[
LineLegend[{Blue, Orange, Green, Magenta, Purple}, {"T0", "T1", "T2", "T3", "T4"},
LegendLayout -> {"Row", 1}], Top
]
]
same picture
$endgroup$
1
$begingroup$
welcome to mma.se. This is copy/pasted verbatim from the accepted answer above.
$endgroup$
– kglr
Feb 5 at 9:26
add a comment |
$begingroup$
Plot[
Evaluate[Table[ChebyshevT[n - 1, x], {n, 5}]], {x, 0, 1},
PlotStyle -> {Blue, Orange, Green, Magenta, Purple},
PlotTheme -> "Scientific",
PlotLegends -> Placed[
LineLegend[{Blue, Orange, Green, Magenta, Purple}, {"T0", "T1", "T2", "T3", "T4"}],
Top
]
]

Also
Legended[
Plot[Evaluate[Table[ChebyshevT[n - 1, x], {n, 5}]], {x, 0, 1},
PlotStyle -> {Blue, Orange, Green, Magenta, Purple},
PlotTheme -> "Scientific"
],
Placed[
LineLegend[{Blue, Orange, Green, Magenta, Purple}, {"T0", "T1", "T2", "T3", "T4"},
LegendLayout -> {"Row", 1}], Top
]
]
same picture
$endgroup$
1
$begingroup$
welcome to mma.se. This is copy/pasted verbatim from the accepted answer above.
$endgroup$
– kglr
Feb 5 at 9:26
add a comment |
$begingroup$
Plot[
Evaluate[Table[ChebyshevT[n - 1, x], {n, 5}]], {x, 0, 1},
PlotStyle -> {Blue, Orange, Green, Magenta, Purple},
PlotTheme -> "Scientific",
PlotLegends -> Placed[
LineLegend[{Blue, Orange, Green, Magenta, Purple}, {"T0", "T1", "T2", "T3", "T4"}],
Top
]
]

Also
Legended[
Plot[Evaluate[Table[ChebyshevT[n - 1, x], {n, 5}]], {x, 0, 1},
PlotStyle -> {Blue, Orange, Green, Magenta, Purple},
PlotTheme -> "Scientific"
],
Placed[
LineLegend[{Blue, Orange, Green, Magenta, Purple}, {"T0", "T1", "T2", "T3", "T4"},
LegendLayout -> {"Row", 1}], Top
]
]
same picture
$endgroup$
Plot[
Evaluate[Table[ChebyshevT[n - 1, x], {n, 5}]], {x, 0, 1},
PlotStyle -> {Blue, Orange, Green, Magenta, Purple},
PlotTheme -> "Scientific",
PlotLegends -> Placed[
LineLegend[{Blue, Orange, Green, Magenta, Purple}, {"T0", "T1", "T2", "T3", "T4"}],
Top
]
]

Also
Legended[
Plot[Evaluate[Table[ChebyshevT[n - 1, x], {n, 5}]], {x, 0, 1},
PlotStyle -> {Blue, Orange, Green, Magenta, Purple},
PlotTheme -> "Scientific"
],
Placed[
LineLegend[{Blue, Orange, Green, Magenta, Purple}, {"T0", "T1", "T2", "T3", "T4"},
LegendLayout -> {"Row", 1}], Top
]
]
same picture
edited Feb 5 at 9:20
Henrik Schumacher
55.3k576154
55.3k576154
answered Feb 5 at 8:24
user62762user62762
5
5
1
$begingroup$
welcome to mma.se. This is copy/pasted verbatim from the accepted answer above.
$endgroup$
– kglr
Feb 5 at 9:26
add a comment |
1
$begingroup$
welcome to mma.se. This is copy/pasted verbatim from the accepted answer above.
$endgroup$
– kglr
Feb 5 at 9:26
1
1
$begingroup$
welcome to mma.se. This is copy/pasted verbatim from the accepted answer above.
$endgroup$
– kglr
Feb 5 at 9:26
$begingroup$
welcome to mma.se. This is copy/pasted verbatim from the accepted answer above.
$endgroup$
– kglr
Feb 5 at 9:26
add a comment |
Thanks for contributing an answer to Mathematica 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.
Use MathJax to format equations. MathJax reference.
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%2fmathematica.stackexchange.com%2fquestions%2f190897%2fgraph-of-chebyshevs-first-polynomials-almost-like-the-wikipedia-graph%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
$begingroup$
Have you seen that the source Mathematica code is actually on the wikipedia image page that you linked to?
$endgroup$
– Carl Lange
Feb 5 at 9:21