Skip to content

Instantly share code, notes, and snippets.

@rianoc
Created December 7, 2021 10:26
Show Gist options
  • Save rianoc/30f5955ddc8ab7c7a3e01cb29d5de8a8 to your computer and use it in GitHub Desktop.
Save rianoc/30f5955ddc8ab7c7a3e01cb29d5de8a8 to your computer and use it in GitHub Desktop.
Kdb+ EmbedPy handle function that returns more than one value.

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

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][];

Result:

EmbedPyMulti

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment