<?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: Controlling plot data-tips	</title>
	<atom:link href="https://undocumentedmatlab.com/articles/controlling-plot-data-tips/feed" rel="self" type="application/rss+xml" />
	<link>https://undocumentedmatlab.com/articles/controlling-plot-data-tips?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=controlling-plot-data-tips</link>
	<description>Professional Matlab consulting, development and training</description>
	<lastBuildDate>Mon, 08 Jun 2020 06:41: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: Ajay Krishna		</title>
		<link>https://undocumentedmatlab.com/articles/controlling-plot-data-tips#comment-508712</link>

		<dc:creator><![CDATA[Ajay Krishna]]></dc:creator>
		<pubDate>Mon, 08 Jun 2020 06:41:59 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2432#comment-508712</guid>

					<description><![CDATA[Is it possible to add custom data tip for simulink blocks without using the description or Block Name or parameter names and values.To make my statement clear i want to add custom data tip without altering the blocks]]></description>
			<content:encoded><![CDATA[<p>Is it possible to add custom data tip for simulink blocks without using the description or Block Name or parameter names and values.To make my statement clear i want to add custom data tip without altering the blocks</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Leandro de Oliveira		</title>
		<link>https://undocumentedmatlab.com/articles/controlling-plot-data-tips#comment-501050</link>

		<dc:creator><![CDATA[Leandro de Oliveira]]></dc:creator>
		<pubDate>Tue, 01 Oct 2019 22:17:26 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2432#comment-501050</guid>

					<description><![CDATA[My contribuition to create new datatip
&lt;pre lang=&quot;matlab&quot;&gt;
clc
clear all
close all

x = 0:0.1:10;
y = sin(x);

h = figure(1);
hObj = plot(x,y);
index = [25 75 100];
hold on
for i = 1:3
    cursorMode = datacursormode(h);
    hDatatip = cursorMode.createDatatip(hObj);
    pos = [x(index(i)) y(index(i))];
    set(get(hDatatip,&#039;DataCursor&#039;), &#039;DataIndex&#039;,index(i), &#039;TargetPoint&#039;,pos);
    set(hDatatip, &#039;Position&#039;, pos);
    updateDataCursors(cursorMode);
end
hold off
&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>My contribuition to create new datatip</p>
<pre lang="matlab">
clc
clear all
close all

x = 0:0.1:10;
y = sin(x);

h = figure(1);
hObj = plot(x,y);
index = [25 75 100];
hold on
for i = 1:3
    cursorMode = datacursormode(h);
    hDatatip = cursorMode.createDatatip(hObj);
    pos = [x(index(i)) y(index(i))];
    set(get(hDatatip,'DataCursor'), 'DataIndex',index(i), 'TargetPoint',pos);
    set(hDatatip, 'Position', pos);
    updateDataCursors(cursorMode);
end
hold off
</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: CW		</title>
		<link>https://undocumentedmatlab.com/articles/controlling-plot-data-tips#comment-494226</link>

		<dc:creator><![CDATA[CW]]></dc:creator>
		<pubDate>Wed, 28 Aug 2019 18:04:58 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2432#comment-494226</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/controlling-plot-data-tips#comment-489712&quot;&gt;CW&lt;/a&gt;.

I was able to get the contour data accessible within myupdatefnc, however I noticed that eventData.Position returns the absolute x,y position, whereas my contour z data might have a certain step size between data points such that the absolute x,y position doesn&#039;t access the array correctly. Is there a way to do this without also pulling in my original x,y vectors, step size, etc and doing all the math myself? Doing the math and pulling the data in is fine...just wanted to avoid the extra bulk if possible.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/controlling-plot-data-tips#comment-489712">CW</a>.</p>
<p>I was able to get the contour data accessible within myupdatefnc, however I noticed that eventData.Position returns the absolute x,y position, whereas my contour z data might have a certain step size between data points such that the absolute x,y position doesn&#8217;t access the array correctly. Is there a way to do this without also pulling in my original x,y vectors, step size, etc and doing all the math myself? Doing the math and pulling the data in is fine&#8230;just wanted to avoid the extra bulk if possible.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/controlling-plot-data-tips#comment-489851</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Tue, 06 Aug 2019 08:50:16 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2432#comment-489851</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/controlling-plot-data-tips#comment-489724&quot;&gt;CW&lt;/a&gt;.

@Aselia/CW - In your &lt;i&gt;updateFcn(~,eventData)&lt;/i&gt; function, you can fetch the clicked position via &lt;code&gt;eventData.Position&lt;/code&gt; and based on this position you can compose your custom datatip text (which is returned as the output of &lt;i&gt;updateFcn&lt;/i&gt;). Simply find a way to get the contours data accessible in your &lt;i&gt;updateFcn&lt;/i&gt; (there are multiple ways to do this, all of them pretty standard/documented) and you&#039;re basically done.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/controlling-plot-data-tips#comment-489724">CW</a>.</p>
<p>@Aselia/CW &#8211; In your <i>updateFcn(~,eventData)</i> function, you can fetch the clicked position via <code>eventData.Position</code> and based on this position you can compose your custom datatip text (which is returned as the output of <i>updateFcn</i>). Simply find a way to get the contours data accessible in your <i>updateFcn</i> (there are multiple ways to do this, all of them pretty standard/documented) and you&#8217;re basically done.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: CW		</title>
		<link>https://undocumentedmatlab.com/articles/controlling-plot-data-tips#comment-489724</link>

		<dc:creator><![CDATA[CW]]></dc:creator>
		<pubDate>Mon, 05 Aug 2019 18:12:13 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2432#comment-489724</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/controlling-plot-data-tips#comment-489712&quot;&gt;CW&lt;/a&gt;.

Also to clarify, this is within a GUI, which allows users the ability to choose which of a set of, say, 10 types of data they want, as many as they want, to be plotted. So an automatic way of doing this, rather than passing in 3 specific data sets and pulling them out manually based on the current x,y would be helpful.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/controlling-plot-data-tips#comment-489712">CW</a>.</p>
<p>Also to clarify, this is within a GUI, which allows users the ability to choose which of a set of, say, 10 types of data they want, as many as they want, to be plotted. So an automatic way of doing this, rather than passing in 3 specific data sets and pulling them out manually based on the current x,y would be helpful.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: CW		</title>
		<link>https://undocumentedmatlab.com/articles/controlling-plot-data-tips#comment-489712</link>

		<dc:creator><![CDATA[CW]]></dc:creator>
		<pubDate>Mon, 05 Aug 2019 16:26:57 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2432#comment-489712</guid>

					<description><![CDATA[Hi. I have a contour plot with multiple data sets plotted on it, i.e...

&lt;pre lang=&quot;matlab&quot;&gt;
[cs1,h1] = contour(x1,y1,z1);
hold on;
[cs2,h2] = contour(x2,y2,z2);
[cs3,h3] = contour(x3,y3,z3);
&lt;/pre&gt; 

Generally with data cursor, I&#039;d have to click around in the plot to get the data cursor to show each of the z1, z2, z3 data separately, along with its legend entry, hoping I click on the exact contour I want.

I would like to see if there&#039;s a way to use myupdatefnc to show all 3 z data values at a particular x,y position in a single data cursor. Do you know if this is possible? Thank you!]]></description>
			<content:encoded><![CDATA[<p>Hi. I have a contour plot with multiple data sets plotted on it, i.e&#8230;</p>
<pre lang="matlab">
[cs1,h1] = contour(x1,y1,z1);
hold on;
[cs2,h2] = contour(x2,y2,z2);
[cs3,h3] = contour(x3,y3,z3);
</pre>
<p>Generally with data cursor, I&#8217;d have to click around in the plot to get the data cursor to show each of the z1, z2, z3 data separately, along with its legend entry, hoping I click on the exact contour I want.</p>
<p>I would like to see if there&#8217;s a way to use myupdatefnc to show all 3 z data values at a particular x,y position in a single data cursor. Do you know if this is possible? Thank you!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/controlling-plot-data-tips#comment-487965</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Sat, 27 Jul 2019 20:53:20 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2432#comment-487965</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/controlling-plot-data-tips#comment-487235&quot;&gt;Jacopo Remondina&lt;/a&gt;.

@Jacopo - in R2019a the property is called &lt;b&gt;PointDataCursors&lt;/b&gt;. Since it&#039;s a &lt;code&gt;private&lt;/code&gt; property of the &lt;code&gt;datacursoremode&lt;/code&gt;, you cannot access it directly. Instead, use &lt;code&gt;struct(dcm).PointDataCursors&lt;/code&gt;. I am not aware of a way to change the data-cursor defaults - perhaps there is a way, I just never bothered to look for one.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/controlling-plot-data-tips#comment-487235">Jacopo Remondina</a>.</p>
<p>@Jacopo &#8211; in R2019a the property is called <b>PointDataCursors</b>. Since it&#8217;s a <code>private</code> property of the <code>datacursoremode</code>, you cannot access it directly. Instead, use <code>struct(dcm).PointDataCursors</code>. I am not aware of a way to change the data-cursor defaults &#8211; perhaps there is a way, I just never bothered to look for one.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jacopo Remondina		</title>
		<link>https://undocumentedmatlab.com/articles/controlling-plot-data-tips#comment-487235</link>

		<dc:creator><![CDATA[Jacopo Remondina]]></dc:creator>
		<pubDate>Mon, 22 Jul 2019 14:41:59 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2432#comment-487235</guid>

					<description><![CDATA[Hi, I&#039;m working with MATLAB R2019a - update 4 (the latest one I think), and I would like to know if there are some updates on how these features work.
Actually some of the functionalities are still correct/working, like querying for the datacursormode (or manager) and set the update string function, but other (like querying for all the datacursor objects) seems broken. I also noticed that maybe the object itself is a bit different. Here are the outputs I&#039;ve got at the prompt:

&lt;pre lang=&quot;matlab&quot;&gt;
&gt;&gt; dcm=datacursormode(figHandle)
dcm = 
  DataCursorManager with properties:
        SnapToDataVertex: &#039;on&#039;
            DisplayStyle: &#039;datatip&#039;
    DefaultExportVarName: &#039;cursor_info&#039;
             Interpreter: &#039;tex&#039;
               UpdateFcn: @(varargin)obj.manageDatatips(varargin{:})
                  Enable: &#039;on&#039;
                  Figure: [1×1 Figure]

&gt;&gt; dcm.DataCursors
Unrecognized method, property, or field &#039;DataCursors&#039; for class &#039;matlab.graphics.shape.internal.DataCursorManager&#039;.
&lt;/pre&gt;

In particular, I would like to know if there is a way to change the default aspect of the markers for a given figure, since the workaround I&#039;ve found is to change each property (marker shape, size, edge color, face color,...), then force an update (with pause), then change another property and so on.
This method has however few drawbacks:
-first, the middle step settings flash on the screen (and without the pause command between them, they are not accepted);
-second the changes are only temporary and I should update them every time the markers are drawn again, including during the resize of the figure/axes

I tried to have a look with the getundoc function, but I couldn&#039;t really find anything useful.
Thanks,
Jacopo]]></description>
			<content:encoded><![CDATA[<p>Hi, I&#8217;m working with MATLAB R2019a &#8211; update 4 (the latest one I think), and I would like to know if there are some updates on how these features work.<br />
Actually some of the functionalities are still correct/working, like querying for the datacursormode (or manager) and set the update string function, but other (like querying for all the datacursor objects) seems broken. I also noticed that maybe the object itself is a bit different. Here are the outputs I&#8217;ve got at the prompt:</p>
<pre lang="matlab">
>> dcm=datacursormode(figHandle)
dcm = 
  DataCursorManager with properties:
        SnapToDataVertex: 'on'
            DisplayStyle: 'datatip'
    DefaultExportVarName: 'cursor_info'
             Interpreter: 'tex'
               UpdateFcn: @(varargin)obj.manageDatatips(varargin{:})
                  Enable: 'on'
                  Figure: [1×1 Figure]

>> dcm.DataCursors
Unrecognized method, property, or field 'DataCursors' for class 'matlab.graphics.shape.internal.DataCursorManager'.
</pre>
<p>In particular, I would like to know if there is a way to change the default aspect of the markers for a given figure, since the workaround I&#8217;ve found is to change each property (marker shape, size, edge color, face color,&#8230;), then force an update (with pause), then change another property and so on.<br />
This method has however few drawbacks:<br />
-first, the middle step settings flash on the screen (and without the pause command between them, they are not accepted);<br />
-second the changes are only temporary and I should update them every time the markers are drawn again, including during the resize of the figure/axes</p>
<p>I tried to have a look with the getundoc function, but I couldn&#8217;t really find anything useful.<br />
Thanks,<br />
Jacopo</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/controlling-plot-data-tips#comment-478466</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Tue, 21 May 2019 10:07:47 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2432#comment-478466</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/controlling-plot-data-tips#comment-477245&quot;&gt;Mike Papadopoulos&lt;/a&gt;.

@Mike - you can modify the tip background via the &lt;b&gt;TipHandle&lt;/b&gt; and/or &lt;b&gt;BackgroundAlpha&lt;/b&gt;:
&lt;pre lang=&quot;matlab&quot;&gt;
hDataTip.TipHandle.FaceColor = &#039;m&#039;;  % or: [1,0,1]
hDataTip.BackgroundAlpha = 0.65;
&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/controlling-plot-data-tips#comment-477245">Mike Papadopoulos</a>.</p>
<p>@Mike &#8211; you can modify the tip background via the <b>TipHandle</b> and/or <b>BackgroundAlpha</b>:</p>
<pre lang="matlab">
hDataTip.TipHandle.FaceColor = 'm';  % or: [1,0,1]
hDataTip.BackgroundAlpha = 0.65;
</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Mike Papadopoulos		</title>
		<link>https://undocumentedmatlab.com/articles/controlling-plot-data-tips#comment-477245</link>

		<dc:creator><![CDATA[Mike Papadopoulos]]></dc:creator>
		<pubDate>Wed, 08 May 2019 18:01:45 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2432#comment-477245</guid>

					<description><![CDATA[Using MATLAB 2018b, I have been able to change the EdgeColor and TextColor of the datatip, but the BackgroundColor will not update properly.  Specifically the BackgroundColor property of the datatip object changes to the correct RGB triplet but the actual Background color of the datatip does not change.  Any Thoughts?]]></description>
			<content:encoded><![CDATA[<p>Using MATLAB 2018b, I have been able to change the EdgeColor and TextColor of the datatip, but the BackgroundColor will not update properly.  Specifically the BackgroundColor property of the datatip object changes to the correct RGB triplet but the actual Background color of the datatip does not change.  Any Thoughts?</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
