barChartDigitizer[g_Image] :=
DynamicModule[{min = {0, 0}, max = {0, 0}, xmin = -1., xmax = 1.,
pt = {0, 0}, data = {}, img = ImageDimensions[g], output},
Deploy@Column[{
Row[{
Column[{Button["Y Axis Min", min = pt],
InputField[Dynamic[xmin], Number, ImageSize -> 70]}],
Column[{Button["Y Axis Max", max = pt],
InputField[Dynamic[xmax], Number, ImageSize -> 70]}],
Column[{Button["Add point", AppendTo[data, pt]],
Button["Remove Last", data = Quiet@Check[Most@data, {}]]}],
Column[{Button["Start Over", data = {}],
Button["Print Output",
Print@Column[{BarChart[
output =
Rescale[#, {Last@min, Last@max}, {xmin, xmax}] & /@
data[[All, 2]],
PlotRange -> {Automatic, {xmin, xmax}},
ImageSize -> 400], output}],
Enabled -> Dynamic[data =!= {}]]}]
}],
Row[{
Graphics[{Inset[
Image[g, ImageSize -> img]], {Tooltip[Locator[Dynamic[pt]],
Dynamic[pt]]}},
ImageSize -> img, PlotRange -> 1,
AspectRatio -> img[[2]]/img[[1]]]}]
}]
]
A full description will a worked example can be found here:
http://www.wildebeests.net/2010/02/21/digitizing-plots-with-mathematica/
Kcvin