Message Boards Message Boards

0
|
1475 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

[?] What does the contents ("Line[a_] -> a, Infinity" ) mean?

Posted 5 years ago

Consider the following code:

Export["KLBfitting.xls",
 First@
  Cases[
   Normal@
    ContourPlot[
     f[x, y, 1.9764765267048838`, 120.23180449441806`] == 0, {x, 0, 
      2}, {y, 0, 30}], Line[a_] -> a, Infinity]]

What does the contents("Line[a_] -> a, Infinity" ) mean?
What does the contents("First@ Cases[ Normal@" ) intents to do?
I'm a beginner, thank you very much if you can reply!

POSTED BY: link dream
2 Replies
Posted 5 years ago

thank you !

POSTED BY: link dream

This code extracts numerical data from the internal representation of a contour plot. It is hardly for beginners.

The Line[a_] -> a is a replacement rule that extracts the coordinates from any Line object that it may encounter. Infinity instructs Cases that it has to search al all levels. Normal is meant to convert a GraphicsComplex object inside the plot into a list of self-contained graphics primitives. First selects the first of the lines that were fond by Cases.

Pay attention to the nesting of functions when reading code.

POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract