Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Change manual kwargs popping to kwonly arguments.#10545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -2560,21 +2560,22 @@ def draw(self): | ||
def get_default_filetype(self): | ||
return 'pdf' | ||
def print_pdf(self, filename, *, | ||
dpi=72, # dpi to use for images | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Maybe deprecate dpi and replace by image_dpi? During the deprecation dpi could be catched via kwargs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. nah, let's try to keep all the print_foo's with as much the same signature as possible There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. ok. | ||
bbox_inches_restore=None, metadata=None, | ||
**kwargs): | ||
self.figure.set_dpi(72) # there are 72 pdf points to an inch | ||
width, height = self.figure.get_size_inches() | ||
if isinstance(filename, PdfPages): | ||
file = filename._file | ||
else: | ||
file = PdfFile(filename, metadata=metadata) | ||
try: | ||
file.newPage(width, height) | ||
renderer = MixedModeRenderer( | ||
self.figure, width, height,dpi, | ||
RendererPdf(file,dpi, height, width), | ||
bbox_inches_restore=bbox_inches_restore) | ||
self.figure.draw(renderer) | ||
renderer.finalize() | ||
if not isinstance(filename, PdfPages): | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -802,8 +802,9 @@ class FigureCanvasPgf(FigureCanvasBase): | ||
def get_default_filetype(self): | ||
return 'pdf' | ||
def _print_pgf_to_fh(self, fh, *args, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. *args is unused -> * only There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. see above re: keeping the same signature for all print_foo's. In any case this would mean fixing the call sites as well, so it'll be separate work. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. ok. | ||
dryrun=False, bbox_inches_restore=None, **kwargs): | ||
if dryrun: | ||
renderer = RendererPgf(self.figure, None, dummy=True) | ||
self.figure.draw(renderer) | ||
return | ||
@@ -849,10 +850,9 @@ def _print_pgf_to_fh(self, fh, *args, **kwargs): | ||
r"\pgfpathrectangle{\pgfpointorigin}{\pgfqpoint{%fin}{%fin}}" | ||
% (w, h)) | ||
writeln(fh, r"\pgfusepath{use as bounding box, clip}") | ||
renderer = MixedModeRenderer(self.figure, w, h, dpi, | ||
RendererPgf(self.figure, fh), | ||
bbox_inches_restore=bbox_inches_restore) | ||
self.figure.draw(renderer) | ||
# end the pgfpicture environment | ||
Uh oh!
There was an error while loading.Please reload this page.