Graph of Chebyshev's first polynomials, almost like the wikipedia graph












4












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










share|improve this question











$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
















4












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










share|improve this question











$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














4












4








4





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










share|improve this question











$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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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














  • 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










2 Answers
2






active

oldest

votes


















5












$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]]


enter image description here



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]]


enter image description here



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







share|improve this answer











$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



















-2












$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






share|improve this answer











$endgroup$









  • 1




    $begingroup$
    welcome to mma.se. This is copy/pasted verbatim from the accepted answer above.
    $endgroup$
    – kglr
    Feb 5 at 9:26













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
});


}
});














draft saved

draft discarded


















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









5












$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]]


enter image description here



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]]


enter image description here



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







share|improve this answer











$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
















5












$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]]


enter image description here



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]]


enter image description here



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







share|improve this answer











$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














5












5








5





$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]]


enter image description here



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]]


enter image description here



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







share|improve this answer











$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]]


enter image description here



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]]


enter image description here



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








share|improve this answer














share|improve this answer



share|improve this answer








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














  • 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











-2












$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






share|improve this answer











$endgroup$









  • 1




    $begingroup$
    welcome to mma.se. This is copy/pasted verbatim from the accepted answer above.
    $endgroup$
    – kglr
    Feb 5 at 9:26


















-2












$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






share|improve this answer











$endgroup$









  • 1




    $begingroup$
    welcome to mma.se. This is copy/pasted verbatim from the accepted answer above.
    $endgroup$
    – kglr
    Feb 5 at 9:26
















-2












-2








-2





$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






share|improve this answer











$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







share|improve this answer














share|improve this answer



share|improve this answer








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
















  • 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




















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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 do I know what Microsoft account the skydrive app is syncing to?

When does type information flow backwards in C++?

Grease: Live!