Re: Getting the plotted data from a graph
- To: mathgroup at smc.vnet.net
- Subject: [mg131187] Re: Getting the plotted data from a graph
- From: psycho_dad <s.nesseris at gmail.com>
- Date: Sun, 16 Jun 2013 05:18:15 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Delivered-to: l-mathgroup@wolfram.com
- Delivered-to: mathgroup-outx@smc.vnet.net
- Delivered-to: mathgroup-newsendx@smc.vnet.net
- References: <kph7uu$2f4$1@smc.vnet.net>
Hi Lily, That's simple after you realize that even a Plot is a list {{},{},...}. For example, in your case writing g1[[1]] will give you a list of all the elements in the plot. So, then the question is how do you retrieve the data from that mess? Simple! Do you see the Line[], which obviously makes the line in your plot? Just extract by specifying the appropriate levels, ie g1[[1, 1, 3, 2, 1]]. Then, you can plot the points with ListPlot[g1[[1, 1, 3, 2, 1]]] to make sure it is indeed what you want. Finally, after one realizes this, you can easily do some cool things, eg writing g1 /. Hue[x_, y_, z_] -> Red will change the color *after* you made the plot! So, if you have a plot that takes a long time to make, you can still make changes afterwards ;-) Cheers