• Search
  • Register
  • Log in
  • The Math Root » NumPY, SciPy and Matplotlib
  • Creating a basic plot with matplotlib
  •  
    Anil

    If you have numpy and matplotlib installed, creating your first plot is very simple.
    Let's say that you have a list of numbers in a variable called 'myvar'
    For ex: myvar = [1,2,5,7,3,4]

    Here's how you can plot it:

    import matplotlib.pyplot as plt
    
    plt.plot(myvar)
    
    plt.ylabel('My Var')
    plt.xlabel('Time Samples')
    plt.title('My Fancy Plot')
    plt.show()
    

    More about how to make fancier plots later.

    #16
    Anil
    Member
    Posted 1 year ago
    RSS feed for this topic  

    Reply

    You must log in to post.

      Tags:

  •  © 2009 Anil Kandangath. All posts are owned by the whoever posted them. Share your knowledge.
    The Math Root is proudly powered by bbPress.. This site is not affiliated with The MathWorks™ or Wolfram Research. //   Theme by Mike Lothar  
    [ Time : 0.085s | 8 Queries ]