KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums kdb+ EmbedPy question, function in python that returns more than one value. Re: EmbedPy question, function in python that returns more than one value.

  • rocuinneagain

    Member
    August 13, 2021 at 12:00 am

    You can use .p.wrap https://code.kx.com/q/ml/embedpy/userguide/#embedpy-objects_1

     

    Small example giving each subplot a title:

    plt:.p.import[`matplotlib;`:pyplot]
    plts:plt[`:subplots;<;pykwargs `ncols`figsize`dpi!(2;24 8;100)]
    .p.wrap[plts[1;0]][`:set_title]"Plot1";
    .p.wrap[plts[1;1]][`:set_title]"Plot2";
    plt[`:show][];

    Results in: