How to use 'matplotlib dpi' in Python

Every line of 'matplotlib dpi' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
56def get_dpi(self, size_cm):
57 w_cm, h_cm = size_cm
58 w_inch, h_inch = w_cm/inch, h_cm/inch
59 if self.dpi:
60 return self.dpi
61 elif self.size_pixels is not None:
62 return min(self.size_pixels/w_inch, self.size_pixels/h_inch)
63 elif self.width_pixels is not None:
64 return self.width_pixels/w_inch
65 elif self.height_pixels is not None:
66 return self.height_pixels/h_inch
67 else:
68 return 100.0

Related snippets