Re: How to add a Locator (Tooltip) to RootLocusPlot?
- To: mathgroup at smc.vnet.net
- Subject: [mg128625] Re: How to add a Locator (Tooltip) to RootLocusPlot?
- From: "Nasser M. Abbasi" <nma at 12000.org>
- Date: Sun, 11 Nov 2012 01:26:27 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Delivered-to: l-mathgroup@wolfram.com
- Delivered-to: mathgroup-newout@smc.vnet.net
- Delivered-to: mathgroup-newsend@smc.vnet.net
- References: <k7kuku$2aj$1@smc.vnet.net>
- Reply-to: nma at 12000.org
On 11/10/2012 1:10 AM, Eduardo Mendes wrote: > Hello > > I wonder whether someone out there would know how to add a Locator or > Tooltip or something else that allows me to see the values of the > parameter k (See command below) when the mouse passes over the resulting > curves? Unfortunately I have no idea on how to do it. > > > RootLocusPlot[k (s^2+2 s+4)/(s(s+4)(s+6)(s^2+1.4s+1)),{k,0,150}] > > Many thanks > > Ed > This should really be part of RootLocusPlot. May be in version 9? In another system I use, starts with 'M' and ends with 'B', I did the same plot as above, and the plot generated automatically has this tooltip build-in, and much more information (Gain (k), pole, damping, overshoot, frequency) about the system. I typed -------------------- s=tf('s'); sys=(s^2+2*s+4)/(s*(s+4)*(s+6)*(s^2+1.4*s+1)); rlocusplot(sys) ----------- And now using the mouse, I point it to the plot and can read all that information. Here is a screen shot: http://12000.org/tmp/nov_11_2012/tooltip.png You could get hold of the (x,y) coordinates of the plot easy enough, but that does not answer your question ofcourse. To get the coordinates as tooltip, do ------------------------------- RootLocusPlot[ k (s^2 + 2 s + 4)/(s (s + 4) (s + 6) (s^2 + 1.4 s + 1)), {k, 0, 150}, CoordinatesToolOptions -> {"DisplayFunction" -> Function[pt, pt]}] ------------------------------------------- and now click on the plot, then click '.' and now when you move the mouse, you'll get the (x,y) coordinates. --Nasser