2015-01-09 08:58:42 +01:00
|
|
|
using PyPlot
|
2015-01-07 09:26:11 +01:00
|
|
|
|
2016-04-12 16:08:29 +02:00
|
|
|
function savefigs_pyplot(report::Report)
|
|
|
|
chunk = report.cur_chunk
|
2016-04-11 17:40:18 +02:00
|
|
|
fignames = AbstractString[]
|
2015-01-07 09:26:11 +01:00
|
|
|
ext = report.formatdict[:fig_ext]
|
|
|
|
figpath = joinpath(report.cwd, chunk.options[:fig_path])
|
|
|
|
isdir(figpath) || mkdir(figpath)
|
|
|
|
chunkid = (chunk.options[:name] == nothing) ? chunk.number : chunk.options[:name]
|
|
|
|
#Iterate over all open figures, save them and store names
|
2016-04-12 16:08:29 +02:00
|
|
|
|
2016-04-11 21:08:41 +02:00
|
|
|
|
|
|
|
for fig = plt[:get_fignums]()
|
2015-01-07 09:26:11 +01:00
|
|
|
full_name, rel_name = get_figname(report, chunk, fignum=fig)
|
|
|
|
savefig(full_name, dpi=chunk.options[:dpi])
|
2016-04-11 21:08:41 +02:00
|
|
|
push!(report.figures, rel_name)
|
|
|
|
report.fignum += 1
|
|
|
|
plt[:draw]()
|
|
|
|
plt[:close]()
|
2015-01-07 09:26:11 +01:00
|
|
|
end
|
2016-04-11 21:08:41 +02:00
|
|
|
#return fignames
|
2015-01-07 09:26:11 +01:00
|
|
|
end
|