Re: Extracting contour values from ContourPlot

*To*: mathgroup at smc.vnet.net*Subject*: [mg100808] Re: Extracting contour values from ContourPlot*From*: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>*Date*: Sun, 14 Jun 2009 21:19:33 -0400 (EDT)*References*: <h12gg4$ect$1@smc.vnet.net>

Hi, plt = ContourPlot[Cos[x*y], {x, -Pi, Pi}, {y, -Pi, Pi}]; and Cases[plt, _Tooltip, Infinity] /. Tooltip[_, lbl_] :> lbl ? Regards Jens dg wrote: > I have spent an hour researching this group and online, with no > definitive answer. > > The problem: I have an nxm matrix of z values that I want to plot with > List(Contour|Density)Plot together with a legend that shows the > *actual* values of the contours used in the plot. (Seems like a pretty > basic thing to me....). I know how to draw a nice legend, that's not > the problem. > > I have found a way to do it: I can specify the contours and plot range > explicitly. But what I really want is not to have to do this, and rely > on the semi-intelligent mechanism of Mathematica to pick an appropriate number > of contours and their values, THEN use those to draw the legend. > > It seems that there is no way to do this. That is, there is no way to > extract the actual contour values used in the plot. I found a > ColorBarPlot package which however does not work in Mathematica 7: > <http://library.wolfram.com/infocenter/MathSource/7030/> > > Is it really not possible to do > this? >

**Follow-Ups**:**Re: Re: Extracting contour values from ContourPlot***From:*Syd Geraghty <sydgeraghty@me.com>

**Re: Re: Re: Extracting contour values from***From:*Syd Geraghty <sydgeraghty@me.com>

**Re: Extracting contour values from ContourPlot***From:*ADL <alberto.dilullo@tiscali.it>

**Re: Re: Extracting contour values from ContourPlot***From:*Syd Geraghty <sydgeraghty@me.com>