JuliaWaveScattering / MultipleScattering.jl

A Julia library for simulating, processing, and plotting multiple scattering of waves.
Other
45 stars 12 forks source link

Margins in field plotting #12

Closed harjuj closed 6 years ago

harjuj commented 6 years ago

So at the moment plotting a field seems to only work for the least bounding box of the container and the source, so if I try to set the xlims or ylims beyond a spherical container's radius it just shows white: image

It would be nice to see what the field looks like on the other side of the container as well.

I'm guessing an option would be to make separate shapes for domain=Rectangle(), then container=Shape(), make particles=random_particles(shape=container), and then do a simulation with FrequencySimulation(particles, shape=domain), but some kind of margin around a container might be a nice addition, and easier to work with? Or some kind of way to attach a container shape to a domain shape, so the user wouldn't need to keep track of so many things?

jondea commented 6 years ago

Thanks for the interest in the repo and the issue!

We could add parameter called margin. We could also make use of xlims and ylims in the initial plot to override the bounding box

arturgower commented 6 years ago

I think using plot(simultion; bounds=Rectangle(bottomleft,topright)) , where say bottomleft = [-1.0,-1.0] and topright = [2.0,2.0] would show the field with the box bounds, irrespective of the source and position of the particles. Have a look at this source code.

Thanks for the post! Let me know if that works.

harjuj commented 6 years ago

Yeah thanks, bounds seems to have worked :)! Just not that familiar with plots I guess. comparefield0 05mvolfrac0 2repeats2