Skip to content

empty plots with large number of particles #35

@jegarfa

Description

@jegarfa

Hi! I'm trying to plot a DM-only simulation using py-sphviewer. The simulation consists of 2048^3 particles. However, the result I'm getting is either a completely white or black plot. Below is the code, which I've taken from the examples.

Particles = sph.Particles(pos, mass, nb=4)
hsml      = Particles.get_hsml()
Scene     = sph.Scene(Particles)

fig = plt.figure(1, figsize=(15,7))
ax1 = fig.add_subplot(111)
ax1.imshow(qv_perspective.get_image(), extent=qv_perspective.get_extent(),
           origin='lower', cmap=cmaps.twilight(), 
           vmin=-0.5)
plt.show()

When I plot smaller simulations, everything works fine, and I get pretty plots. I suspect this issue might not be related to py-sphviewer but rather to matplotlib. I've noticed that when I create a simple 2D scatter plot with matplotlib for the 2048^3 particles (x, y), it results in an empty figure. So, I do not get errors, only empty plots.

Have you ever faced a similar issue when plotting large amounts of data? do you have any hint on what could be causing the problem?
thanks,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions