# How to find underlying data for examples?

**URL:** <https://talk.observablehq.com/t/how-to-find-underlying-data-for-examples/8619>\
**Category:** Help\
**Created:** [December 18, 2023, 6:30pm UTC](https://talk.observablehq.com/t/how-to-find-underlying-data-for-examples/8619 "2023-12-18T18:30:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![miketalley](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/miketalley/32/8381_2.png) [@miketalley](https://talk.observablehq.com/u/miketalley)\
**Post date:** [December 18, 2023, 6:30pm UTC](https://talk.observablehq.com/t/how-to-find-underlying-data-for-examples/8619/1 "2023-12-18T18:30:30Z")

</div>

Hello! I’m new to observable and trying to learn how to specify bin values, but I’m having some trouble understanding how things work because I can’t seem to see the shape of the underlying data used in the example.

For example, when I navigate to [Bin transform | Plot](https://observablehq.com/plot/transforms/bin), how would I see the shape of `olympians` that is being passed in to `Plot.rectY`? I can see the csv in the network tab, but it would be great if I could see the object as it is passed. Is there a way to do this?

---

<div class="post-metadata">

**Author:** ![Cobus](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/cobus/32/9670_2.png) [@Cobus](https://talk.observablehq.com/u/Cobus)\
**Post date:** [December 18, 2023, 6:51pm UTC](https://talk.observablehq.com/t/how-to-find-underlying-data-for-examples/8619/2 "2023-12-18T18:51:08Z")

</div>

Hi @miketalley

I created a quick notebook to show the Plot [here](https://observablehq.com/@cobus/binning-olympians).  
In a notebook, you can just add a new JavaScript cell with the reference to `olympians` and you can inspect that in JSON format, or make a Data table of the data to inspect it. This is one of our built-in [sample datasets](https://observablehq.com/@observablehq/sample-datasets?collection=@observablehq/getting-data-in-and-out) so it is easy to demo examples and play with Plot.

> **[Binning olympians](https://observablehq.com/@cobus/binning-olympians)**

---

<div class="post-metadata">

**Author:** ![miketalley](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/miketalley/32/8381_2.png) [@miketalley](https://talk.observablehq.com/u/miketalley)\
**Post date:** [December 18, 2023, 7:01pm UTC](https://talk.observablehq.com/t/how-to-find-underlying-data-for-examples/8619/3 "2023-12-18T19:01:35Z")

</div>

This is great, thanks @Cobus ! Super fast reply too!

---

<div class="post-metadata">

**Author:** ![miketalley](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/miketalley/32/8381_2.png) [@miketalley](https://talk.observablehq.com/u/miketalley)\
**Post date:** [December 18, 2023, 9:46pm UTC](https://talk.observablehq.com/t/how-to-find-underlying-data-for-examples/8619/4 "2023-12-18T21:46:39Z")

</div>

I have a follow-up question on this: is it possible to specify an `interval` value when using inconsistently spaced bins using `rectY`? I put together an example [here](https://observablehq.com/d/529903b2636d132d) that may make more sense.

My goal is to get the x axis values to display on the sides of the bins/bars instead of centered, and I am not sure how to specify the last value. When I manually run `axisX` after `rectY` it doesn’t seem to work.

---

<div class="post-metadata">

**Author:** ![Fil](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/fil/32/207_2.png) [@Fil](https://talk.observablehq.com/u/Fil)\
**Post date:** [December 18, 2023, 10:08pm UTC](https://talk.observablehq.com/t/how-to-find-underlying-data-for-examples/8619/5 "2023-12-18T22:08:50Z")

</div>

Maybe something like this?

```auto
Plot.plot({
    y: { percent: true, label: "Percentage" },
    x: { label: "Value" },
    marks: [
      Plot.rectY(window.data.percentages, {
        x1: window.data.bins,
        x2: (x, i) => window.data.bins[i+1],
        fill: "steelblue",
        insetRight: 0.5,
        insetLeft: 0.5,
        tip: true,
      }),
      Plot.lineY(window.data.percentages, {
        x: window.data.bins,
        curve: "catmull-rom",
        stroke: "red",
        strokeOpacity: 0.5,
      }),
      Plot.axisX(window.data.bins),
      Plot.ruleY([0]),
    ]
});

```

---

<div class="post-metadata">

**Author:** ![miketalley](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/miketalley/32/8381_2.png) [@miketalley](https://talk.observablehq.com/u/miketalley)\
**Post date:** [December 19, 2023, 3:11pm UTC](https://talk.observablehq.com/t/how-to-find-underlying-data-for-examples/8619/6 "2023-12-19T15:11:39Z")

</div>

Thanks @Fil ! This pointed me in the right direction!

I appreciate all of the help, [here is my working example](https://observablehq.com/d/529903b2636d132d).
