<?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: Plotting with Style</title>
	<atom:link href="http://blogs.mathworks.com/loren/2007/12/19/plotting-with-style/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.mathworks.com/loren/2007/12/19/plotting-with-style/</link>
	<description>Loren Shure works on design of the MATLAB language at MathWorks. She writes here about once a week on MATLAB programming and related topics.</description>
	<lastBuildDate>Thu, 09 Feb 2012 04:19:21 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Eric</title>
		<link>http://blogs.mathworks.com/loren/2007/12/19/plotting-with-style/#comment-32932</link>
		<dc:creator>Eric</dc:creator>
		<pubDate>Mon, 23 Jan 2012 23:41:04 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2007/12/19/plotting-with-style/#comment-32932</guid>
		<description>Hi Loren,

Thank you so much for your blog.  I absolutely love it!
I have a question regarding a scatter plot and I was wondering if you would be able to help me.  I&#039;m trying to do a scatter plot with a text annotation on the background.  My question is how I can make the text appear bellow the bubbles, as opposed to on top of them?  Here&#039;s my code.  (I&#039;ve used random data for simplicity here)


vy = randi(80,[100,1]);  % random data 
vx = randi(50000, [100,1]);  % random data 
c = rand([length(vy),3]);  % random colors RGB 
figure(&#039;Position&#039;, [100 100 800 600], &#039;Color&#039;, &#039;w&#039;) 
axes(&#039;Position&#039;,[0.1 0.15 0.8 0.8],&#039;XScale&#039;,&#039;log&#039;, &#039;Color&#039;, &#039;w&#039;) 
axis([200 100000 20 85]);  % [xMin xMax yMin yMax] 
ha = gca;  % get current axes handle 
set(ha, &#039;FontSize&#039;, 14, &#039;Color&#039;, &#039;w&#039;,... 
    &#039;XColor&#039;, [0.5 0.5 0.5], &#039;YColor&#039;, [0.5 0.5 0.5]) 
set(ha, &#039;XTick&#039;, xTick) 
set(ha,&#039;XTickLabel&#039;,{&#039;400&#039;;&#039;1,000&#039;;&#039;2,000&#039;;&#039;4,000&#039;; 
&#039;10,000&#039;;&#039;20,000&#039;;&#039;40,000&#039;}) 
grid on 
set(ha, &#039;box&#039;, &#039;on&#039;) 
ht = text(&#039;Units&#039;, &#039;normalized&#039;, &#039;Position&#039;,[0.5, 
0.5],&#039;String&#039;,&#039;Trial&#039;, ... 
    &#039;FontUnits&#039;, &#039;normalized&#039; , &#039;FontSize&#039;, 0.35 , ... 
    &#039;HorizontalAlignment&#039;, &#039;center&#039;, ... 
    &#039;VerticalAlignment&#039;, &#039;middle&#039;,... 
    &#039;Color&#039;,[0.6 0.8 0.8]); 
hold on 
hp = scatter(vx(:),vy(:),50,c,&#039;filled&#039;);  % scatter plot 



I&#039;ve tried using uistack, but it doesn&#039;t work :(.  This is what I&#039;ve tried: 


uistack(ht,&#039;bottom&#039;) 
uistack(hp,&#039;top&#039;) 


Any help will be greatly appreciated!! 
Thank you very much!! 

Eric</description>
		<content:encoded><![CDATA[<p>Hi Loren,</p>
<p>Thank you so much for your blog.  I absolutely love it!<br />
I have a question regarding a scatter plot and I was wondering if you would be able to help me.  I&#8217;m trying to do a scatter plot with a text annotation on the background.  My question is how I can make the text appear bellow the bubbles, as opposed to on top of them?  Here&#8217;s my code.  (I&#8217;ve used random data for simplicity here)</p>
<p>vy = randi(80,[100,1]);  % random data<br />
vx = randi(50000, [100,1]);  % random data<br />
c = rand([length(vy),3]);  % random colors RGB<br />
figure(&#8216;Position&#8217;, [100 100 800 600], &#8216;Color&#8217;, &#8216;w&#8217;)<br />
axes(&#8216;Position&#8217;,[0.1 0.15 0.8 0.8],&#8217;XScale&#8217;,'log&#8217;, &#8216;Color&#8217;, &#8216;w&#8217;)<br />
axis([200 100000 20 85]);  % [xMin xMax yMin yMax]<br />
ha = gca;  % get current axes handle<br />
set(ha, &#8216;FontSize&#8217;, 14, &#8216;Color&#8217;, &#8216;w&#8217;,&#8230;<br />
    &#8216;XColor&#8217;, [0.5 0.5 0.5], &#8216;YColor&#8217;, [0.5 0.5 0.5])<br />
set(ha, &#8216;XTick&#8217;, xTick)<br />
set(ha,&#8217;XTickLabel&#8217;,{&#8217;400&#8242;;&#8217;1,000&#8242;;&#8217;2,000&#8242;;&#8217;4,000&#8242;;<br />
&#8217;10,000&#8242;;&#8217;20,000&#8242;;&#8217;40,000&#8242;})<br />
grid on<br />
set(ha, &#8216;box&#8217;, &#8216;on&#8217;)<br />
ht = text(&#8216;Units&#8217;, &#8216;normalized&#8217;, &#8216;Position&#8217;,[0.5,<br />
0.5],&#8217;String&#8217;,'Trial&#8217;, &#8230;<br />
    &#8216;FontUnits&#8217;, &#8216;normalized&#8217; , &#8216;FontSize&#8217;, 0.35 , &#8230;<br />
    &#8216;HorizontalAlignment&#8217;, &#8216;center&#8217;, &#8230;<br />
    &#8216;VerticalAlignment&#8217;, &#8216;middle&#8217;,&#8230;<br />
    &#8216;Color&#8217;,[0.6 0.8 0.8]);<br />
hold on<br />
hp = scatter(vx(:),vy(:),50,c,&#8217;filled&#8217;);  % scatter plot </p>
<p>I&#8217;ve tried using uistack, but it doesn&#8217;t work :(.  This is what I&#8217;ve tried: </p>
<p>uistack(ht,&#8217;bottom&#8217;)<br />
uistack(hp,&#8217;top&#8217;) </p>
<p>Any help will be greatly appreciated!!<br />
Thank you very much!! </p>
<p>Eric</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2007/12/19/plotting-with-style/#comment-32472</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Thu, 01 Sep 2011 17:18:56 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2007/12/19/plotting-with-style/#comment-32472</guid>
		<description>Kaustubh-

I belive so - I saw this statement in the documentation for axes (http://www.mathworks.com/help/techdoc/ref/axes_props.html):

&quot;multiple-line plots. For example:

set(gca,&#039;LineStyleOrder&#039;, &#039;-*&#124;:&#124;o&#039;)

sets LineStyleOrder to solid line with asterisk marker, dotted line, and hollow circle marker. The default is (-), which specifies a solid line for all data plotted. Alternatively, you can create a cell array of character strings to define the line styles:

set(gca,&#039;LineStyleOrder&#039;,{&#039;-*&#039;,&#039;:&#039;,&#039;o&#039;})

MATLAB supports four line styles, which you can specify any number of times in any order. MATLAB cycles through the line styles only after using all colors defined by the ColorOrder property. For example, the first eight lines plotted use the different colors defined by ColorOrder with the first line style. MATLAB then cycles through the colors again, using the second line style specified, and so on.&quot;

I tried setting linestyleorder with only marker string values and it worked for me.

--Loren</description>
		<content:encoded><![CDATA[<p>Kaustubh-</p>
<p>I belive so &#8211; I saw this statement in the documentation for axes (<a href="http://www.mathworks.com/help/techdoc/ref/axes_props.html" rel="nofollow">http://www.mathworks.com/help/techdoc/ref/axes_props.html</a>):</p>
<p>&#8220;multiple-line plots. For example:</p>
<p>set(gca,&#8217;LineStyleOrder&#8217;, &#8216;-*|:|o&#8217;)</p>
<p>sets LineStyleOrder to solid line with asterisk marker, dotted line, and hollow circle marker. The default is (-), which specifies a solid line for all data plotted. Alternatively, you can create a cell array of character strings to define the line styles:</p>
<p>set(gca,&#8217;LineStyleOrder&#8217;,{&#8216;-*&#8217;,':&#8217;,'o&#8217;})</p>
<p>MATLAB supports four line styles, which you can specify any number of times in any order. MATLAB cycles through the line styles only after using all colors defined by the ColorOrder property. For example, the first eight lines plotted use the different colors defined by ColorOrder with the first line style. MATLAB then cycles through the colors again, using the second line style specified, and so on.&#8221;</p>
<p>I tried setting linestyleorder with only marker string values and it worked for me.</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kaustubh</title>
		<link>http://blogs.mathworks.com/loren/2007/12/19/plotting-with-style/#comment-32471</link>
		<dc:creator>Kaustubh</dc:creator>
		<pubDate>Thu, 01 Sep 2011 16:54:15 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2007/12/19/plotting-with-style/#comment-32471</guid>
		<description>is it possible to cycle through markers just like DefaultAxesLineStyleOrder ?</description>
		<content:encoded><![CDATA[<p>is it possible to cycle through markers just like DefaultAxesLineStyleOrder ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Atcold</title>
		<link>http://blogs.mathworks.com/loren/2007/12/19/plotting-with-style/#comment-32404</link>
		<dc:creator>Atcold</dc:creator>
		<pubDate>Sun, 31 Jul 2011 15:52:15 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2007/12/19/plotting-with-style/#comment-32404</guid>
		<description>Ok, I made the following script:

&lt;pre&gt;
%Plot settings
h = get(gca,&#039;Children&#039;);

prop( 1) = {&#039;Marker&#039;};
val(1,1) = {&#039;o&#039;};
val(2,1) = {&#039;^&#039;};
val(3,1) = {&#039;s&#039;};
val(4,1) = {&#039;v&#039;};

prop( 2) = {&#039;LineWidth&#039;};
val(1,2) = {1.5};
val(2,2) = {1.5};
val(3,2) = {1.5};
val(4,2) = {1.5};

set(h,prop,val)

%Title settings
a = axis;
set(get(gca,&#039;Title&#039;),&#039;Position&#039;,[(a(2)-a(1))/2 (a(4)-a(3))*.99])
set(get(gca,&#039;Title&#039;),&#039;VerticalAlignment&#039;,&#039;Top&#039;)
&lt;/pre&gt;
 
My problem is now related with the position of the tile. It is almost attached to the upper line of the graph &#039;box&#039;. How can I insert, say, a space of 5px?

Many thanks indeed!</description>
		<content:encoded><![CDATA[<p>Ok, I made the following script:</p>
<pre>
%Plot settings
h = get(gca,'Children');

prop( 1) = {'Marker'};
val(1,1) = {'o'};
val(2,1) = {'^'};
val(3,1) = {'s'};
val(4,1) = {'v'};

prop( 2) = {'LineWidth'};
val(1,2) = {1.5};
val(2,2) = {1.5};
val(3,2) = {1.5};
val(4,2) = {1.5};

set(h,prop,val)

%Title settings
a = axis;
set(get(gca,'Title'),'Position',[(a(2)-a(1))/2 (a(4)-a(3))*.99])
set(get(gca,'Title'),'VerticalAlignment','Top')
</pre>
<p> <br />
My problem is now related with the position of the tile. It is almost attached to the upper line of the graph &#8216;box&#8217;. How can I insert, say, a space of 5px?</p>
<p>Many thanks indeed!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Atcold</title>
		<link>http://blogs.mathworks.com/loren/2007/12/19/plotting-with-style/#comment-32402</link>
		<dc:creator>Atcold</dc:creator>
		<pubDate>Fri, 29 Jul 2011 19:17:31 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2007/12/19/plotting-with-style/#comment-32402</guid>
		<description>How can I use a combination of cycling color AND styles? Say:
&lt;pre&gt;
set(0,&#039;DefaultAxesColorOrder&#039;,[0 0 0],...
      &#039;DefaultAxesLineStyleOrder&#039;,&#039;-&#124;--&#124;:&#124;-.&#039;)
Z = peaks; plot(1:49,Z(4:7,:))
&lt;/pre&gt;
 
with:
&lt;pre&gt;
set(0,&#039;DefaultAxesColorOrder&#039;,[1 0 0; 1 1 0; 0 1 0; 0 1 1],...
      &#039;DefaultAxesLineStyleOrder&#039;,&#039;-&#124;--&#124;:&#124;-.&#039;)
Z = peaks; plot(1:49,Z(4:7,:))
&lt;/pre&gt;
 
So in my article, whatever it will be printed (B&amp;W or color), it would be possible to differentiate the different plot!
Many thanks indeed!</description>
		<content:encoded><![CDATA[<p>How can I use a combination of cycling color AND styles? Say:</p>
<pre>
set(0,'DefaultAxesColorOrder',[0 0 0],...
      'DefaultAxesLineStyleOrder','-|--|:|-.')
Z = peaks; plot(1:49,Z(4:7,:))
</pre>
<p> <br />
with:</p>
<pre>
set(0,'DefaultAxesColorOrder',[1 0 0; 1 1 0; 0 1 0; 0 1 1],...
      'DefaultAxesLineStyleOrder','-|--|:|-.')
Z = peaks; plot(1:49,Z(4:7,:))
</pre>
<p> <br />
So in my article, whatever it will be printed (B&amp;W or color), it would be possible to differentiate the different plot!<br />
Many thanks indeed!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2007/12/19/plotting-with-style/#comment-31818</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Wed, 03 Nov 2010 15:15:55 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2007/12/19/plotting-with-style/#comment-31818</guid>
		<description>Ruello-

Thanks for solving the mystery and for filing the bug report.

--loren</description>
		<content:encoded><![CDATA[<p>Ruello-</p>
<p>Thanks for solving the mystery and for filing the bug report.</p>
<p>&#8211;loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ruello</title>
		<link>http://blogs.mathworks.com/loren/2007/12/19/plotting-with-style/#comment-31817</link>
		<dc:creator>Ruello</dc:creator>
		<pubDate>Wed, 03 Nov 2010 15:14:45 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2007/12/19/plotting-with-style/#comment-31817</guid>
		<description>Thanks Loren,
I&#039;ll file a bug report.

PS: I did find why &quot;yesterday&quot; it used to work... obviouly using a different version of the same function that treated the &#039;none&#039; differently (if &#039;none&#039;, no plot!)
regards,
Ruello</description>
		<content:encoded><![CDATA[<p>Thanks Loren,<br />
I&#8217;ll file a bug report.</p>
<p>PS: I did find why &#8220;yesterday&#8221; it used to work&#8230; obviouly using a different version of the same function that treated the &#8216;none&#8217; differently (if &#8216;none&#8217;, no plot!)<br />
regards,<br />
Ruello</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2007/12/19/plotting-with-style/#comment-31815</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Wed, 03 Nov 2010 14:08:37 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2007/12/19/plotting-with-style/#comment-31815</guid>
		<description>Ruello-

I guess so - never knew that.  You should contact support and file a bug report. 

--loren</description>
		<content:encoded><![CDATA[<p>Ruello-</p>
<p>I guess so &#8211; never knew that.  You should contact support and file a bug report. </p>
<p>&#8211;loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ruello</title>
		<link>http://blogs.mathworks.com/loren/2007/12/19/plotting-with-style/#comment-31814</link>
		<dc:creator>Ruello</dc:creator>
		<pubDate>Wed, 03 Nov 2010 14:04:26 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2007/12/19/plotting-with-style/#comment-31814</guid>
		<description>Loren,
thanks a lot, but...
As you say &quot;you either need to supply an item as a linespec&quot;...
Isn&#039;t &#039;none&#039; an acceptable LineSpec?
 http://www.mathworks.com/help/techdoc/ref/linespec.html
 seems to indicate so...
In fact, why should you do
&lt;pre&gt;
plot(x,y,’linestyle’,&#039;none&#039;) 
&lt;/pre&gt;

While
&lt;pre&gt;
plot(x,y,&#039;-&#039;)
&lt;/pre&gt;

works fine???

Sorry if I insist, but I am trying to understand why my code seemed to work fine yesterday with plot(x,y,&#039;none&#039;) and today it decided to stop... I know there must have been something else, but I could not find it...</description>
		<content:encoded><![CDATA[<p>Loren,<br />
thanks a lot, but&#8230;<br />
As you say &#8220;you either need to supply an item as a linespec&#8221;&#8230;<br />
Isn&#8217;t &#8216;none&#8217; an acceptable LineSpec?<br />
 <a href="http://www.mathworks.com/help/techdoc/ref/linespec.html" rel="nofollow">http://www.mathworks.com/help/techdoc/ref/linespec.html</a><br />
 seems to indicate so&#8230;<br />
In fact, why should you do</p>
<pre>
plot(x,y,’linestyle’,'none')
</pre>
<p>While</p>
<pre>
plot(x,y,'-')
</pre>
<p>works fine???</p>
<p>Sorry if I insist, but I am trying to understand why my code seemed to work fine yesterday with plot(x,y,&#8217;none&#8217;) and today it decided to stop&#8230; I know there must have been something else, but I could not find it&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2007/12/19/plotting-with-style/#comment-31813</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Wed, 03 Nov 2010 11:03:33 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2007/12/19/plotting-with-style/#comment-31813</guid>
		<description>Hi Ruello-

The acceptable inputs for plot and set differ.  See the doc for plot: http://www.mathworks.com/help/techdoc/ref/plot.html

and you will see you either need to supply an item as a linespec: http://www.mathworks.com/help/techdoc/ref/linespec.html

or use parameter/value pairs as in the set function.

So plot(x,y,&#039;linestyle&#039;,&#039;none&#039;) would be the way to go via plot.

--Loren</description>
		<content:encoded><![CDATA[<p>Hi Ruello-</p>
<p>The acceptable inputs for plot and set differ.  See the doc for plot: <a href="http://www.mathworks.com/help/techdoc/ref/plot.html" rel="nofollow">http://www.mathworks.com/help/techdoc/ref/plot.html</a></p>
<p>and you will see you either need to supply an item as a linespec: <a href="http://www.mathworks.com/help/techdoc/ref/linespec.html" rel="nofollow">http://www.mathworks.com/help/techdoc/ref/linespec.html</a></p>
<p>or use parameter/value pairs as in the set function.</p>
<p>So plot(x,y,&#8217;linestyle&#8217;,'none&#8217;) would be the way to go via plot.</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
</channel>
</rss>

