How to set the size of the output for the drawing addon #357
Answered
by
mbway
karstenflores
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
mbway
Mar 7, 2021
Replies: 1 comment 6 replies
-
Beta Was this translation helpful? Give feedback.
6 replies
Answer selected by
karstenflores
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this can be solved in a way that isn't specific to ezdxf by carefully setting the figure size before saving. Matplotlib is quite complex when it comes to measurements. I have a solution which seems to work well but there may be slight inaccuracies since the calculations are done using floating point numbers but at the end of the day pixels are a discrete measurement so it's probably possible to be at least 1 pixel off. There are probably lots of other things like line widths which have an effect.
Background
The axes of a matplotlib plot have data limits which are of course in units of the data, in the case of ezdxf these are also the units of the CAD file. Then there is the figure size wh…