Single plots with multiple x-axes

Hi,

I would like to combine some multi-channel data that are generated in my pipeline into a single plot, however, the data vectors that I want to plot can have a different amount of samples. E.g., I’ve got x1 and y1 and z1 vectors of length N1 and x2, y2 and z2 vectors of length N2. The data is stored in two json files, like:

data1.json:

[
    {"x": .., "y": .., "z": ..},
    ..
    {"x": .., "y": .., "z": ..}
 ]

and data2.json:

[
    {"x": .., "y": .., "z": ..},
    ..
    {"x": .., "y": .., "z": ..}
] 

What I’d like to do is to have plots section in my yaml file that looks like

plots:
  - data:
      y:
        data1.json: [y, z]
        data2.json: [y, z]
      x:
        data1.json: x
        data2.json: x

and have all data combined in 1 plot (i.e. 4 curves). However, if I try this I get an empty plot. If I only use a single channel for the y-axis (e.g. z), then it works. Is this a bug or is it intended?

It looks like a bug or unintended behavior to me. Feel free to also report it in Sign in to GitHub · GitHub so we can track it there, but I’ll see if I can take a closer look.

Thank you for responding.
I’ve opened an issue on GitHub: Single plots with multiple x-axes · Issue #9374 · iterative/dvc (github.com).

1 Like

This has been solved by @dberenbaum, what I needed to do was to refer to x without the data file path:

plots:
  - data:
      y:
        data1.json: [y, z]
        data2.json: [y, z]
      x: 
        x

Thank you.

1 Like