# Is there an example of centering a globe on coordinates with Plot?

**URL:** <https://talk.observablehq.com/t/is-there-an-example-of-centering-a-globe-on-coordinates-with-plot/7483>\
**Category:** Help\
**Created:** [January 6, 2023, 7:00pm UTC](https://talk.observablehq.com/t/is-there-an-example-of-centering-a-globe-on-coordinates-with-plot/7483 "2023-01-06T19:00:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![palewire](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/palewire/32/25_2.png) [@palewire](https://talk.observablehq.com/u/palewire)\
**Post date:** [January 6, 2023, 7:00pm UTC](https://talk.observablehq.com/t/is-there-an-example-of-centering-a-globe-on-coordinates-with-plot/7483/1 "2023-01-06T19:00:54Z")

</div>

I’m loving this cheatsheet here on Plot’s mapping features

> **[Projections / Observable Plot](https://observablehq.com/@observablehq/plot-projections)**
>
> Plot’s projection system, introduced in version 0.6.1, opens the door for all kinds of geographic maps (and more). Once set, the top-level projection option takes over the x and y scales and considers associated channels as jointly describing a...

One question that jumped into my head for a project I’m working on: Is there a helper or example snippet that shows how you might calculate the `rotate` setting’s Euler angles given a coordinate pair.

My use case is that I’d like to add a single point to a small globe, and have the view of globe centered on that same point. I don’t see an easy way to do that now. And I’m not smart enough about Euler to know the formula for the conversion.

Is there an example of someone sorting it out? Would this make sense as a helper to include in the library?

---

<div class="post-metadata">

**Author:** ![mbostock](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mbostock/32/9_2.png) [@mbostock](https://talk.observablehq.com/u/mbostock)\
**Post date:** [January 6, 2023, 8:14pm UTC](https://talk.observablehq.com/t/is-there-an-example-of-centering-a-globe-on-coordinates-with-plot/7483/2 "2023-01-06T20:14:30Z")

</div>

Negate the coordinates to produce the rotation.

So if Tokyo, Japan is at 35.6762° N, 139.6503° E, that corresponds to a [longitude, latitude] of [139.6503, 35.6762]. To rotate the projection to place Tokyo at 0° N, 0° E, you’d use a rotation of [-139.6503, -35.6762].

 ![untitled (94)](https://canada1.discourse-cdn.com/flex030/uploads/observablehq/original/2X/7/7033f65dce5ee8633cfdbabfcb49934b2114ae32.jpeg)

```plaintext
Plot.plot({
  height: 640,
  inset: 1,
  projection: { type: "orthographic", rotate: [-139.6503, -35.6762] },
  marks: [globe, Plot.dot([[139.6503, 35.6762]], { fill: "red" })]
})

```

---

<div class="post-metadata">

**Author:** ![palewire](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/palewire/32/25_2.png) [@palewire](https://talk.observablehq.com/u/palewire)\
**Post date:** [January 6, 2023, 8:39pm UTC](https://talk.observablehq.com/t/is-there-an-example-of-centering-a-globe-on-coordinates-with-plot/7483/3 "2023-01-06T20:39:15Z")

</div>

Well that’s a lot easier than I expected! Thanks for the tip. It’s appreciated.

---

<div class="post-metadata">

**Author:** ![palewire](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/palewire/32/25_2.png) [@palewire](https://talk.observablehq.com/u/palewire)\
**Post date:** [January 6, 2023, 8:49pm UTC](https://talk.observablehq.com/t/is-there-an-example-of-centering-a-globe-on-coordinates-with-plot/7483/4 "2023-01-06T20:49:53Z")

</div>

For anyone who comes behind me, I worked out my demo here: [Interactive locator map / Ben Welsh | Observable](https://observablehq.com/@palewire/interactive-locator-map)
