Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

Re: ListPlot w/ Dynamic[] choice of external data files

  • To: mathgroup at smc.vnet.net
  • Subject: [mg93709] Re: ListPlot w/ Dynamic[] choice of external data files
  • From: Albert Retey <awnl at gmx-topmail.de>
  • Date: Sat, 22 Nov 2008 06:14:15 -0500 (EST)
  • References: <gg62q3$57f$1@smc.vnet.net>

Hi,

why don't you start with the example in the documentation for
FileNameSetter:

{FileNameSetter[Dynamic[f]], Dynamic[f]}

you can now do with the filename f whatever you want within the second
dynamic, e.g.:

{
FileNameSetter[Dynamic[f]],
Dynamic[ListPlot[{Flatten[Import[f, "Table"]], baseline}]]
}

For production code you might want to make that more cute (Panel and
Column), save (DynamicModule) and comfortable (initialize the filename
to something useful):

DynamicModule[{fname = ToFileName[{$HomeDirectory, "Desktop"}]},
 Panel[Column[{
    FileNameSetter[Dynamic[fname]],
    Dynamic[ListPlot[Flatten[Import[fname, "Table"]]]]
    }]]
 ]

hth,

albert


  • Prev by Date: Re: Displaying the solution step by step in Wolfram Mathematica
  • Next by Date: Re: Mathematica 7 is now available
  • Previous by thread: Re: ListPlot w/ Dynamic[] choice of external data files
  • Next by thread: Re: ListPlot w/ Dynamic[] choice of external data files