Coder Social home page Coder Social logo

Comments (3)

dmentipl avatar dmentipl commented on July 19, 2024

Hi @benedettaveronesi, thanks for the bug report!

I don't think this should be too hard to fix.

I'll have a look this week.

from plonk.

dmentipl avatar dmentipl commented on July 19, 2024

For future reference, a more minimal bug report code snippet would be

import plonk

dump = plonk.Dump('dump_00000.h5')

ndust = plonk.header['ndustsmall']

options = list()
options.append({'render': 'density'})

for idx in range(ndust):
    options.append({'render': dump.density * dump.particles.arrays['dustfrac'][:, idx]})

multiplot = plonk.visualization.MultiPlot(
    dump, options, shape=(3, 2), cbar_mode='each', cbar_location='top', cbar_pad=0.2
)

from plonk.

dmentipl avatar dmentipl commented on July 19, 2024

Hi @benedettaveronesi, sorry for taking so long to respond. I've been busy with a new release of Plonk (0.2.0). This release is a major overhaul of the internals of Plonk, and of the API.

I've actually removed MultiPlot from this release.

Having said that, I don't think it's too hard to do what you require:

snap = plonk.load_snap('path_to_your_file')
ndust = len(snap.properties['grain size'])

# Say ndust is 6
ncols = 3
nrows = 2

fig, axes = plt.subplots(nrows=nrows, ncols=ncols, sharex=True, sharey=True)
for idx in range(ndust):
    plonk.visualize.plot(
        scalar_data=snap['rho'] * snap['dustfrac'][:, idx],
        x_coordinate=snap['x'],
        y_coordinate=snap['y'],
        extent=(-100, 100, -100, 100),
        particle_mass=snap['m'],
        smoothing_length=snap['h'],
        axis=axes.ravel()[idx],
    )

Please, let me know if you have any further issues.

from plonk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.