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