summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Filter
diff options
context:
space:
mode:
authorLaurentRDC <>2019-08-08 14:26:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2019-08-08 14:26:00 (GMT)
commit2ae5738bae724386a9710042cfc7b0e4939dcfc1 (patch)
tree321ea1f4435bda917ca5a630726ca4f6705dc2f8 /src/Text/Pandoc/Filter
parent202fd079c256b36a0182282d1f05ff64e161650c (diff)
version 2.1.5.12.1.5.1
Diffstat (limited to 'src/Text/Pandoc/Filter')
-rw-r--r--src/Text/Pandoc/Filter/Pyplot/FigureSpec.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Filter/Pyplot/FigureSpec.hs b/src/Text/Pandoc/Filter/Pyplot/FigureSpec.hs
index f7005e5..bfbec4f 100644
--- a/src/Text/Pandoc/Filter/Pyplot/FigureSpec.hs
+++ b/src/Text/Pandoc/Filter/Pyplot/FigureSpec.hs
@@ -126,13 +126,15 @@ addPlotCapture spec =
mconcat
[ script spec
, "\nimport matplotlib.pyplot as plt" -- Just in case
- , plotCapture (figurePath spec) (dpi spec)
- , plotCapture (hiresFigurePath spec) (minimum [200, 2 * dpi spec])
+ -- Note that the high-resolution figure always has non-transparent background
+ -- because it is difficult to see the image when opened directly
+ -- in Chrome, for example.
+ , plotCapture (figurePath spec) (dpi spec) (transparent spec)
+ , plotCapture (hiresFigurePath spec) (minimum [200, 2 * dpi spec]) False
]
where
tight' = tightBbox spec
- transparent' = transparent spec
- plotCapture fname' dpi' = mconcat $
+ plotCapture fname' dpi' transparent' = mconcat $
[ "\nplt.savefig("
, T.pack $ show fname' -- show is required for quotes
, ", dpi="