flaport / fdtd

A 3D electromagnetic FDTD simulator written in Python with optional GPU support
https://fdtd.readthedocs.io
MIT License
454 stars 116 forks source link

Support for returning plots instead of showing them directly #68

Closed devbrones closed 6 months ago

devbrones commented 6 months ago

Opening pr because i think this would be useful functionality.

flaport commented 6 months ago

Hi! Thanks for your PR :)

I like the idea, but I made a few changes that make it better in my opinion:

  1. Every plotting function now always returns the figure (no need for a flag)
  2. You can disable the plt.show call by setting the show flag to False in each plotting function.
  3. I like the idea of being able to set a style, so I added a style flag to each plotting function. However, I think the default should be None. You're free to call with your own custom styles on your side :)
flaport commented 6 months ago

changes will be available in fdtd>=0.3.6