MathGroup Archive 2009

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

Search the Archive

Re: mimic InterpolatingFunction et. al. formatting

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

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}]]


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}]]



  • 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