<?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 legend title	</title>
	<atom:link href="https://undocumentedmatlab.com/articles/plot-legend-title/feed" rel="self" type="application/rss+xml" />
	<link>https://undocumentedmatlab.com/articles/plot-legend-title?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=plot-legend-title</link>
	<description>Professional Matlab consulting, development and training</description>
	<lastBuildDate>Sat, 24 Jun 2017 21:54:09 +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-legend-title#comment-409084</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Sat, 24 Jun 2017 21:54:09 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=5674#comment-409084</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/plot-legend-title#comment-409007&quot;&gt;EBH&lt;/a&gt;.

???]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/plot-legend-title#comment-409007">EBH</a>.</p>
<p>???</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: EBH		</title>
		<link>https://undocumentedmatlab.com/articles/plot-legend-title#comment-409007</link>

		<dc:creator><![CDATA[EBH]]></dc:creator>
		<pubDate>Fri, 23 Jun 2017 13:51:25 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=5674#comment-409007</guid>

					<description><![CDATA[You might want to see another issue with the new legend title that I solved here]]></description>
			<content:encoded><![CDATA[<p>You might want to see another issue with the new legend title that I solved here</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Eike Blechschmidt		</title>
		<link>https://undocumentedmatlab.com/articles/plot-legend-title#comment-408067</link>

		<dc:creator><![CDATA[Eike Blechschmidt]]></dc:creator>
		<pubDate>Tue, 06 Jun 2017 13:53:34 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=5674#comment-408067</guid>

					<description><![CDATA[In Matlab 2016a it works if you use:
&lt;pre lang=&quot;matlab&quot;&gt;hLegend = legend();
hLegend.Title.String = &#039;My Legend Title&#039;.
&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>In Matlab 2016a it works if you use:</p>
<pre lang="matlab">hLegend = legend();
hLegend.Title.String = 'My Legend Title'.
</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Tom Heine		</title>
		<link>https://undocumentedmatlab.com/articles/plot-legend-title#comment-371376</link>

		<dc:creator><![CDATA[Tom Heine]]></dc:creator>
		<pubDate>Tue, 08 Mar 2016 22:01:33 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=5674#comment-371376</guid>

					<description><![CDATA[I have found one downside to the Martin&#039;s approach.  For some reason, when I save the figure as a .fig, the legend title isn&#039;t saved.]]></description>
			<content:encoded><![CDATA[<p>I have found one downside to the Martin&#8217;s approach.  For some reason, when I save the figure as a .fig, the legend title isn&#8217;t saved.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Martin		</title>
		<link>https://undocumentedmatlab.com/articles/plot-legend-title#comment-347755</link>

		<dc:creator><![CDATA[Martin]]></dc:creator>
		<pubDate>Thu, 09 Apr 2015 06:29:48 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=5674#comment-347755</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/plot-legend-title#comment-347413&quot;&gt;Martin&lt;/a&gt;.

@Yair – Yes, I&#039;d say this is related. Obviously, there is internal support for data types for both properties and function/method arguments. But only the former got the (undocumented) @-syntax in the MATLAB language, as described by your linked post. The latter seems to be reserved to built-in functions and methods of built-in classes, that are implemented in C++ and are thus not restricted by what is exposed to the MATLAB language. (I also tried and failed to find a syntax that would work for arguments.)

I wonder why MathWorks decided to expose only “half” of this data type feature to MATLAB programmers. And I wonder why they added “full” support for querying this information directly from MATLAB in R2015a. (Not that I&#039;m complaining, it provides interesting insights.)

Finally, I wonder what those data types really are. (I think we had something similar in the UDD class system.) They are not real classes, as can be seen in many instances in HG2. But classes can be used as data types. Will data types be fully exposed to the MATLAB language? Will we be able to create and use custom data types in the future?]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/plot-legend-title#comment-347413">Martin</a>.</p>
<p>@Yair – Yes, I&#8217;d say this is related. Obviously, there is internal support for data types for both properties and function/method arguments. But only the former got the (undocumented) @-syntax in the MATLAB language, as described by your linked post. The latter seems to be reserved to built-in functions and methods of built-in classes, that are implemented in C++ and are thus not restricted by what is exposed to the MATLAB language. (I also tried and failed to find a syntax that would work for arguments.)</p>
<p>I wonder why MathWorks decided to expose only “half” of this data type feature to MATLAB programmers. And I wonder why they added “full” support for querying this information directly from MATLAB in R2015a. (Not that I&#8217;m complaining, it provides interesting insights.)</p>
<p>Finally, I wonder what those data types really are. (I think we had something similar in the UDD class system.) They are not real classes, as can be seen in many instances in HG2. But classes can be used as data types. Will data types be fully exposed to the MATLAB language? Will we be able to create and use custom data types in the future?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/plot-legend-title#comment-347736</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Wed, 08 Apr 2015 20:15:10 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=5674#comment-347736</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/plot-legend-title#comment-347508&quot;&gt;Martin&lt;/a&gt;.

@Martin - thanks, interesting. I have a hunch that this is related to the undocumented mechanism of &lt;a href=&quot;http://undocumentedmatlab.com/blog/setting-class-property-types&quot; rel=&quot;nofollow&quot;&gt;setting class-property types&lt;/a&gt; using the so-called &quot;@-filter&quot;:

&lt;pre lang=&#039;matlab&#039;&gt;
properties
    Name@char = &#039;abc&#039;
    Width@double = 10
end
&lt;/pre&gt;

Unfortunately, I tried this @-filter on method input/output args and it croacks. So either it&#039;s not implemented yet, or MathWorks may have changed the syntax, or maybe I&#039;m just misreading the situation...]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/plot-legend-title#comment-347508">Martin</a>.</p>
<p>@Martin &#8211; thanks, interesting. I have a hunch that this is related to the undocumented mechanism of <a href="http://undocumentedmatlab.com/blog/setting-class-property-types" rel="nofollow">setting class-property types</a> using the so-called &#8220;@-filter&#8221;:</p>
<pre lang='matlab'>
properties
    Name@char = 'abc'
    Width@double = 10
end
</pre>
<p>Unfortunately, I tried this @-filter on method input/output args and it croacks. So either it&#8217;s not implemented yet, or MathWorks may have changed the syntax, or maybe I&#8217;m just misreading the situation&#8230;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Martin		</title>
		<link>https://undocumentedmatlab.com/articles/plot-legend-title#comment-347508</link>

		<dc:creator><![CDATA[Martin]]></dc:creator>
		<pubDate>Fri, 03 Apr 2015 15:36:00 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=5674#comment-347508</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/plot-legend-title#comment-347413&quot;&gt;Martin&lt;/a&gt;.

@Yair – thanks for improving my comment and fixing the minor error I included! I see you read those comments very carefully. :)

R2015a made it easier to to explore HG2 (and the many undocumented properties/methods of the related classes) by adding the new (and hidden) &lt;em&gt;Type&lt;/em&gt; property to the &lt;em&gt;meta.property&lt;/em&gt; class and the &lt;em&gt;InputTypes&lt;/em&gt; and &lt;em&gt;OutputTypes&lt;/em&gt; properties to the the &lt;em&gt;meta.method&lt;/em&gt; class. For example:
&lt;pre lang=&quot;matlab&quot;&gt;
mc = ?matlab.graphics.axis.Axes;
mc.PropertyList(1).Name % Camera
mc.PropertyList(1).Type % matlab.graphics.axis.camera.Camera
mc.MethodList(49).Name % addlistener
mc.MethodList(49).InputNames % [sources, propertyname, eventname, callback]
mc.MethodList(49).InputTypes % [handle, asciiString, char vector, function_handle scalar]
&lt;/pre&gt;

Knowing the type of a property can be especially helpful to find out what can be assigned to it. Sometimes one even gets a list of valid values (e.g. the &lt;em&gt;CameraMode&lt;/em&gt; property of the above &lt;em&gt;Axes&lt;/em&gt; class).]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/plot-legend-title#comment-347413">Martin</a>.</p>
<p>@Yair – thanks for improving my comment and fixing the minor error I included! I see you read those comments very carefully. 🙂</p>
<p>R2015a made it easier to to explore HG2 (and the many undocumented properties/methods of the related classes) by adding the new (and hidden) <em>Type</em> property to the <em>meta.property</em> class and the <em>InputTypes</em> and <em>OutputTypes</em> properties to the the <em>meta.method</em> class. For example:</p>
<pre lang="matlab">
mc = ?matlab.graphics.axis.Axes;
mc.PropertyList(1).Name % Camera
mc.PropertyList(1).Type % matlab.graphics.axis.camera.Camera
mc.MethodList(49).Name % addlistener
mc.MethodList(49).InputNames % [sources, propertyname, eventname, callback]
mc.MethodList(49).InputTypes % [handle, asciiString, char vector, function_handle scalar]
</pre>
<p>Knowing the type of a property can be especially helpful to find out what can be assigned to it. Sometimes one even gets a list of valid values (e.g. the <em>CameraMode</em> property of the above <em>Axes</em> class).</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Robert Cumming		</title>
		<link>https://undocumentedmatlab.com/articles/plot-legend-title#comment-347463</link>

		<dc:creator><![CDATA[Robert Cumming]]></dc:creator>
		<pubDate>Thu, 02 Apr 2015 15:22:26 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=5674#comment-347463</guid>

					<description><![CDATA[@Yair,

Interesting as always - Adding a legend title is one of the functions in my &lt;a href=&quot;https://sites.google.com/site/matpihome/matlab-gui-framework&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt; GUI Toolbox&lt;/a&gt; and I uploaded this particular code as a &lt;a href=&quot;http://uk.mathworks.com/matlabcentral/fileexchange/48331-add-a-title-to-a-legend&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt; FEX submission&lt;/a&gt; which covers HG1 &#038; HG2.

@Martin - Nice solution! :)]]></description>
			<content:encoded><![CDATA[<p>@Yair,</p>
<p>Interesting as always &#8211; Adding a legend title is one of the functions in my <a href="https://sites.google.com/site/matpihome/matlab-gui-framework" target="_blank" rel="nofollow"> GUI Toolbox</a> and I uploaded this particular code as a <a href="http://uk.mathworks.com/matlabcentral/fileexchange/48331-add-a-title-to-a-legend" target="_blank" rel="nofollow"> FEX submission</a> which covers HG1 &amp; HG2.</p>
<p>@Martin &#8211; Nice solution! 🙂</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/plot-legend-title#comment-347415</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Wed, 01 Apr 2015 23:42:58 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=5674#comment-347415</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/plot-legend-title#comment-347413&quot;&gt;Martin&lt;/a&gt;.

@Martin - thanks! this is indeed more elegant. I tried setting a text object&#039;s Parent directly to the legend and received an error (&quot;Text cannot be a child of Legend&quot;); I then tried to set the DecorationContainer&#039;s title property and got another error (since it&#039;s not an axes and has no such property); but I didn&#039;t think to simply try what you did, which is a variant of my failed attempts...

I guess it shows us that we should never give up hope, maybe just take a step back and rethink about the problem.

Thanks again!]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/plot-legend-title#comment-347413">Martin</a>.</p>
<p>@Martin &#8211; thanks! this is indeed more elegant. I tried setting a text object&#8217;s Parent directly to the legend and received an error (&#8220;Text cannot be a child of Legend&#8221;); I then tried to set the DecorationContainer&#8217;s title property and got another error (since it&#8217;s not an axes and has no such property); but I didn&#8217;t think to simply try what you did, which is a variant of my failed attempts&#8230;</p>
<p>I guess it shows us that we should never give up hope, maybe just take a step back and rethink about the problem.</p>
<p>Thanks again!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Martin		</title>
		<link>https://undocumentedmatlab.com/articles/plot-legend-title#comment-347413</link>

		<dc:creator><![CDATA[Martin]]></dc:creator>
		<pubDate>Wed, 01 Apr 2015 22:44:36 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=5674#comment-347413</guid>

					<description><![CDATA[I haven&#039;t really tested for any undesired side effects, but I have the feeling that this qualifies as a more elegant solution:
&lt;pre lang=&quot;matlab&quot;&gt;
hLegend = legend(...)
hlt = text(...
    &#039;Parent&#039;, hLegend.DecorationContainer, ...
    &#039;String&#039;, &#039;Title&#039;, ...
    &#039;HorizontalAlignment&#039;, &#039;center&#039;, ...
    &#039;VerticalAlignment&#039;, &#039;bottom&#039;, ...
    &#039;Position&#039;, [0.5, 1.05, 0], ...
    &#039;Units&#039;, &#039;normalized&#039;);
&lt;/pre&gt;

The title appears to stay attached to the legend and the &lt;em&gt;Parent&lt;/em&gt; property of the text object even reports the legend object as its parent:
&lt;pre lang=&quot;matlab&quot;&gt;
hLegend.Location = &#039;southwest&#039;;  % Test the title&#039;s attachment
hlt.Parent % Returns hLegend
&lt;/pre&gt;

I tested this with R2015a. The &lt;em&gt;DecorationContainer&lt;/em&gt; was simply the first in a rather long list of properties that sounded like it could be useful.]]></description>
			<content:encoded><![CDATA[<p>I haven&#8217;t really tested for any undesired side effects, but I have the feeling that this qualifies as a more elegant solution:</p>
<pre lang="matlab">
hLegend = legend(...)
hlt = text(...
    'Parent', hLegend.DecorationContainer, ...
    'String', 'Title', ...
    'HorizontalAlignment', 'center', ...
    'VerticalAlignment', 'bottom', ...
    'Position', [0.5, 1.05, 0], ...
    'Units', 'normalized');
</pre>
<p>The title appears to stay attached to the legend and the <em>Parent</em> property of the text object even reports the legend object as its parent:</p>
<pre lang="matlab">
hLegend.Location = 'southwest';  % Test the title's attachment
hlt.Parent % Returns hLegend
</pre>
<p>I tested this with R2015a. The <em>DecorationContainer</em> was simply the first in a rather long list of properties that sounded like it could be useful.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
