<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, plot an array</title>
    <link>http://www.mapleprimes.com/questions/35495-Plot-An-Array</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Tue, 09 Jun 2026 10:03:06 GMT</lastBuildDate>
    <pubDate>Tue, 09 Jun 2026 10:03:06 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, plot an array</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, plot an array</title>
      <link>http://www.mapleprimes.com/questions/35495-Plot-An-Array</link>
    </image>
    <item>
      <title>plot an array</title>
      <link>http://www.mapleprimes.com/questions/35495-Plot-An-Array?ref=Feed:MaplePrimes:plot an array:Comments#answer44072</link>
      <itunes:summary>&lt;p&gt;Here is an example, that does not require loading any packages.&amp;nbsp; There are other ways to do this, including pointplot, and scatterplot.&amp;nbsp;&amp;nbsp; ydata is your &amp;quot;array&amp;quot; of points.&amp;nbsp; In your case it will have 25 elements.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;restart:&lt;/p&gt;
&lt;p&gt;ydata:=[4.019,3.986,3.883,3.640,3.344,3.113,2.940,2.731,2.464,2.202,2.016,1.843];&lt;/p&gt;
&lt;p&gt;xdata:=[seq(i,i=0..nops(ydata))];&lt;/p&gt;
&lt;p&gt;pair:=(x,y)-&amp;gt;[x,y]:&lt;/p&gt;
&lt;p&gt;P:=zip(pair,xdata,ydata):&lt;/p&gt;
&lt;p&gt;plot(P);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;address&gt;Regards,&lt;br /&gt;
Georgios Kokovidis&lt;/address&gt;
&lt;address&gt;Dr&amp;auml;ger Medical&lt;/address&gt;
&lt;pre&gt;

&lt;/pre&gt;</itunes:summary>
      <description>&lt;p&gt;Here is an example, that does not require loading any packages.&amp;nbsp; There are other ways to do this, including pointplot, and scatterplot.&amp;nbsp;&amp;nbsp; ydata is your &amp;quot;array&amp;quot; of points.&amp;nbsp; In your case it will have 25 elements.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;restart:&lt;/p&gt;
&lt;p&gt;ydata:=[4.019,3.986,3.883,3.640,3.344,3.113,2.940,2.731,2.464,2.202,2.016,1.843];&lt;/p&gt;
&lt;p&gt;xdata:=[seq(i,i=0..nops(ydata))];&lt;/p&gt;
&lt;p&gt;pair:=(x,y)-&amp;gt;[x,y]:&lt;/p&gt;
&lt;p&gt;P:=zip(pair,xdata,ydata):&lt;/p&gt;
&lt;p&gt;plot(P);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;address&gt;Regards,&lt;br /&gt;
Georgios Kokovidis&lt;/address&gt;
&lt;address&gt;Dr&amp;auml;ger Medical&lt;/address&gt;
&lt;pre&gt;

&lt;/pre&gt;</description>
      <guid>44072</guid>
      <pubDate>Wed, 17 Mar 2010 05:14:09 Z</pubDate>
      <itunes:author>gkokovidis</itunes:author>
      <author>gkokovidis</author>
    </item>
    <item>
      <title>it wouldnt plot anything.</title>
      <link>http://www.mapleprimes.com/questions/35495-Plot-An-Array?ref=Feed:MaplePrimes:plot an array:Comments#answer44073</link>
      <itunes:summary>&lt;p&gt;it wouldnt plot anything. The code for the array is&lt;/p&gt;
&lt;p&gt;A := Array(1 .. 25);&lt;br /&gt;
for t from 1 to 25&lt;/p&gt;
&lt;p&gt;do A[t] := f(t)&lt;/p&gt;
&lt;p&gt;end do;&lt;br /&gt;
&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I need to plot the values from this array, A1 to A25 against t&lt;/p&gt;
&lt;p&gt;(basically im trying to plot a decay graph)&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;it wouldnt plot anything. The code for the array is&lt;/p&gt;
&lt;p&gt;A := Array(1 .. 25);&lt;br /&gt;
for t from 1 to 25&lt;/p&gt;
&lt;p&gt;do A[t] := f(t)&lt;/p&gt;
&lt;p&gt;end do;&lt;br /&gt;
&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I need to plot the values from this array, A1 to A25 against t&lt;/p&gt;
&lt;p&gt;(basically im trying to plot a decay graph)&lt;/p&gt;</description>
      <guid>44073</guid>
      <pubDate>Thu, 18 Mar 2010 20:48:39 Z</pubDate>
      <itunes:author>CAJOS</itunes:author>
      <author>CAJOS</author>
    </item>
    <item>
      <title>zip</title>
      <link>http://www.mapleprimes.com/questions/35495-Plot-An-Array?ref=Feed:MaplePrimes:plot an array:Comments#answer44075</link>
      <itunes:summary>&lt;p&gt;Here is yet another option to add to what Robert posted above this:&lt;/p&gt;
&lt;p&gt;&amp;gt;restart:&lt;br /&gt;
&amp;gt;A := [`$`([t,exp(-t/5)], t = 1 .. 25)];&lt;br /&gt;
&amp;gt;plot(A);&lt;br /&gt;
&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;address&gt;Regards,&lt;br /&gt;
Georgios Kokovidis&lt;/address&gt;
&lt;address&gt;Dr&amp;auml;ger Medical&lt;/address&gt;
&lt;pre&gt;

&lt;/pre&gt;</itunes:summary>
      <description>&lt;p&gt;Here is yet another option to add to what Robert posted above this:&lt;/p&gt;
&lt;p&gt;&amp;gt;restart:&lt;br /&gt;
&amp;gt;A := [`$`([t,exp(-t/5)], t = 1 .. 25)];&lt;br /&gt;
&amp;gt;plot(A);&lt;br /&gt;
&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;address&gt;Regards,&lt;br /&gt;
Georgios Kokovidis&lt;/address&gt;
&lt;address&gt;Dr&amp;auml;ger Medical&lt;/address&gt;
&lt;pre&gt;

&lt;/pre&gt;</description>
      <guid>44075</guid>
      <pubDate>Thu, 18 Mar 2010 21:54:55 Z</pubDate>
      <itunes:author>gkokovidis</itunes:author>
      <author>gkokovidis</author>
    </item>
    <item>
      <title>with the second solution, i</title>
      <link>http://www.mapleprimes.com/questions/35495-Plot-An-Array?ref=Feed:MaplePrimes:plot an array:Comments#answer44076</link>
      <itunes:summary>&lt;p&gt;with the second solution, i get:&lt;/p&gt;
&lt;p&gt;Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct&lt;/p&gt;
&lt;p&gt;with the last solution i get:&lt;/p&gt;
&lt;p&gt;Error, (in plots/tolist) points are not in the correct format&lt;/p&gt;
&lt;p&gt;I have been told that turning the array into a list of 25 values and then plotting them is the way to do it. I thought there was a more simpilar way to turn the array into a plotable graph&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;with the second solution, i get:&lt;/p&gt;
&lt;p&gt;Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct&lt;/p&gt;
&lt;p&gt;with the last solution i get:&lt;/p&gt;
&lt;p&gt;Error, (in plots/tolist) points are not in the correct format&lt;/p&gt;
&lt;p&gt;I have been told that turning the array into a list of 25 values and then plotting them is the way to do it. I thought there was a more simpilar way to turn the array into a plotable graph&lt;/p&gt;</description>
      <guid>44076</guid>
      <pubDate>Thu, 18 Mar 2010 22:02:56 Z</pubDate>
      <itunes:author>CAJOS</itunes:author>
      <author>CAJOS</author>
    </item>
    <item>
      <title>gkokovidis I have a graph</title>
      <link>http://www.mapleprimes.com/questions/35495-Plot-An-Array?ref=Feed:MaplePrimes:plot an array:Comments#answer44077</link>
      <itunes:summary>&lt;p&gt;&lt;a title="View user profile." href="http://www.mapleprimes.com/user/gkokovidis"&gt;&lt;font color="#000000"&gt;gkokovidis&lt;/font&gt;&lt;/a&gt;&amp;nbsp;I have a graph now but doesnt use the array set up earlyer. Not that I am fussed, just it says to use the array to plot the graph.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thanks anyways&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;&lt;a title="View user profile." href="http://www.mapleprimes.com/user/gkokovidis"&gt;&lt;font color="#000000"&gt;gkokovidis&lt;/font&gt;&lt;/a&gt;&amp;nbsp;I have a graph now but doesnt use the array set up earlyer. Not that I am fussed, just it says to use the array to plot the graph.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thanks anyways&lt;/p&gt;</description>
      <guid>44077</guid>
      <pubDate>Thu, 18 Mar 2010 22:27:22 Z</pubDate>
      <itunes:author>CAJOS</itunes:author>
      <author>CAJOS</author>
    </item>
    <item>
      <title>zip</title>
      <link>http://www.mapleprimes.com/questions/35495-Plot-An-Array?ref=Feed:MaplePrimes:plot an array:Comments#comment44074</link>
      <itunes:summary>&lt;p&gt;Georgios's code doesn't work because zip needs its two arguments to be of the same type.&amp;nbsp; It would work if xdata was also an Array.&amp;nbsp; Thus:&lt;/p&gt;
&lt;pre&gt;
&amp;gt; xdata:= Array([$1..25]);
&lt;/pre&gt;
&lt;p&gt;But a simpler one-line solution (assuming your f returns numeric values) is&lt;/p&gt;
&lt;pre&gt;
&amp;gt; plot([seq]([i,f(i)],i=1..25), style=point);
&lt;/pre&gt;
&lt;p&gt;or if you really need to use the Array A:&lt;/p&gt;
&lt;pre&gt;
&amp;gt; plots[listplot](A, style=point);
&lt;/pre&gt;</itunes:summary>
      <description>&lt;p&gt;Georgios's code doesn't work because zip needs its two arguments to be of the same type.&amp;nbsp; It would work if xdata was also an Array.&amp;nbsp; Thus:&lt;/p&gt;
&lt;pre&gt;
&amp;gt; xdata:= Array([$1..25]);
&lt;/pre&gt;
&lt;p&gt;But a simpler one-line solution (assuming your f returns numeric values) is&lt;/p&gt;
&lt;pre&gt;
&amp;gt; plot([seq]([i,f(i)],i=1..25), style=point);
&lt;/pre&gt;
&lt;p&gt;or if you really need to use the Array A:&lt;/p&gt;
&lt;pre&gt;
&amp;gt; plots[listplot](A, style=point);
&lt;/pre&gt;</description>
      <guid>44074</guid>
      <pubDate>Thu, 18 Mar 2010 21:45:23 Z</pubDate>
      <itunes:author>Robert Israel</itunes:author>
      <author>Robert Israel</author>
    </item>
  </channel>
</rss>