KristofferC / PGFPlotsX.jl

Plots in Julia using the PGFPlots LaTeX package
Other
301 stars 40 forks source link

`copy` does not work with type TikzDocument #320

Open rs7q5 opened 1 year ago

rs7q5 commented 1 year ago

For some reason copy does not work with type TikzDocument, but does for something like TikzPicture and AxisLike objects. I think it is because the other axis elements are of OptionType. But was wondering if we could add a method so TikzDocument could be copied.

Edit: doing Base(td::TikzDocument) = deepcopy(td) seems to work. Let me know if this would be acceptable and I can cut a PR.

tpapp commented 1 year ago

yes, I think a PR with dispatching to deepcopy would be fine.

I am curious, what's the use case?

rs7q5 commented 1 year ago

Awesome thanks! I'll put one in.

I was using produce_or_load from DrWatson to save multiple figures in one pdf, hence the use of tikzDocument.