Using Processing to display data graphs


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,692


    Did you find this post helpful? Yes | No

    Default Re: Using Processing to display data graphs

    with a click of the finger the x axis can be made a datetime object and will auto scale from years through months ,days ,hours, minutes ,seconds to microseconds

    Code:
    import csv, sys
    import matplotlib.pyplot as plt
    import datetime
    filename = 'test0.csv'
    t=[]   #time
    a=[]   #altitude
    n=0
    date=datetime.datetime.now()
    with open(filename, 'rb') as f:
        reader = csv.reader(f)
        for row in reader:
                #print row
                n +=1
                tn=date+datetime.timedelta(seconds=n/100.0)
                a.append(float(row[4]))
                t.append(tn)
    plt.title('Canadaroad')
    plt.ylabel('Altitude Feet')           
    plt.gcf().autofmt_xdate(bottom=0.2, rotation=30, ha='right')            
    plt.plot_date(t,a,'b-',label='Altitude')
    plt.legend(loc=0,numpoints=1) 
    plt.figure(num=1,figsize=(14,10),dpi=80)           
    plt.show()
    #print a
    i'm yet to tackle 3d objects in python but I think it should not be too difficult
    Attached Images Attached Images  
    Warning I'm not a teacher

Similar Threads

  1. Custom data pin for display.
    By Ziko87 in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 19th July 2011, 15:12
  2. how to display data receiving from xbee to LCD
    By NURULHAIZA in forum mel PIC BASIC
    Replies: 2
    Last Post: - 19th November 2010, 22:24
  3. display received data
    By NURULHAIZA in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 12th May 2010, 07:03
  4. Better processing of a serial bitstream
    By breesy in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 8th June 2007, 01:13
  5. audio processing
    By mischl in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 7th August 2006, 18:36

Members who have read this thread : 0

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts