Loading ...
Sorry, an error occurred while loading the content.

40529Re: [libertybasic] Re: plot using EXCEL

Expand Messages
  • RipSaw
    Apr 1, 2010
                     for x= -10 to 20
                      y= 1/2 *x + 1
                      print using(" ####.#",x) ;:print "   ,   "  ;:print using(" ####.#",y)
                      next x

      John the above code you will relize is a simple line.  I just plotted this line in Excel (now that I know what I am doing)
      in abt 30 secs.  Would u be kind enuff to write code, and use rem statements to tell me (the novice) what u are doing?
      I tried to plot abt 1 yr ago and then I ran out of steam.

      I want a nice big page, please think this line might be for a large presentation.   Not a small graph.    I have 8 x 11 paper here.
      Kurt





      ________________________________
      From: John Fisher <mr.john.f@...>
      To: libertybasic@yahoogroups.com
      Sent: Thu, April 1, 2010 9:59:09 AM
      Subject: Re: [libertybasic] Re: plot using EXCEL

       
      Or with axes added....

      nomainwin

      ebat = 1e2
      r = 3.0e6
      c = 10e-12

      WindowWidth = 530
      WindowHeight = 560

      graphicbox #w.g, 10, 10, 500, 500

      open "Charging Capacitor" for window as #w

      #w, "trapclose [quit]"

      #w.g, "size 2 ; goto 10 10 ; down ; box 490 490"

      #w.g, "place 190 200 ; font arial 18 bold"
      #w.g, "\Discharging CR circuit"

      #w.g, "size 1 ; color lightgray"

      for vAxis =1 to 5
      #w.g, "line "; 10 +int( vAxis /5 *480); " 10 "; 10 +int( vAxis
      /5 *480); " 490"
      next vAxis

      for hAxis =1 to 10
      #w.g, "line 10 "; 10 +int( hAxis /10 *480); " 490 "; 10 +int(
      hAxis /10 *480)
      next hAxis

      #w.g, "size 2"

      for t =0 to 5 *r *c step r *c /50
      ec =ebat *( 1 -exp( 0 -t / ( r *c)))
      er = ebat -ec
      #w.g, "color red ; set "; 10 +int( t / ( 5 * r *c) *480); " ";
      490 -int( er /ebat *480)
      #w.g, "color blue ; set "; 10 +int( t / ( 5 * r *c) *480); " ";
      490 -int( ec /ebat *480)
      next t

      #w.g, "flush"

      confirm "Send to printer?"; answer
      if answer then #w.g, "print vga"

      wait

      [quit]
      close #w
      end







      [Non-text portions of this message have been removed]
    • Show all 22 messages in this topic