<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Graph Forums — Modifying point series with Python script]]></title>
	<link rel="self" href="https://forum.padowan.dk/extern.php?action=feed&amp;tid=766&amp;type=atom"/>
	<updated>2013-01-01T22:06:06Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.padowan.dk/viewtopic.php?id=766</id>
		<entry>
			<title type="html"><![CDATA[Re: Modifying point series with Python script]]></title>
			<link rel="alternate" href="https://forum.padowan.dk/viewtopic.php?pid=2092#p2092"/>
			<content type="html"><![CDATA[<p>ah! that&#039;s what I was searching for! Thanks!</p>]]></content>
			<author>
				<name><![CDATA[GraphUser3546]]></name>
				<uri>https://forum.padowan.dk/profile.php?id=26856</uri>
			</author>
			<updated>2013-01-01T22:06:06Z</updated>
			<id>https://forum.padowan.dk/viewtopic.php?pid=2092#p2092</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Modifying point series with Python script]]></title>
			<link rel="alternate" href="https://forum.padowan.dk/viewtopic.php?pid=2084#p2084"/>
			<content type="html"><![CDATA[<p>Unfortunately dir does not always show everything. You may therefore want to check the documentation, which is also installed with Graph: <a href="http://www.padowan.dk/doc/PluginDoc/GraphElem.html#id505437">http://www.padowan.dk/doc/PluginDoc/Gra … l#id505437</a></p>]]></content>
			<author>
				<name><![CDATA[Ivan Johansen]]></name>
				<uri>https://forum.padowan.dk/profile.php?id=2</uri>
			</author>
			<updated>2012-12-27T21:27:05Z</updated>
			<id>https://forum.padowan.dk/viewtopic.php?pid=2084#p2084</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Modifying point series with Python script]]></title>
			<link rel="alternate" href="https://forum.padowan.dk/viewtopic.php?pid=2083#p2083"/>
			<content type="html"><![CDATA[<p>Thank you very much!</p><p>I was using the dir(Graph.Selected) and it didn&#039;t show the &quot;Points&quot; function, hence my being puzzled. Well if it&#039;s a simple list of tuple, I&#039;ll be playing with them any way I want now.</p><p>A grateful Graph User.</p>]]></content>
			<author>
				<name><![CDATA[GraphUser3546]]></name>
				<uri>https://forum.padowan.dk/profile.php?id=26856</uri>
			</author>
			<updated>2012-12-27T19:14:06Z</updated>
			<id>https://forum.padowan.dk/viewtopic.php?pid=2083#p2083</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Modifying point series with Python script]]></title>
			<link rel="alternate" href="https://forum.padowan.dk/viewtopic.php?pid=2081#p2081"/>
			<content type="html"><![CDATA[<p>You can use Graph.Selected.Points to access the points as a list. Every entry will be a tuple with a (x,y) coordinate. You can add, remove and change points as with any Python list. Here is an example that adds 1 to every x-coordinate and 2 to every y-coordinate:</p><div class="codebox"><pre><code>P = Graph.Selected.Points
for i in range(len(P)):
  P[i] = (P[i][0]+1, P[i][1]+2)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Ivan Johansen]]></name>
				<uri>https://forum.padowan.dk/profile.php?id=2</uri>
			</author>
			<updated>2012-12-25T16:06:43Z</updated>
			<id>https://forum.padowan.dk/viewtopic.php?pid=2081#p2081</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Modifying point series with Python script]]></title>
			<link rel="alternate" href="https://forum.padowan.dk/viewtopic.php?pid=2079#p2079"/>
			<content type="html"><![CDATA[<p>Greetings,</p><p>I&#039;m learning Python in order to automate some operations on Point Series in Graph. FYI, I have programmed in C++ and LabVIEW in the past, so I&#039;m not totally new to the coding world and object-oriented programming.</p><p>I believe I&#039;d need to use the &quot;GetPoint&quot; method to get the current value of data points, apply my operations to the data, then use the &quot;InsertPoint&quot; and &quot;DeletePoint&quot; methods to replace the old data with the new modified one.</p><p>So I select my Point Series and check that<br /></p><div class="codebox"><pre><code>type(Graph.Selected)</code></pre></div><p> confirms it&#039;s a &quot;Data.TPointSeries&quot;</p><p>From there, I should probably use something like :<br /></p><div class="codebox"><pre><code>Graph.Selected.GetPoint(self, *args)</code></pre></div><p>to get the point values, but looking at your SWIG-generated &quot;.py&quot; code, I can&#039;t figure out what are the arguments that the GetPoint expects. The same interrogation applies to the InsertPoint and DeletePoint methods for my needs.</p><p>Maybe I&#039;m wrong all the way too <img src="https://forum.padowan.dk/img/smilies/smile.png" width="15" height="15" alt="smile" /> Could you please guide me a bit in extracting data from a Point Series and modifying it through the Python interface?</p><p>Thank you very much!</p><p>EDIT: just a sample script adding 1 to x and 2 to y coordinates of all points in a series could do the trick too if it&#039;s easier for you.</p>]]></content>
			<author>
				<name><![CDATA[GraphUser3546]]></name>
				<uri>https://forum.padowan.dk/profile.php?id=26856</uri>
			</author>
			<updated>2012-12-23T16:49:27Z</updated>
			<id>https://forum.padowan.dk/viewtopic.php?pid=2079#p2079</id>
		</entry>
</feed>
