diff --git a/src/arg_desc.jl b/src/arg_desc.jl index ba0b1200..2aa07029 100644 --- a/src/arg_desc.jl +++ b/src/arg_desc.jl @@ -62,6 +62,7 @@ const _arg_desc = KW( :overwrite_figure => "Bool. Should we reuse the same GUI window/figure when plotting (true) or open a new one (false).", :html_output_format => "Symbol. When writing html output, what is the format? `:png` and `:svg` are currently supported.", :inset_subplots => "nothing or vector of 2-tuple (parent,bbox). optionally pass a vector of (parent,bbox) tuples which are the parent layout and the relative bounding box of inset subplots", +:dpi => "Number. Dots Per Inch of output figures", # subplot args :title => "String. Subplot title.", diff --git a/src/args.jl b/src/args.jl index 857fa660..82dd16b5 100644 --- a/src/args.jl +++ b/src/args.jl @@ -216,6 +216,7 @@ const _plot_defaults = KW( :html_output_format => :auto, :inset_subplots => nothing, # optionally pass a vector of (parent,bbox) tuples which are # the parent layout and the relative bounding box of inset subplots + :dpi => DPI, # dots per inch for images, etc ) diff --git a/src/backends/pyplot.jl b/src/backends/pyplot.jl index cc0ce89f..b62d1f68 100644 --- a/src/backends/pyplot.jl +++ b/src/backends/pyplot.jl @@ -30,6 +30,7 @@ supported_args(::PyPlotBackend) = merge_with_base_supported([ :match_dimensions, :clims, :inset_subplots, + :dpi, ]) supported_types(::PyPlotBackend) = [ :path, :steppre, :steppost, :shape, @@ -1013,7 +1014,7 @@ function _before_layout_calcs(plt::Plot{PyPlotBackend}) fig[:clear]() fig[:set_size_inches](px2inch(w), px2inch(h), forward = true) fig[:set_facecolor](py_color(plt[:background_color_outside])) - fig[:set_dpi](DPI) + fig[:set_dpi](plt[:dpi]) # resize the window PyPlot.plt[:get_current_fig_manager]()[:resize](w, h) @@ -1278,7 +1279,7 @@ for (mime, fmt) in _pyplot_mimeformats # figsize = map(px2inch, plt[:size]), facecolor = fig.o["get_facecolor"](), edgecolor = "none", - dpi = DPI + dpi = plt[:dpi] ) end end