If you are having an issue getting your spikeplot to load in a PDF when you use MarkDoc, try exporting as a docx or an html instead.
markdoc biostat212_assignment2_name, replace export(docx)
markdoc biostat212_assignment2_name, replace export(html)
I'm trying to troubleshoot this issue now on the Statalist forum.