# Fluid.datasetplot~ abstraction for 2D/3D visualization

**URL:** https://discourse.flucoma.org/t/fluid-datasetplot-abstraction-for-2d-3d-visualization/783
**Category:** Pre-Release Toolbox2 Code Sharing
**Created:** [February 20, 2021, 1:40am UTC](https://discourse.flucoma.org/t/fluid-datasetplot-abstraction-for-2d-3d-visualization/783 "2021-02-20T01:40:40Z")
**Posts on this page:** 1
**Showing post:** 48

<div class="post-metadata">

### Author: ![rodrigo.constanzo](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/rodrigo.constanzo/32/12_2.png) [@rodrigo.constanzo](https://discourse.flucoma.org/u/rodrigo.constanzo)
#### Post date: [March 14, 2021, 7:54pm UTC](https://discourse.flucoma.org/t/fluid-datasetplot-abstraction-for-2d-3d-visualization/783/48 "2021-03-14T19:54:01Z")

</div>

Ok, I can see this being very useful. Here is the same 4D dataset “rotated” through each permutation (i.e. the _same exact dataset_ just swapping X for Y, Y for color, etc…)

 ![Screenshot 2021-03-14 at 7.38.13 pm](https://discourse.flucoma.org/uploads/default/original/2X/3/3d798d4629d1044853ed07bb374c9d3fab3c0fc0.png)

 ![Screenshot 2021-03-14 at 7.38.20 pm](https://discourse.flucoma.org/uploads/default/original/2X/7/742b3d27c06d01ea7b477db7d80acf85d7ad454a.png)

 ![Screenshot 2021-03-14 at 7.38.27 pm](https://discourse.flucoma.org/uploads/default/original/2X/b/b9e75d505f2a212fc48a203706650cc65ea89603.png)

 ![Screenshot 2021-03-14 at 7.38.34 pm](https://discourse.flucoma.org/uploads/default/original/2X/f/f8d40285d5416f703a6c35853568a7573d2e5598.png)

This could be quite useful for even 3D stuff as you can test the clustering/neighbors too.

At the moment I’ve implemented it with a simple `rotate` message. I thought about adding an argument but then you need to explicitly know how many dimensions are in your dataset, and how much you want to rotate it by. This way you bang a single message and it jiggles it. I also added `rotate reset` to bring it back to default. It also resets to default every time you load a new dataset.

I’m not convinced that’s the best interface, so open to input here as far as what terminology is best. There’s probably a real name for this kind of thing anyways.

Now onto the more sticky but:

> [@tremblap](#):
>
> but because this is all mapped manually in a dict dump, it is quite easy to do in the patch either with zl.rot to start with or a discrete mapping.

I got all the above coded only to realize that the internal `fluid.kdtree~` doesn’t remap, as that’s being plotted according to the original dimensionality. So it actually needs to get rotated at the dataset stage.

I’m sure it’s presently possible to do this with chaining together `fluid.datasetquery~`s, but it seems really tedious.

---

_[View the full topic](https://discourse.flucoma.org/t/fluid-datasetplot-abstraction-for-2d-3d-visualization/783)._
