MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: mimic InterpolatingFunction et. al. formatting

  • To: mathgroup at smc.vnet.net
  • Subject: [mg102099] Re: mimic InterpolatingFunction et. al. formatting
  • From: Albert Retey <awnl at gmx-topmail.de>
  • Date: Wed, 29 Jul 2009 05:11:24 -0400 (EDT)
  • References: <h4m4af$ea9$1@smc.vnet.net>

Josh Bukart wrote:
> Hello,
> 
> When one uses Interpolation[], one gets in return an InterpolatingFunction object which typically formats in the front end as something like
> 
> InterpolatingFunction[{{0.,1.}},<>]
> 
> How does it achieve the "<>" standing for all the massive amounts of internal data? I'd like to do something similar for a data structure type thing I'm coding, and would like it to display automatically as EigenfunctionData[whatever i want regardless of what's actually inside].
> 
> Any help would be appreciated!
> 
> Thanks,
> Josh Burkart

you can define how expressions are to be formatted with Format, a very
simple example is as follows:

Format[container[anything___]] := "container[<>]"

data = container[RandomReal[{0, 1}, {1000}]]

Length[data[[1]]]

of course you can do more than that, since version 6 you can even
combine graphics and formulas, e.g.:

Format[bigmatrix[m_List]] :=
 MatrixPlot[m, ImageSize -> 60, Frame -> False]

bigmatrix[RandomReal[{0, 10}, {100, 100}]] +
 bigmatrix[RandomReal[{0, 10}, {100, 100}]]

hth,

albert


  • Prev by Date: Re: ReplacePart except first element?
  • Next by Date: Re: Re: Forcing vertical scale on Histogram
  • Previous by thread: mimic InterpolatingFunction et. al. formatting
  • Next by thread: Re: mimic InterpolatingFunction et. al. formatting