# I don't understand the Epilog function

I had the same question as How to add a vertical line to a plot and I have read the first answer using the Epilog function.

This answer solved my problem and my code is now working.

However, I don't understand why Epilog is needed by mathematica in the code. It is written in the documentation : "Epilog is an option for graphics functions that gives a list of graphics primitives to be rendered after the main part of the graphics is rendered.".

Indeed the code doesn't work without Epilog, it means if we directly put Line in the plot command. But why does Epilog solve this problem ? Why the fact to render the line after the rest of the graphic is rendered would make the thing work.

I don't understand this.

The normal environment for a Line instruction to live in would be the Graphics function environment.
Line is just one example of the many drawing instruction that Graphics knows.
The Plot function itself is not a Graphics environment and knows nothing about drawing functions. The result of a Plot statement, however, is a Graphics function with all drawing instructions included to create the desired plot.
The effect of the Epilog option is to pass the drawing instructions in its argument to this Graphics environment created by Plot. As the name suggests, this is done after the plot drawing instructions. There is a similar option called Prolog which also insert drawing instructions. However, this option inserts its argument before the plot drawing instruction.
• Personally I have always been unconfortable with the term after and before in a context that has nothing to do with time, though that seems to be a established habit. Here the term after means that the graphics from the Epilog hides the other ones. (This is only a Note, Don't change your answer for this) – andre314 Aug 4 '18 at 16:32