Question: extracting data FROM a plot structure

Hello:

I would like to be able to extract data from a plot strucutre. So say I've done:

p:=plot([sin(x), cos(x)],x=0..1, legend=["sin","cos"]):

display(p);

now I can see the raw strucuture with

lprint(p):

but not quite sure how to extract two lists of tuples that contain the data. I would also like to extract the two items in the legend.

Does anyone know how to do that??

thanks.

Please Wait...