1

I have a data below:

xmin    xmax     ymin   ymax
 2        4      1       2
 4        6      2       3

I wanted to generate a shape which I can use to fill in values. Please assist.

Thank you

Davide Bacci
  • 16,647
  • 3
  • 10
  • 36
python_interest
  • 874
  • 1
  • 9
  • 27

1 Answers1

2

enter image description here

Create your data like this.

enter image description here

Make sure every column says do not aggregate. Import the Deneb visual from marketplace. Add the fields to the Deneb visual well as follows:

enter image description here

Paste the following code into Deneb.

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "width": 300,
  "height": 240,
  "background": "white",
   "data": {"name": "dataset"},
  "layer": [
      {
      
      "mark": {"type": "rect", "color": "#9bc2e6"}
    }
  ],
  "encoding": {
    "x": {
      "field": "xmin",
      "type": "quantitative",
      "scale": {"domain": [0, 10]}
    },
    "x2": {"field": "xmax"},
    "y": {
      "field": "ymin",
      "type": "quantitative",
      "scale": {"domain": [8, 0]}
    },
    "y2": {"field": "ymax"},
    "color":{"field": "id"}
  }
}

That's it.

Davide Bacci
  • 16,647
  • 3
  • 10
  • 36