Use matplotlib to plot the functions $y = x^3 + 3x^2 - x + 0.3 $ and $y = sin x$ [closed] The 2019 Stack Overflow Developer Survey Results Are InHow to plot logarithm functions on Google search graphing toolShape of graph and plotHow to plot bivariate function involving modulus and floor functions?How to make a good “infinity plot”?Help finding turning points to plot quartic and cubic functionsWhat free tools can I use to plot complex functions on the complex plane?How to plot these functions? (Utility functions)Verify the Riemann Hypothesis for first 1000 zeros.Plot Products of Airy FunctionsPlot 2 or more parametric functions MAXIMA

Can a rogue use sneak attack with weapons that have the thrown property even if they are not thrown?

Why isn't airport relocation done gradually?

Ubuntu Server install with full GUI

Looking for Correct Greek Translation for Heraclitus

Is "plugging out" electronic devices an American expression?

How to support a colleague who finds meetings extremely tiring?

Why do we hear so much about the Trump administration deciding to impose and then remove tariffs?

Multiply Two Integer Polynomials

How technical should a Scrum Master be to effectively remove impediments?

Why was M87 targetted for the Event Horizon Telescope instead of Sagittarius A*?

Who coined the term "madman theory"?

Is a "Democratic" Oligarchy-Style System Possible?

How to deal with fear of taking dependencies

Can one be advised by a professor who is very far away?

How to answer pointed "are you quitting" questioning when I don't want them to suspect

If I score a critical hit on an 18 or higher, what are my chances of getting a critical hit if I roll 3d20?

What do the Banks children have against barley water?

Can a flute soloist sit?

Am I thawing this London Broil safely?

Is there a symbol for a right arrow with a square in the middle?

Protecting Dualbooting Windows from dangerous code (like rm -rf)

Worn-tile Scrabble

A poker game description that does not feel gimmicky

FPGA - DIY Programming



Use matplotlib to plot the functions $y = x^3 + 3x^2 - x + 0.3 $ and $y = sin x$ [closed]



The 2019 Stack Overflow Developer Survey Results Are InHow to plot logarithm functions on Google search graphing toolShape of graph and plotHow to plot bivariate function involving modulus and floor functions?How to make a good “infinity plot”?Help finding turning points to plot quartic and cubic functionsWhat free tools can I use to plot complex functions on the complex plane?How to plot these functions? (Utility functions)Verify the Riemann Hypothesis for first 1000 zeros.Plot Products of Airy FunctionsPlot 2 or more parametric functions MAXIMA










0












$begingroup$


I'm new to Python coding and wondered if someone could give me the coding to plot these two graphs on the same program.



This is what I have so far, exactly as typed on Python, however I know that parts are incorrect.



from matplotlib import pyplot as plt

x = [float(i)/100 for i in range(0,101)]
y = [sin(x)]

plt.plot(x,y)









share|cite|improve this question











$endgroup$



closed as unclear what you're asking by Somos, Javi, Leucippus, YiFan, Alex Provost Mar 24 at 14:15


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






















    0












    $begingroup$


    I'm new to Python coding and wondered if someone could give me the coding to plot these two graphs on the same program.



    This is what I have so far, exactly as typed on Python, however I know that parts are incorrect.



    from matplotlib import pyplot as plt

    x = [float(i)/100 for i in range(0,101)]
    y = [sin(x)]

    plt.plot(x,y)









    share|cite|improve this question











    $endgroup$



    closed as unclear what you're asking by Somos, Javi, Leucippus, YiFan, Alex Provost Mar 24 at 14:15


    Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.




















      0












      0








      0


      0



      $begingroup$


      I'm new to Python coding and wondered if someone could give me the coding to plot these two graphs on the same program.



      This is what I have so far, exactly as typed on Python, however I know that parts are incorrect.



      from matplotlib import pyplot as plt

      x = [float(i)/100 for i in range(0,101)]
      y = [sin(x)]

      plt.plot(x,y)









      share|cite|improve this question











      $endgroup$




      I'm new to Python coding and wondered if someone could give me the coding to plot these two graphs on the same program.



      This is what I have so far, exactly as typed on Python, however I know that parts are incorrect.



      from matplotlib import pyplot as plt

      x = [float(i)/100 for i in range(0,101)]
      y = [sin(x)]

      plt.plot(x,y)






      graphing-functions math-software python






      share|cite|improve this question















      share|cite|improve this question













      share|cite|improve this question




      share|cite|improve this question








      edited Mar 24 at 3:05









      Lee David Chung Lin

      4,47841242




      4,47841242










      asked Mar 23 at 18:55









      BrookeBrooke

      63




      63




      closed as unclear what you're asking by Somos, Javi, Leucippus, YiFan, Alex Provost Mar 24 at 14:15


      Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.









      closed as unclear what you're asking by Somos, Javi, Leucippus, YiFan, Alex Provost Mar 24 at 14:15


      Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






















          1 Answer
          1






          active

          oldest

          votes


















          1












          $begingroup$

          First, you need a larger range for $x$ to see a nice sinusoid, say from $0$ to $2pi$.
          Second, specify $y$ as a list comprehension, too:



          from matplotlib import pyplot as plt
          import math

          x = [float(i)/100 for i in range(0, 628)]
          y = [math.sin(z) for z in x]

          plt.plot(x,y)


          enter image description here




          If you want to plot both graphs one over the other (what isn't generally a good idea because those 2 function are so different, that in the default settings the sine function will appear as to coincide with the x-axis), the code may be as follows (I extended the range for $x$, and set limits for $y$-axes):



          from matplotlib import pyplot as plt
          import math

          BOUND = 1000

          x = [float(i)/100 for i in range(-BOUND, +BOUND)]
          y = [math.sin(z) for z in x]
          w = [z**3 + 3*z**2 - z + 0.3 for z in x]


          plt.ylim(-7,+7)
          plt.plot(x, y)
          plt.plot(x, w)


          enter image description here






          share|cite|improve this answer











          $endgroup$












          • $begingroup$
            Ah I see, so how would I add the second y graph onto this?
            $endgroup$
            – Brooke
            Mar 23 at 19:16










          • $begingroup$
            Do you mean to overlay this graph, or to create other one (in the other window)?
            $endgroup$
            – MarianD
            Mar 23 at 19:30










          • $begingroup$
            They will both be on the same axis so it will over lay it and show both
            $endgroup$
            – Brooke
            Mar 23 at 19:38










          • $begingroup$
            It's not a good idea, because there is such difference between the 2 functions that the sine function will appear to coincident with x axis. See: $sin(5pi /2) = 1$, while $x^3 + 3x^2 - x + 0.3$ will be for the same $x =5pi /2$ approximately $662$.
            $endgroup$
            – MarianD
            Mar 23 at 20:01











          • $begingroup$
            That what the assignment question is asking me to do as I am to find the real solutions of the graphs.
            $endgroup$
            – Brooke
            Mar 23 at 20:10

















          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1












          $begingroup$

          First, you need a larger range for $x$ to see a nice sinusoid, say from $0$ to $2pi$.
          Second, specify $y$ as a list comprehension, too:



          from matplotlib import pyplot as plt
          import math

          x = [float(i)/100 for i in range(0, 628)]
          y = [math.sin(z) for z in x]

          plt.plot(x,y)


          enter image description here




          If you want to plot both graphs one over the other (what isn't generally a good idea because those 2 function are so different, that in the default settings the sine function will appear as to coincide with the x-axis), the code may be as follows (I extended the range for $x$, and set limits for $y$-axes):



          from matplotlib import pyplot as plt
          import math

          BOUND = 1000

          x = [float(i)/100 for i in range(-BOUND, +BOUND)]
          y = [math.sin(z) for z in x]
          w = [z**3 + 3*z**2 - z + 0.3 for z in x]


          plt.ylim(-7,+7)
          plt.plot(x, y)
          plt.plot(x, w)


          enter image description here






          share|cite|improve this answer











          $endgroup$












          • $begingroup$
            Ah I see, so how would I add the second y graph onto this?
            $endgroup$
            – Brooke
            Mar 23 at 19:16










          • $begingroup$
            Do you mean to overlay this graph, or to create other one (in the other window)?
            $endgroup$
            – MarianD
            Mar 23 at 19:30










          • $begingroup$
            They will both be on the same axis so it will over lay it and show both
            $endgroup$
            – Brooke
            Mar 23 at 19:38










          • $begingroup$
            It's not a good idea, because there is such difference between the 2 functions that the sine function will appear to coincident with x axis. See: $sin(5pi /2) = 1$, while $x^3 + 3x^2 - x + 0.3$ will be for the same $x =5pi /2$ approximately $662$.
            $endgroup$
            – MarianD
            Mar 23 at 20:01











          • $begingroup$
            That what the assignment question is asking me to do as I am to find the real solutions of the graphs.
            $endgroup$
            – Brooke
            Mar 23 at 20:10















          1












          $begingroup$

          First, you need a larger range for $x$ to see a nice sinusoid, say from $0$ to $2pi$.
          Second, specify $y$ as a list comprehension, too:



          from matplotlib import pyplot as plt
          import math

          x = [float(i)/100 for i in range(0, 628)]
          y = [math.sin(z) for z in x]

          plt.plot(x,y)


          enter image description here




          If you want to plot both graphs one over the other (what isn't generally a good idea because those 2 function are so different, that in the default settings the sine function will appear as to coincide with the x-axis), the code may be as follows (I extended the range for $x$, and set limits for $y$-axes):



          from matplotlib import pyplot as plt
          import math

          BOUND = 1000

          x = [float(i)/100 for i in range(-BOUND, +BOUND)]
          y = [math.sin(z) for z in x]
          w = [z**3 + 3*z**2 - z + 0.3 for z in x]


          plt.ylim(-7,+7)
          plt.plot(x, y)
          plt.plot(x, w)


          enter image description here






          share|cite|improve this answer











          $endgroup$












          • $begingroup$
            Ah I see, so how would I add the second y graph onto this?
            $endgroup$
            – Brooke
            Mar 23 at 19:16










          • $begingroup$
            Do you mean to overlay this graph, or to create other one (in the other window)?
            $endgroup$
            – MarianD
            Mar 23 at 19:30










          • $begingroup$
            They will both be on the same axis so it will over lay it and show both
            $endgroup$
            – Brooke
            Mar 23 at 19:38










          • $begingroup$
            It's not a good idea, because there is such difference between the 2 functions that the sine function will appear to coincident with x axis. See: $sin(5pi /2) = 1$, while $x^3 + 3x^2 - x + 0.3$ will be for the same $x =5pi /2$ approximately $662$.
            $endgroup$
            – MarianD
            Mar 23 at 20:01











          • $begingroup$
            That what the assignment question is asking me to do as I am to find the real solutions of the graphs.
            $endgroup$
            – Brooke
            Mar 23 at 20:10













          1












          1








          1





          $begingroup$

          First, you need a larger range for $x$ to see a nice sinusoid, say from $0$ to $2pi$.
          Second, specify $y$ as a list comprehension, too:



          from matplotlib import pyplot as plt
          import math

          x = [float(i)/100 for i in range(0, 628)]
          y = [math.sin(z) for z in x]

          plt.plot(x,y)


          enter image description here




          If you want to plot both graphs one over the other (what isn't generally a good idea because those 2 function are so different, that in the default settings the sine function will appear as to coincide with the x-axis), the code may be as follows (I extended the range for $x$, and set limits for $y$-axes):



          from matplotlib import pyplot as plt
          import math

          BOUND = 1000

          x = [float(i)/100 for i in range(-BOUND, +BOUND)]
          y = [math.sin(z) for z in x]
          w = [z**3 + 3*z**2 - z + 0.3 for z in x]


          plt.ylim(-7,+7)
          plt.plot(x, y)
          plt.plot(x, w)


          enter image description here






          share|cite|improve this answer











          $endgroup$



          First, you need a larger range for $x$ to see a nice sinusoid, say from $0$ to $2pi$.
          Second, specify $y$ as a list comprehension, too:



          from matplotlib import pyplot as plt
          import math

          x = [float(i)/100 for i in range(0, 628)]
          y = [math.sin(z) for z in x]

          plt.plot(x,y)


          enter image description here




          If you want to plot both graphs one over the other (what isn't generally a good idea because those 2 function are so different, that in the default settings the sine function will appear as to coincide with the x-axis), the code may be as follows (I extended the range for $x$, and set limits for $y$-axes):



          from matplotlib import pyplot as plt
          import math

          BOUND = 1000

          x = [float(i)/100 for i in range(-BOUND, +BOUND)]
          y = [math.sin(z) for z in x]
          w = [z**3 + 3*z**2 - z + 0.3 for z in x]


          plt.ylim(-7,+7)
          plt.plot(x, y)
          plt.plot(x, w)


          enter image description here







          share|cite|improve this answer














          share|cite|improve this answer



          share|cite|improve this answer








          edited Mar 23 at 21:22

























          answered Mar 23 at 19:15









          MarianDMarianD

          2,2611618




          2,2611618











          • $begingroup$
            Ah I see, so how would I add the second y graph onto this?
            $endgroup$
            – Brooke
            Mar 23 at 19:16










          • $begingroup$
            Do you mean to overlay this graph, or to create other one (in the other window)?
            $endgroup$
            – MarianD
            Mar 23 at 19:30










          • $begingroup$
            They will both be on the same axis so it will over lay it and show both
            $endgroup$
            – Brooke
            Mar 23 at 19:38










          • $begingroup$
            It's not a good idea, because there is such difference between the 2 functions that the sine function will appear to coincident with x axis. See: $sin(5pi /2) = 1$, while $x^3 + 3x^2 - x + 0.3$ will be for the same $x =5pi /2$ approximately $662$.
            $endgroup$
            – MarianD
            Mar 23 at 20:01











          • $begingroup$
            That what the assignment question is asking me to do as I am to find the real solutions of the graphs.
            $endgroup$
            – Brooke
            Mar 23 at 20:10
















          • $begingroup$
            Ah I see, so how would I add the second y graph onto this?
            $endgroup$
            – Brooke
            Mar 23 at 19:16










          • $begingroup$
            Do you mean to overlay this graph, or to create other one (in the other window)?
            $endgroup$
            – MarianD
            Mar 23 at 19:30










          • $begingroup$
            They will both be on the same axis so it will over lay it and show both
            $endgroup$
            – Brooke
            Mar 23 at 19:38










          • $begingroup$
            It's not a good idea, because there is such difference between the 2 functions that the sine function will appear to coincident with x axis. See: $sin(5pi /2) = 1$, while $x^3 + 3x^2 - x + 0.3$ will be for the same $x =5pi /2$ approximately $662$.
            $endgroup$
            – MarianD
            Mar 23 at 20:01











          • $begingroup$
            That what the assignment question is asking me to do as I am to find the real solutions of the graphs.
            $endgroup$
            – Brooke
            Mar 23 at 20:10















          $begingroup$
          Ah I see, so how would I add the second y graph onto this?
          $endgroup$
          – Brooke
          Mar 23 at 19:16




          $begingroup$
          Ah I see, so how would I add the second y graph onto this?
          $endgroup$
          – Brooke
          Mar 23 at 19:16












          $begingroup$
          Do you mean to overlay this graph, or to create other one (in the other window)?
          $endgroup$
          – MarianD
          Mar 23 at 19:30




          $begingroup$
          Do you mean to overlay this graph, or to create other one (in the other window)?
          $endgroup$
          – MarianD
          Mar 23 at 19:30












          $begingroup$
          They will both be on the same axis so it will over lay it and show both
          $endgroup$
          – Brooke
          Mar 23 at 19:38




          $begingroup$
          They will both be on the same axis so it will over lay it and show both
          $endgroup$
          – Brooke
          Mar 23 at 19:38












          $begingroup$
          It's not a good idea, because there is such difference between the 2 functions that the sine function will appear to coincident with x axis. See: $sin(5pi /2) = 1$, while $x^3 + 3x^2 - x + 0.3$ will be for the same $x =5pi /2$ approximately $662$.
          $endgroup$
          – MarianD
          Mar 23 at 20:01





          $begingroup$
          It's not a good idea, because there is such difference between the 2 functions that the sine function will appear to coincident with x axis. See: $sin(5pi /2) = 1$, while $x^3 + 3x^2 - x + 0.3$ will be for the same $x =5pi /2$ approximately $662$.
          $endgroup$
          – MarianD
          Mar 23 at 20:01













          $begingroup$
          That what the assignment question is asking me to do as I am to find the real solutions of the graphs.
          $endgroup$
          – Brooke
          Mar 23 at 20:10




          $begingroup$
          That what the assignment question is asking me to do as I am to find the real solutions of the graphs.
          $endgroup$
          – Brooke
          Mar 23 at 20:10



          Popular posts from this blog

          Solar Wings Breeze Design and development Specifications (Breeze) References Navigation menu1368-485X"Hang glider: Breeze (Solar Wings)"e

          Kathakali Contents Etymology and nomenclature History Repertoire Songs and musical instruments Traditional plays Styles: Sampradayam Training centers and awards Relationship to other dance forms See also Notes References External links Navigation menueThe Illustrated Encyclopedia of Hinduism: A-MSouth Asian Folklore: An EncyclopediaRoutledge International Encyclopedia of Women: Global Women's Issues and KnowledgeKathakali Dance-drama: Where Gods and Demons Come to PlayKathakali Dance-drama: Where Gods and Demons Come to PlayKathakali Dance-drama: Where Gods and Demons Come to Play10.1353/atj.2005.0004The Illustrated Encyclopedia of Hinduism: A-MEncyclopedia of HinduismKathakali Dance-drama: Where Gods and Demons Come to PlaySonic Liturgy: Ritual and Music in Hindu Tradition"The Mirror of Gesture"Kathakali Dance-drama: Where Gods and Demons Come to Play"Kathakali"Indian Theatre: Traditions of PerformanceIndian Theatre: Traditions of PerformanceIndian Theatre: Traditions of PerformanceIndian Theatre: Traditions of PerformanceMedieval Indian Literature: An AnthologyThe Oxford Companion to Indian TheatreSouth Asian Folklore: An Encyclopedia : Afghanistan, Bangladesh, India, Nepal, Pakistan, Sri LankaThe Rise of Performance Studies: Rethinking Richard Schechner's Broad SpectrumIndian Theatre: Traditions of PerformanceModern Asian Theatre and Performance 1900-2000Critical Theory and PerformanceBetween Theater and AnthropologyKathakali603847011Indian Theatre: Traditions of PerformanceIndian Theatre: Traditions of PerformanceIndian Theatre: Traditions of PerformanceBetween Theater and AnthropologyBetween Theater and AnthropologyNambeesan Smaraka AwardsArchivedThe Cambridge Guide to TheatreRoutledge International Encyclopedia of Women: Global Women's Issues and KnowledgeThe Garland Encyclopedia of World Music: South Asia : the Indian subcontinentThe Ethos of Noh: Actors and Their Art10.2307/1145740By Means of Performance: Intercultural Studies of Theatre and Ritual10.1017/s204912550000100xReconceiving the Renaissance: A Critical ReaderPerformance TheoryListening to Theatre: The Aural Dimension of Beijing Opera10.2307/1146013Kathakali: The Art of the Non-WorldlyOn KathakaliKathakali, the dance theatreThe Kathakali Complex: Performance & StructureKathakali Dance-Drama: Where Gods and Demons Come to Play10.1093/obo/9780195399318-0071Drama and Ritual of Early Hinduism"In the Shadow of Hollywood Orientalism: Authentic East Indian Dancing"10.1080/08949460490274013Sanskrit Play Production in Ancient IndiaIndian Music: History and StructureBharata, the Nāṭyaśāstra233639306Table of Contents2238067286469807Dance In Indian Painting10.2307/32047833204783Kathakali Dance-Theatre: A Visual Narrative of Sacred Indian MimeIndian Classical Dance: The Renaissance and BeyondKathakali: an indigenous art-form of Keralaeee

          Method to test if a number is a perfect power? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)Detecting perfect squares faster than by extracting square rooteffective way to get the integer sequence A181392 from oeisA rarely mentioned fact about perfect powersHow many numbers such $n$ are there that $n<100,lfloorsqrtn rfloor mid n$Check perfect squareness by modulo division against multiple basesFor what pair of integers $(a,b)$ is $3^a + 7^b$ a perfect square.Do there exist any positive integers $n$ such that $lfloore^nrfloor$ is a perfect power? What is the probability that one exists?finding perfect power factors of an integerProve that the sequence contains a perfect square for any natural number $m $ in the domain of $f$ .Counting Perfect Powers