forallpeople icon indicating copy to clipboard operation
forallpeople copied to clipboard

matplotlib compatibility

Open ddi-acassidy opened this issue 2 years ago • 1 comments

Ive noticed that the auto-prefixing functionality means the prefix is ignored when plotting with matplotlib, for example if I have a value going from 1 Hz to 10kHz, it will "reset" at 1kHz since matplotlib is plotting it as a 1, not as 1000. as I result I have to remove all units before I can plot data.

It seems like .value works correctly with autoprefixes, so im not sure where the incompatibility lies

ddi-acassidy avatar Oct 05 '22 16:10 ddi-acassidy

Looks like this is due to the casting behavior

spam = 2000 * si.Hz
float(spam) # = 2.0

I dont think this behavior makes sense

ddi-acassidy avatar Oct 05 '22 17:10 ddi-acassidy