fastdoc icon indicating copy to clipboard operation
fastdoc copied to clipboard

How to change image resolution?

Open AllenDowney opened this issue 4 years ago • 3 comments

When fastdoc converts figures to png, the default resolution is too low for printing. Is there a way to either increase the resolution or generate pdf?

AllenDowney avatar Apr 09 '21 21:04 AllenDowney

@AllenDowney it seems there is a hardcoded conversion value for the width of images in the code

https://github.com/fastai/fastdoc/blob/master/fastdoc/asciidoc.py#L263

I guess it would be great to have command line options for this or at least override this with an environment variable at runtime.

maxpumperla avatar Aug 25 '21 15:08 maxpumperla

@maxpumperla Thanks for looking into this. I agree that it would be great if this were a command-line option.

For now I have worked around it by setting

plt.rcParams['figure.dpi'] = 300

At the top of the notebook and running it again.

AllenDowney avatar Aug 25 '21 15:08 AllenDowney

good to know that works, thank you!

maxpumperla avatar Aug 25 '21 16:08 maxpumperla