I got this from examples, and it works, but I can not understand it

first the initial data

f1[x_] := 4 x^3 + 0.1 x^2 - 7 x - 1
pss = Plot[f1[x], {x, -1.3, 1.53}]


mx = Max[Last /@ Level[Cases[pss, _Line, Infinity], {-2}]]


mn = Min[Last /@ Level[Cases[pss, _Line, Infinity], {-2}]]

both work but I do not understand this _Line ??


This goes back to the basic structure of expressions in WL. Every expression has a Head, even the built-in operators, like List:


For a pattern,


this will match expressions with Head h. So, in

Cases[pss, _Line, Infinity]

_Line matches Line[...]. Note: it won't match the bare symbol, e.g.

MatchQ[Line, _Line]
(* False *)


(* Symbol *)
  • $\begingroup$ Now I saw, after doing FullForm that the only part of huge basic commands is the one preceded by Line, before I did not undertand how complex a simple Plot can be. Thanks for help @rcollyer $\endgroup$ – Anxon Pués Aug 15 '18 at 19:29
  • 1
    $\begingroup$ @AnxonPués I don't recommend viewing Plot using FullForm it's liable to drive you mad. :) InputForm is bad enough. A difficulty is that the FullForm is how an expression is interpreted, but due to wanting "nice" markup, the details are often hidden. Try a/b, for instance. :) $\endgroup$ – rcollyer Aug 15 '18 at 20:03
  • 1
    $\begingroup$ @AnxonPués You may want to try shortInputForm. $\endgroup$ – xzczd Aug 16 '18 at 7:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.