TransWikia.com

Label each one of the different graphs generated by a parameter

Mathematica Asked by Fermath on July 13, 2021

I need help with this. I want to label each one of the graphs generated by the values of the parameter t, but I’m unable to do it because the program takes the five graphs of the summatory with a parameter as one. I’ve already generated the graphs I desired, but labeling is just impossible for me. Could you please help me? Or what could be an option for what I want?

Here is the code:

Plot[Evaluate[{100, (200/Pi) !(
*UnderoverscriptBox[([Sum]), (n = 1), (9)]((((((1 - 
*SuperscriptBox[(((-1))), (n)]))/n)) Exp[(-((
*SuperscriptBox[(n), (2)]))) t] Sin[n*x]))) /. 
    t -> {0.05, 0.35, 0.6, 1, 1.5}}, {x, 0, Pi}], 
 PlotLegend -> {"t=0", "t=0.05", "t=0.35", "t=0.6", "t=1", "t=1.5"} , 
 AxesLabel -> {"x", "u"}, 
 PlotStyle -> {{Thick, Black}, {Thick, Cyan}, {Thick, 
    Magenta}, {Thick, Yellow}, {Thick, Orange}, {Thick, Green}}]

An image of what appears:

image

2 Answers

Needs["PlotLegends`"]

Plot[Evaluate[ Join[{100}, (200/Pi) !(
*UnderoverscriptBox[([Sum]), (n = 1), (9)]((((((1 - 
*SuperscriptBox[(((-1))), (n)]))/n)) Exp[(-((
*SuperscriptBox[(n), (2)]))) t] Sin[n*x]))) /. 
       t -> {0.05, 0.35, 0.6, 1, 1.5}]], {x, 0, Pi}, 
  PlotLegend -> {"t=0", "t=0.05", "t=0.35", "t=0.6", "t=1", "t=1.5"} , 
  AxesLabel -> {"x", "u"}, 
  PlotStyle -> {{Thick, Black}, {Thick, Cyan}, {Thick, 
        Magenta}, {Thick, Yellow}, {Thick, Orange}, {Thick, Green}}]

enter image description here

Correct answer by kglr on July 13, 2021

Use Epilog->{Text[ commands ]}. As below:

Plot[Evaluate[{100, (200/Pi) !( *UnderoverscriptBox[([Sum]), (n = 1), (9)]((((((1 - *SuperscriptBox[(((-1))), (n)]))/n)) Exp[(-(( *SuperscriptBox[(n), (2)]))) t] Sin[n*x]))) /. t -> {0.05, 0.35, 0.6, 1, 1.5}}, {x, 0, Pi}], AxesLabel -> {"x", "u"}, PlotStyle -> {{Thick, Black}, {Thick, Cyan}, {Thick, Magenta}, {Thick, Yellow}, {Thick, Orange}, {Thick, Green}}, Epilog -> {Text["0.05", {2.8, 85}], Text["0.35", {2.5, 70}]}]

enter image description here

Answered by Nicholas G on July 13, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP