<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Performance: scatter vs. line	</title>
	<atom:link href="https://undocumentedmatlab.com/articles/performance-scatter-vs-line/feed" rel="self" type="application/rss+xml" />
	<link>https://undocumentedmatlab.com/articles/performance-scatter-vs-line?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=performance-scatter-vs-line</link>
	<description>Professional Matlab consulting, development and training</description>
	<lastBuildDate>Wed, 23 May 2012 02:59:59 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>
	<item>
		<title>
		By: damayi		</title>
		<link>https://undocumentedmatlab.com/articles/performance-scatter-vs-line#comment-87252</link>

		<dc:creator><![CDATA[damayi]]></dc:creator>
		<pubDate>Wed, 23 May 2012 02:59:59 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=637#comment-87252</guid>

					<description><![CDATA[In my application, I will use line as much as possible.
What&#039;s more, line is more simple and easy to control.]]></description>
			<content:encoded><![CDATA[<p>In my application, I will use line as much as possible.<br />
What&#8217;s more, line is more simple and easy to control.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Naor		</title>
		<link>https://undocumentedmatlab.com/articles/performance-scatter-vs-line#comment-3273</link>

		<dc:creator><![CDATA[Naor]]></dc:creator>
		<pubDate>Thu, 15 Oct 2009 22:41:00 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=637#comment-3273</guid>

					<description><![CDATA[very strange indeed.]]></description>
			<content:encoded><![CDATA[<p>very strange indeed.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Benoit		</title>
		<link>https://undocumentedmatlab.com/articles/performance-scatter-vs-line#comment-3267</link>

		<dc:creator><![CDATA[Benoit]]></dc:creator>
		<pubDate>Thu, 15 Oct 2009 09:54:43 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=637#comment-3267</guid>

					<description><![CDATA[In this case, lines are faster than scatter only when colors are used and different for each point (???). Observe this script:

&lt;pre lang=&quot;matlab&quot;&gt;
%% Scatter creation
T = 0;
cla
for i=1:10
	x = rand(1,1000);
	y = rand(1,1000);
	cla
	t = cputime;
	h = scatter( x,y );
	drawnow
	T = T + (cputime-t);
end
fprintf( &#039;Scatter creations: %.2f\n&#039;, T )

%% Lines creation
T = 0;
cla
for i=1:10
	x = rand(1,1000);
	y = rand(1,1000);
	cla
	t = cputime;
	h = line( [x;x], [y;y], props{:} );
	drawnow
	T = T + (cputime-t);
end
fprintf( &#039;Line creations: %.2f\n&#039;, T )

%% Scatter modification
T = 0;
cla
x = rand(1,1000);
y = rand(1,1000);
h = scatter(x,y);
for i=1:10
	y = rand(1,1000);
	t = cputime;
	set( h, &#039;YData&#039;, y );
	drawnow
	T = T + (cputime-t);
end
fprintf( &#039;\nScatter modifications: %.2f\n&#039;, T )

%% Lines modification
T = 0;
cla
x = rand(1,1000);
y = rand(1,1000);
h = line( [x;x], [y;y], props{:} );
for i=1:10
	y = rand(1,1000);
	t = cputime;
	set( h, {&#039;YData&#039;}, num2cell([y;y]&#039;,2) );
	drawnow
	T = T + (cputime-t);
end
fprintf( &#039;Line modifications: %.2f\n&#039;, T )

%% Scatter color creation
T = 0;
cla
for i=1:10
	x = rand(1,1000);
	y = rand(1,1000);
	c = rand(1000,3);
	cla
	t = cputime;
	h = scatter( x,y,50,c );
	drawnow
	T = T + (cputime-t);
end
fprintf( &#039;\nScatter color creation: %.2f\n&#039;, T )

%% Lines color creation
T = 0;
cla
for i=1:10
	x = rand(1,1000);
	y = rand(1,1000);
	c = rand(1000,3);
	cla
	t = cputime;
	h = line( [x;x], [y;y], props{:} );
	set( h, {&#039;MarkerEdgeColor&#039;}, num2cell(c,2) );
	drawnow
	T = T + (cputime-t);
end
fprintf( &#039;Line color creation: %.2f\n&#039;, T )

%% Scatter color modification
T = 0;
cla
x = rand(1,1000);
y = rand(1,1000);
c = rand(1000,3);
h = scatter(x,y,50,c);
for i=1:10
	y = rand(1,1000);
	t = cputime;
	set( h, &#039;YData&#039;, y );
	drawnow
	T = T + (cputime-t);
end
fprintf( &#039;\nScatter color modification: %.2f\n&#039;, T )

%% Lines modification
T = 0;
cla
x = rand(1,1000);
y = rand(1,1000);
c = rand(1000,3);
h = line( [x;x], [y;y], props{:} );
set( h, {&#039;MarkerEdgeColor&#039;}, num2cell(c,2) );
for i=1:10
	y = rand(1,1000);
	t = cputime;
	set( h, {&#039;YData&#039;}, num2cell([y;y]&#039;,2) );
	drawnow
	T = T + (cputime-t);
end
fprintf( &#039;Line color modification: %.2f\n&#039;, T )
&lt;/pre&gt;

When you execute this script, you obtain:
&lt;pre lang=&quot;matlab&quot;&gt;
Scatter creations: 0.76
Line creations: 9.53

Scatter modifications: 0.61
Line modifications: 1.51

Scatter color creation: 4.02
Line color creation: 17.07

Scatter color modification: 4.34
Line color modification: 1.53
&lt;/pre&gt;

Magic, isn&#039;t it?
Sometimes, I wonder if Matlab was not developed at Hogwarts...]]></description>
			<content:encoded><![CDATA[<p>In this case, lines are faster than scatter only when colors are used and different for each point (???). Observe this script:</p>
<pre lang="matlab">
%% Scatter creation
T = 0;
cla
for i=1:10
	x = rand(1,1000);
	y = rand(1,1000);
	cla
	t = cputime;
	h = scatter( x,y );
	drawnow
	T = T + (cputime-t);
end
fprintf( 'Scatter creations: %.2f\n', T )

%% Lines creation
T = 0;
cla
for i=1:10
	x = rand(1,1000);
	y = rand(1,1000);
	cla
	t = cputime;
	h = line( [x;x], [y;y], props{:} );
	drawnow
	T = T + (cputime-t);
end
fprintf( 'Line creations: %.2f\n', T )

%% Scatter modification
T = 0;
cla
x = rand(1,1000);
y = rand(1,1000);
h = scatter(x,y);
for i=1:10
	y = rand(1,1000);
	t = cputime;
	set( h, 'YData', y );
	drawnow
	T = T + (cputime-t);
end
fprintf( '\nScatter modifications: %.2f\n', T )

%% Lines modification
T = 0;
cla
x = rand(1,1000);
y = rand(1,1000);
h = line( [x;x], [y;y], props{:} );
for i=1:10
	y = rand(1,1000);
	t = cputime;
	set( h, {'YData'}, num2cell([y;y]',2) );
	drawnow
	T = T + (cputime-t);
end
fprintf( 'Line modifications: %.2f\n', T )

%% Scatter color creation
T = 0;
cla
for i=1:10
	x = rand(1,1000);
	y = rand(1,1000);
	c = rand(1000,3);
	cla
	t = cputime;
	h = scatter( x,y,50,c );
	drawnow
	T = T + (cputime-t);
end
fprintf( '\nScatter color creation: %.2f\n', T )

%% Lines color creation
T = 0;
cla
for i=1:10
	x = rand(1,1000);
	y = rand(1,1000);
	c = rand(1000,3);
	cla
	t = cputime;
	h = line( [x;x], [y;y], props{:} );
	set( h, {'MarkerEdgeColor'}, num2cell(c,2) );
	drawnow
	T = T + (cputime-t);
end
fprintf( 'Line color creation: %.2f\n', T )

%% Scatter color modification
T = 0;
cla
x = rand(1,1000);
y = rand(1,1000);
c = rand(1000,3);
h = scatter(x,y,50,c);
for i=1:10
	y = rand(1,1000);
	t = cputime;
	set( h, 'YData', y );
	drawnow
	T = T + (cputime-t);
end
fprintf( '\nScatter color modification: %.2f\n', T )

%% Lines modification
T = 0;
cla
x = rand(1,1000);
y = rand(1,1000);
c = rand(1000,3);
h = line( [x;x], [y;y], props{:} );
set( h, {'MarkerEdgeColor'}, num2cell(c,2) );
for i=1:10
	y = rand(1,1000);
	t = cputime;
	set( h, {'YData'}, num2cell([y;y]',2) );
	drawnow
	T = T + (cputime-t);
end
fprintf( 'Line color modification: %.2f\n', T )
</pre>
<p>When you execute this script, you obtain:</p>
<pre lang="matlab">
Scatter creations: 0.76
Line creations: 9.53

Scatter modifications: 0.61
Line modifications: 1.51

Scatter color creation: 4.02
Line color creation: 17.07

Scatter color modification: 4.34
Line color modification: 1.53
</pre>
<p>Magic, isn&#8217;t it?<br />
Sometimes, I wonder if Matlab was not developed at Hogwarts&#8230;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Naor		</title>
		<link>https://undocumentedmatlab.com/articles/performance-scatter-vs-line#comment-3258</link>

		<dc:creator><![CDATA[Naor]]></dc:creator>
		<pubDate>Wed, 14 Oct 2009 20:05:57 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=637#comment-3258</guid>

					<description><![CDATA[Now this is really interesting. Now I&#039;m curious about generating 1000 line objects with one data point/marker each, and saving into a handle vector? Is this what scatter is doing under the hood?]]></description>
			<content:encoded><![CDATA[<p>Now this is really interesting. Now I&#8217;m curious about generating 1000 line objects with one data point/marker each, and saving into a handle vector? Is this what scatter is doing under the hood?</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
