I would like to insert Tikz/Pgfplots figures stored in external files into my LyX document. The figures should be inside a figure float and an instant preview of the Pgfplots figure should be displayed in LyX. Ideally, I'm able to open the Pgfplots file in an external editor, edit and save it, and see the updated preview in Lyx. I have partly achieved the above, but never fully. Here is what I've tried:
- Insert the Pgfplots file via "Insert/File/Child Document...", choose Include Type "Input" and check the "Show preview" box. This works outside the float environment but inside a float, no preview is created.
- Insert the Pgfplots file via "Insert/File/Child Document..." into a preview box which in turn is inside a figure float. This renders the preview but the preview is never updated unless I close the document and open it again.