{"id":153,"date":"2017-09-13T10:34:35","date_gmt":"2017-09-13T13:34:35","guid":{"rendered":"http:\/\/www.professores.uff.br\/diomarcesarlobao\/?page_id=153"},"modified":"2017-09-13T10:34:35","modified_gmt":"2017-09-13T13:34:35","slug":"plot1-f","status":"publish","type":"page","link":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/plot1-f\/","title":{"rendered":"plot1.f"},"content":{"rendered":"<pre>c&lt;html&gt;\r\nc&lt;head&gt;&lt;title&gt;plot1.f&lt;\/title&gt;&lt;\/head&gt;\r\nc&lt;body&gt;\r\nc&lt;pre&gt;\r\n      program plotit\r\nc\r\nc    Program to provide plots of Sin(x)\r\nc    Ascii Character plots go to terminal and file 'pplot.out'\r\nc\r\nc    John Mahaffy 1\/25\/95\r\nc\r\n      implicit none\r\n      character line*72\r\n      real x\r\n      integer ip,i\r\n      character xlabel*32,ylabel*32,title*32\r\n      real fx\r\nc\r\nc   line    -   Character string loaded with a line of output\r\nc   ip      -   Position in line for a function value\r\nc   xlabel  -   Contains a label for the x-axis\r\nc   ylabel  -   Contains a label for the y-axis\r\nc   title   -   Contains a title for the plot\r\nc\r\n      open (11,file='pplot.out')\r\nc\r\nc   Label values of the y axis\r\nc\r\n      line=' '\r\n      line(14:15)='-1'\r\n      line(65:65)='1'\r\n      write(*,*) line\r\n      write(11,*) line\r\n      line=' '\r\n      line(11:13)='0.0'\r\nc\r\nc   Draw the y axis\r\nc\r\n      line(15:40)='+----+----+----+----+----+'\r\n      line(41:65)=line(16:40)\r\nc\r\nc   Plot the value at x=0\r\nc     &lt;a name=2&gt;&lt;font color=FF0000&gt;\r\n      ip= nint(25*sin(0.0))+40\r\nc     &lt;\/font&gt;\r\n      line(ip:ip)='*'\r\n      write(*,*) line\r\n      write(11,*) line\r\n      line=' '\r\nc\r\nc    Loop through and plot points for other x values\r\nc\r\n      do 50 i=1,60\r\n         x=.1*i\r\nc     &lt;a name=1&gt;&lt;font color=FF0000&gt;\r\n         ip=nint(25*sin(x))+40\r\nc     &lt;\/font&gt;\r\nc     &lt;a name=3&gt;&lt;font color=98404f&gt;\r\n         if(mod(i,10).eq.0) then\r\nc     &lt;\/font&gt;\r\n            write(line(10:13),'(f4.1)') x\r\n            line(40:40)='+'\r\n         else\r\n            line(10:13)=' '\r\n            line(40:40)='|'\r\n         endif\r\n         line(ip:ip)='*'\r\n         write(*,*) line\r\n         write(11,*) line\r\n 50      line(ip:ip)=' '\r\n      close (11)\r\nc\r\nc   Drive a separate true graphics program (gnuplot)\r\nc\r\nc   First set up the command file for gnuplot\r\nc\r\n      xlabel='''x'''\r\n      ylabel='''y'''\r\n      title='''sin(x)'''\r\n      open (12,file='gnuxy')\r\nc\r\nc   UnComment the next line if you are on an NCSA\/BYU Telnet Session\r\nc\r\nc     write(12,*) 'set terminal tek40xx'\r\nc\r\n      write(12,*) 'set data style lines'\r\n      line='set xlabel '\/\/xlabel\r\n      write(12,*)line\r\n      line='set ylabel '\/\/ylabel\r\n      write(12,*)line\r\n      line='set title '\/\/title\r\n      write(12,*)line\r\n      write(12,*)'set nokey'\r\n      write(12,*)'set xrange [0:6]'\r\n      write(12,*) 'plot ''dataxy'' using 1:2'\r\n      write (12,*) 'pause -1'\r\n      close(12)\r\nc\r\nc   Generate x-y pairs for the graph\r\nc\r\n      open (12,file='dataxy')\r\n      do 100 i=0,60\r\n         x=.1*i\r\n         fx=sin(x)\r\n         write(12,*) x,fx\r\n  100 continue\r\n      close(12)\r\nc\r\n      print *, ' Hit the Return (Enter) key to continue'\r\nc\r\nc   Tell the system to run the program gnuplot\r\nc   This call works on either IBM RS6000 or Sun, but is not part of\r\nc   the Fortran standard.\r\nc   Comment out the line if you aren't at a terminal with graphics\r\nc\r\n      call system ('gnuplot gnuxy')\r\nc&lt;a name=\"stop\"&gt;&lt;font color=\"FF0000\"&gt;\r\n      stop\r\nc&lt;\/font&gt;&lt;\/a&gt;\r\n      end\r\nc&lt;\/pre&gt;\r\nc&lt;\/body&gt;\r\nc&lt;\/html&gt;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>c&lt;html&gt; c&lt;head&gt;&lt;title&gt;plot1.f&lt;\/title&gt;&lt;\/head&gt; c&lt;body&gt; c&lt;pre&gt; program plotit c c Program to provide plots of Sin(x) c Ascii Character plots go to terminal and file &#8216;pplot.out&#8217; c c John Mahaffy 1\/25\/95 c implicit none character line*72 real x integer ip,i character xlabel*32,ylabel*32,title*32 real fx c c line &#8211; Character string loaded with a line of output c [&hellip;]<\/p>\n","protected":false},"author":22,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[],"tags":[],"class_list":["post-153","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/153","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/comments?post=153"}],"version-history":[{"count":1,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/153\/revisions"}],"predecessor-version":[{"id":154,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/153\/revisions\/154"}],"wp:attachment":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/media?parent=153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/categories?post=153"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/tags?post=153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}