# 3D wireframe diagrams?

**URL:** <https://discourse.julialang.org/t/3d-wireframe-diagrams/47918>\
**Category:** Visualization\
**Tags:** plotting\
**Created:** [October 7, 2020, 10:18am UTC](https://discourse.julialang.org/t/3d-wireframe-diagrams/47918 "2020-10-07T10:18:09Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![amca01](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amca01/32/5853_2.png) [@amca01](https://discourse.julialang.org/u/amca01)\
**Post date:** [October 7, 2020, 10:18am UTC](https://discourse.julialang.org/t/3d-wireframe-diagrams/47918/1 "2020-10-07T10:18:09Z")

</div>

Hello, I’m wanting a Julia package that will enable me to draw a wireframe diagram - just points in space joined by lines - and move it around to view it from different angles or perspectives. I do most of my work in Jupyter Lab, so something that works in that system would be best, but if necessary I could use another environment. I believe that Plotly _might_ work, but that’s a commercial package (although with some free access), and I’d prefer something open source.

Thanks!

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [October 7, 2020, 11:26am UTC](https://discourse.julialang.org/t/3d-wireframe-diagrams/47918/2 "2020-10-07T11:26:22Z")

</div>

This is a little bit more elaborated example, but since we have it ready …

```julia
using GMT

gmtbegin("ex04.png")
	makecpt(cmap=(255,100), range=(-10,10,10), no_bg=true, H=true)
	grdcontour("@HI_geoid_04.nc", region=(195,210,18,25), view=(60,30), cont=1,
			annot=(int=5, labels=(rounded=true,)), labels=(dist=10,),
			x_off=3, y_off=3, proj=:merc, figscale=1.1)
	coast!(p=true, frame=(annot=2, axes=:NEsw), land=:black,
		rose=(inside=true, anchor=:BR, width=2.5, offset=0.25, label=true))
	grdview!("@HI_topo_04.nc", p=true, region=(195,210,18,25,-6,4),
			plane=(-6,:lightgray), surftype=(surf=true,mesh=true), Jz="0.9",
			frame=(axes=:wesnZ, annot=2), zaxis=(annot=2, label="Topo (km)"), y_off=5.6)
	text!(mat2ds([7.5 14.0], "H@#awaiian@# R@#idge@#"), region=(0,21,0,28),
		font=(60,"ZapfChancery-MediumItalic"), justify=:CB, proj=:linear,
		view=:none, figscale=1, savefig="ex04.png")
gmtend()

```

 ![ex04](https://global.discourse-cdn.com/julialang/original/3X/e/0/e0508cad52d4a67ccecff4013a3b2c35614d170d.png)

---

<div class="post-metadata">

**Author:** ![mbaz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbaz/32/17295_2.png) [@mbaz](https://discourse.julialang.org/u/mbaz)\
**Post date:** [October 7, 2020, 4:38pm UTC](https://discourse.julialang.org/t/3d-wireframe-diagrams/47918/3 "2020-10-07T16:38:15Z")

</div>

Gaston.jl can easily do 3-D wireframes (see an example [here](https://mbaz.github.io/Gaston.jl/stable/3dplots/#How-to-plot-a-3-D-function-1)). I have never tested it with Jupyter Lab, though; only with Jupyter. Assuming they use the same machinism to display plots, then it should work.

To interactively change the view, you’d need to create a slider or two, and use them as arguments to `view`, like:

```julia
x = y = -15:0.4:15
f1 = (x,y) -> @. sin(sqrt(x*x+y*y))/sqrt(x*x+y*y)
surf(x, y, f1, lc = :turquoise,
     Axes(title = :Sombrero_Wireframe,
          view = (slider1, slider2),
          hidden3d = :on))

```

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [October 7, 2020, 7:09pm UTC](https://discourse.julialang.org/t/3d-wireframe-diagrams/47918/4 "2020-10-07T19:09:03Z")

</div>

PlotlyJS can do it. [https://github.com/PetrKryslUCSD/FinEtoolsFlexBeams.jl/blob/203599470c3ef7f45ff2d6f2dbb204fd4d2e3d6d/src/VisUtilModule.jl#L118](https://github.com/PetrKryslUCSD/FinEtoolsFlexBeams.jl/blob/203599470c3ef7f45ff2d6f2dbb204fd4d2e3d6d/src/VisUtilModule.jl#L118)

---

<div class="post-metadata">

**Author:** ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Post date:** [October 7, 2020, 8:10pm UTC](https://discourse.julialang.org/t/3d-wireframe-diagrams/47918/5 "2020-10-07T20:10:20Z")

</div>

WGLMakie should be able to do this.

---

<div class="post-metadata">

**Author:** ![jheinen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jheinen/32/2787_2.png) [@jheinen](https://discourse.julialang.org/u/jheinen)\
**Post date:** [October 8, 2020, 8:22am UTC](https://discourse.julialang.org/t/3d-wireframe-diagrams/47918/6 "2020-10-08T08:22:14Z")

</div>

`GR` has a `wireframe` method. See an example [here](https://gr-framework.org/julia-jlgr.html#wireframe-0315ff05d8f2652c7841da75a23d12e6).

---

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [January 6, 2023, 7:38am UTC](https://discourse.julialang.org/t/3d-wireframe-diagrams/47918/7 "2023-01-06T07:38:52Z")

</div>

That’s amazing, I just saw this post

---

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [January 6, 2023, 7:39am UTC](https://discourse.julialang.org/t/3d-wireframe-diagrams/47918/8 "2023-01-06T07:39:27Z")

</div>

Can I use another map like Bali, Indonesia? How to upload a certain location’ map?

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [January 6, 2023, 2:25pm UTC](https://discourse.julialang.org/t/3d-wireframe-diagrams/47918/9 "2023-01-06T14:25:43Z")

</div>

Yes, you can make plots like that for any place on Earth (and neighbors). In the script provided `region=(195,210,18,25)` specifies the region bounding box in geographical coordinates. It mean a box with longitudes between [195, 210] and latitudes [18,25]. Just change that for your area of interest. In `grdview!` cal you’ll find the same numbers plus 2 `region=(195,210,18,25,-6,4)`. Here the -6,4 means the limits in _z_ (in km). Picking a different area means that these numbers should be adjusted too. The data is downloaded automatically via the `"@HI_topo_04.nc"` argument. See the [GMT docs](https://www.generic-mapping-tools.org/remote-datasets/), for explanations about the available datasets for automatic use.
