Skip to content

Specify the plot dimensions in pixels? #137

@krassowski

Description

@krassowski

I would like to be able to set the size of my figure in pixels rather than inches using options()

IRkernel used to have set_plot_options() function which permitted specifying units because everything was just being passed to PNG call (https://github.com/IRkernel/IRkernel/pull/82/files#diff-d6114b524c43b90f0e7f0b24a0af9f94L10).

Currently we can only change the size using repr.plot.res, repr.plot.width and repr.plot.height. Would it be possible to add repr.plot.unit="in" so that it can be changed to "px"?

This should be pretty straightforward change and remove the inches hard-coded in:

Cairo::Cairo(width, height, tf, 'png', pointsize, bg, 'transparent', 'in', res)
else
png(tf, width, height, 'in', pointsize, bg, res, antialias = antialias)

I'm happy to create a pull request if this is change is welcome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions