<?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: Plot markers transparency and color gradient	</title>
	<atom:link href="https://undocumentedmatlab.com/articles/plot-markers-transparency-and-color-gradient/feed" rel="self" type="application/rss+xml" />
	<link>https://undocumentedmatlab.com/articles/plot-markers-transparency-and-color-gradient?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=plot-markers-transparency-and-color-gradient</link>
	<description>Professional Matlab consulting, development and training</description>
	<lastBuildDate>Tue, 31 May 2022 15:30:46 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>
	<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/plot-markers-transparency-and-color-gradient#comment-514177</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Tue, 31 May 2022 15:30:46 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=5262#comment-514177</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/plot-markers-transparency-and-color-gradient#comment-514175&quot;&gt;Dom&lt;/a&gt;.

Dom - call &lt;b&gt;&lt;i&gt;drawnow&lt;/i&gt;&lt;/b&gt; *just before* you set &lt;b&gt;hLine.MarkerHandle.FaceColorType&lt;/b&gt; to &lt;code&gt;&#039;truecoloralpha&#039;&lt;/code&gt;. 
Also, you made a typo in your code: it&#039;s tru&lt;b&gt;e&lt;/b&gt;coloralpha, not trucoloralpha.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/plot-markers-transparency-and-color-gradient#comment-514175">Dom</a>.</p>
<p>Dom &#8211; call <b><i>drawnow</i></b> *just before* you set <b>hLine.MarkerHandle.FaceColorType</b> to <code>'truecoloralpha'</code>.<br />
Also, you made a typo in your code: it&#8217;s tru<b>e</b>coloralpha, not trucoloralpha.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Dom		</title>
		<link>https://undocumentedmatlab.com/articles/plot-markers-transparency-and-color-gradient#comment-514175</link>

		<dc:creator><![CDATA[Dom]]></dc:creator>
		<pubDate>Mon, 30 May 2022 16:49:16 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=5262#comment-514175</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/plot-markers-transparency-and-color-gradient#comment-513742&quot;&gt;Yair Altman&lt;/a&gt;.

Yair I have tried your code with trucoloralpha and the markers do not appear transparent in R2021b, same as for Oliver.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/plot-markers-transparency-and-color-gradient#comment-513742">Yair Altman</a>.</p>
<p>Yair I have tried your code with trucoloralpha and the markers do not appear transparent in R2021b, same as for Oliver.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/plot-markers-transparency-and-color-gradient#comment-513742</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Mon, 07 Mar 2022 18:47:48 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=5262#comment-513742</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/plot-markers-transparency-and-color-gradient#comment-513741&quot;&gt;Oliver&lt;/a&gt;.

Oliver - you probably forgot to update &lt;b&gt;hMarkers.FaceColorType&lt;/b&gt; to &#039;truecolor&lt;i&gt;alpha&lt;/i&gt;&#039;:
&lt;pre lang=&quot;matlab&quot; highlight=&quot;4&quot;&gt;
x=1:10; y=10*x;
figure; hLine = plot(x,y,&#039;o-&#039;);
hLine.MarkerFaceColor = &#039;r&#039;; drawnow
hLine.MarkerHandle.FaceColorType = &#039;truecoloralpha&#039;;  % default=&#039;truecolor&#039; without alpha
hLine.MarkerHandle.FaceColorData = uint8(255*[1;0;0;.3]);
drawnow
&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/plot-markers-transparency-and-color-gradient#comment-513741">Oliver</a>.</p>
<p>Oliver &#8211; you probably forgot to update <b>hMarkers.FaceColorType</b> to &#8216;truecolor<i>alpha</i>&#8216;:</p>
<pre lang="matlab" highlight="4">
x=1:10; y=10*x;
figure; hLine = plot(x,y,'o-');
hLine.MarkerFaceColor = 'r'; drawnow
hLine.MarkerHandle.FaceColorType = 'truecoloralpha';  % default='truecolor' without alpha
hLine.MarkerHandle.FaceColorData = uint8(255*[1;0;0;.3]);
drawnow
</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Oliver		</title>
		<link>https://undocumentedmatlab.com/articles/plot-markers-transparency-and-color-gradient#comment-513741</link>

		<dc:creator><![CDATA[Oliver]]></dc:creator>
		<pubDate>Mon, 07 Mar 2022 18:33:58 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=5262#comment-513741</guid>

					<description><![CDATA[This seems to have been disabled in the most recent version of Matlab (R2021b). When I use this method the hMarker.FaceColorData does change, but the markers are not made transparent. Any ideas?]]></description>
			<content:encoded><![CDATA[<p>This seems to have been disabled in the most recent version of Matlab (R2021b). When I use this method the hMarker.FaceColorData does change, but the markers are not made transparent. Any ideas?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/plot-markers-transparency-and-color-gradient#comment-508850</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Wed, 26 Aug 2020 09:27:32 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=5262#comment-508850</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/plot-markers-transparency-and-color-gradient#comment-508849&quot;&gt;Pierre&lt;/a&gt;.

@Pierre - thanks for sharing this clever useful trick]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/plot-markers-transparency-and-color-gradient#comment-508849">Pierre</a>.</p>
<p>@Pierre &#8211; thanks for sharing this clever useful trick</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Pierre		</title>
		<link>https://undocumentedmatlab.com/articles/plot-markers-transparency-and-color-gradient#comment-508849</link>

		<dc:creator><![CDATA[Pierre]]></dc:creator>
		<pubDate>Wed, 26 Aug 2020 09:15:04 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=5262#comment-508849</guid>

					<description><![CDATA[Hello, 
This post has been really useful to me. I just want to share a small trick. I have no idea whether it is reproducible or how it works, but it does the job for me (Win 10, R2019b). 
When I use &lt;code&gt;plot&lt;/code&gt; function, the transparency settings are always reset by any command related to the current figure. 
However, when I use &lt;code&gt;errorbar&lt;/code&gt; the transparency settings are kept. So, I have been using errorbar instead of plot, with a &#039;fake&#039; error vector, and a capsize equal to 0.
E.g.:
&lt;pre lang=&quot;matlab&quot;&gt;
fake_y_error = zeros(length(data_y),1);
he = errorbar(x_data, y_data, fake_y_error)
drawnow
he_mh = he.MarkerHandle;
he_mh.FaceColorType = &#039;truecoloralpha&#039;;
he_mh.FaceColorData = uint8(255*[1;0;0;0.3]); 
he.CapSize = 0;
&lt;/pre&gt;

And, all the more convenient, it works when actual error-bars are needed.]]></description>
			<content:encoded><![CDATA[<p>Hello,<br />
This post has been really useful to me. I just want to share a small trick. I have no idea whether it is reproducible or how it works, but it does the job for me (Win 10, R2019b).<br />
When I use <code>plot</code> function, the transparency settings are always reset by any command related to the current figure.<br />
However, when I use <code>errorbar</code> the transparency settings are kept. So, I have been using errorbar instead of plot, with a &#8216;fake&#8217; error vector, and a capsize equal to 0.<br />
E.g.:</p>
<pre lang="matlab">
fake_y_error = zeros(length(data_y),1);
he = errorbar(x_data, y_data, fake_y_error)
drawnow
he_mh = he.MarkerHandle;
he_mh.FaceColorType = 'truecoloralpha';
he_mh.FaceColorData = uint8(255*[1;0;0;0.3]); 
he.CapSize = 0;
</pre>
<p>And, all the more convenient, it works when actual error-bars are needed.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Tim		</title>
		<link>https://undocumentedmatlab.com/articles/plot-markers-transparency-and-color-gradient#comment-508035</link>

		<dc:creator><![CDATA[Tim]]></dc:creator>
		<pubDate>Fri, 20 Dec 2019 22:56:45 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=5262#comment-508035</guid>

					<description><![CDATA[Thank you for this post, it is very useful. It seems that when using plot3, if I have more than 25,000 points and I change my figure size or rotate the image, the MarkerHandle values revert back to the original settings and all color-information and/or transparency information is immediately reset. It is simple enough to reset the MarkerHandle properties following a viewpoint transformation but it is a bit of a pain, especially since I would like to explore the 3D point cloud using zoom and rotation. Have you discovered a similar issue and is there a workaround to this problem? The Matlab version I&#039;m using is R2019a]]></description>
			<content:encoded><![CDATA[<p>Thank you for this post, it is very useful. It seems that when using plot3, if I have more than 25,000 points and I change my figure size or rotate the image, the MarkerHandle values revert back to the original settings and all color-information and/or transparency information is immediately reset. It is simple enough to reset the MarkerHandle properties following a viewpoint transformation but it is a bit of a pain, especially since I would like to explore the 3D point cloud using zoom and rotation. Have you discovered a similar issue and is there a workaround to this problem? The Matlab version I&#8217;m using is R2019a</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Hassan		</title>
		<link>https://undocumentedmatlab.com/articles/plot-markers-transparency-and-color-gradient#comment-486245</link>

		<dc:creator><![CDATA[Hassan]]></dc:creator>
		<pubDate>Sun, 14 Jul 2019 15:44:01 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=5262#comment-486245</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/plot-markers-transparency-and-color-gradient#comment-486232&quot;&gt;Hassan&lt;/a&gt;.

solved. the scatter plot was prepared for part of the full cell number!]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/plot-markers-transparency-and-color-gradient#comment-486232">Hassan</a>.</p>
<p>solved. the scatter plot was prepared for part of the full cell number!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Hassan		</title>
		<link>https://undocumentedmatlab.com/articles/plot-markers-transparency-and-color-gradient#comment-486232</link>

		<dc:creator><![CDATA[Hassan]]></dc:creator>
		<pubDate>Sun, 14 Jul 2019 12:19:38 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=5262#comment-486232</guid>

					<description><![CDATA[Dear Yair, 
I have the following code that worked for me in the past. I have nothing new except or using different dataset (the Matlab version is the same 2016a). But it is not working now! 
I am getting a warning message after running the following command 
&lt;pre lang=&quot;matlab&quot;&gt;hMarkers.FaceColorData=CMdata;
Warning: Error creating or updating Marker
 Error in value of property  ColorData
 Array contains incorrect data values&lt;/pre&gt;

Here are the full code lines that I used: 
&lt;pre lang=&quot;matlab&quot;&gt;CMtrans=uint8(255*(sum(hint.mat_norm(markersIn,:),1)./max(sum(hint.mat_norm(markersIn,:),1))));
CMdata=uint8([repmat(mCol&#039;*255,1,length(CMtrans)); CMtrans]);
L2=scatter(ax,hint.xy(cellsIn,1),hint.xy(cellsIn,2),floor(ms2*frac),mCol,&#039;filled&#039;);
drawnow;
hMarkers = L2.MarkerHandle;
hMarkers.FaceColorType = &#039;truecoloralpha&#039;;
hMarkers.FaceColorData=CMdata;
set(hMarkers,&#039;FaceColorBinding&#039;,&#039;interpolated&#039;, &#039;FaceColorData&#039;,CMdata);&lt;/pre&gt;


Any advice? 
Thanks, HM]]></description>
			<content:encoded><![CDATA[<p>Dear Yair,<br />
I have the following code that worked for me in the past. I have nothing new except or using different dataset (the Matlab version is the same 2016a). But it is not working now!<br />
I am getting a warning message after running the following command </p>
<pre lang="matlab">hMarkers.FaceColorData=CMdata;
Warning: Error creating or updating Marker
 Error in value of property  ColorData
 Array contains incorrect data values</pre>
<p>Here are the full code lines that I used: </p>
<pre lang="matlab">CMtrans=uint8(255*(sum(hint.mat_norm(markersIn,:),1)./max(sum(hint.mat_norm(markersIn,:),1))));
CMdata=uint8([repmat(mCol'*255,1,length(CMtrans)); CMtrans]);
L2=scatter(ax,hint.xy(cellsIn,1),hint.xy(cellsIn,2),floor(ms2*frac),mCol,'filled');
drawnow;
hMarkers = L2.MarkerHandle;
hMarkers.FaceColorType = 'truecoloralpha';
hMarkers.FaceColorData=CMdata;
set(hMarkers,'FaceColorBinding','interpolated', 'FaceColorData',CMdata);</pre>
<p>Any advice?<br />
Thanks, HM</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/plot-markers-transparency-and-color-gradient#comment-483097</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Sun, 16 Jun 2019 15:09:42 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=5262#comment-483097</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/plot-markers-transparency-and-color-gradient#comment-477250&quot;&gt;Wolfgang&lt;/a&gt;.

The extra pause() (or drawnow) call forces Matlab&#039;s graphic engine to flush (execute) any pending graphic rendering events in its graphics queue, thereby ensuring that when you set the transparency it &quot;sticks&quot;. Without the pause/drawnow, the graphics queue might reset the transparency after you have set it, depending on internal timings over which we have no control. 

Related: &lt;a href=&quot;http://undocumentedmatlab.com/blog/solving-a-matlab-hang-problem&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://undocumentedmatlab.com/blog/solving-a-matlab-hang-problem&lt;/a&gt;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/plot-markers-transparency-and-color-gradient#comment-477250">Wolfgang</a>.</p>
<p>The extra pause() (or drawnow) call forces Matlab&#8217;s graphic engine to flush (execute) any pending graphic rendering events in its graphics queue, thereby ensuring that when you set the transparency it &#8220;sticks&#8221;. Without the pause/drawnow, the graphics queue might reset the transparency after you have set it, depending on internal timings over which we have no control. </p>
<p>Related: <a href="http://undocumentedmatlab.com/blog/solving-a-matlab-hang-problem" target="_blank" rel="nofollow">http://undocumentedmatlab.com/blog/solving-a-matlab-hang-problem</a></p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
