2014-12-09 09:35:38 +01:00
|
|
|
import Winston
|
2014-12-04 15:14:07 +01:00
|
|
|
|
2014-12-04 20:54:56 +01:00
|
|
|
function Base.display(report::Report, m::MIME"image/png", data)
|
2014-12-04 15:14:07 +01:00
|
|
|
|
|
|
|
chunk = report.cur_chunk
|
|
|
|
full_name, rel_name = get_figname(report, chunk)
|
|
|
|
|
|
|
|
docformat = formats[report.formatdict[:doctype]]
|
2015-01-11 22:38:58 +01:00
|
|
|
push!(report.figures, rel_name)
|
2016-04-20 19:23:00 +02:00
|
|
|
report.fignum += 1
|
|
|
|
vector_fmts = [".pdf"; ".svg"]
|
2014-12-09 08:43:32 +01:00
|
|
|
|
|
|
|
#Don't use dpi for vector formats
|
2015-01-05 15:35:24 +01:00
|
|
|
if chunk.options[:fig_ext] in vector_fmts
|
|
|
|
Winston.savefig(data, full_name, width=chunk.options[:fig_width]*100,
|
|
|
|
height=chunk.options[:fig_height]*100)
|
2014-12-09 08:43:32 +01:00
|
|
|
else
|
2015-01-05 15:35:24 +01:00
|
|
|
Winston.savefig(data, full_name,
|
|
|
|
width=chunk.options[:fig_width]*chunk.options[:dpi],
|
|
|
|
height=chunk.options[:fig_height]*chunk.options[:dpi])
|
2014-12-09 08:43:32 +01:00
|
|
|
end
|
2014-12-04 15:14:07 +01:00
|
|
|
end
|