Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Getting the plotted data from a graph
Replies: 1   Last Post: Jun 16, 2013 5:11 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
psycho_dad

Posts: 64
Registered: 4/28/07
Re: Getting the plotted data from a graph
Posted: Jun 16, 2013 5:11 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.