New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3D plotting #22

Closed
Juanlu001 opened this Issue Jan 21, 2015 · 34 comments

Comments

6 participants
@Juanlu001
Member

Juanlu001 commented Jan 21, 2015

Summary:

@Juanlu001

This comment has been minimized.

Show comment
Hide comment
@Juanlu001
Member

Juanlu001 commented Mar 20, 2015

Consider also vispy https://github.com/vispy/vispy

@Juanlu001 Juanlu001 changed the title from 3D plotting with Mayavi to 3D plotting Mar 20, 2015

@Juanlu001

This comment has been minimized.

Show comment
Hide comment
@Juanlu001

Juanlu001 Mar 28, 2015

Member

vispy is a bit low level at this point, and forces you to use vanilla OpenGL for any non trivial work. Keep an eye on it but too early at the moment.

Member

Juanlu001 commented Mar 28, 2015

vispy is a bit low level at this point, and forces you to use vanilla OpenGL for any non trivial work. Keep an eye on it but too early at the moment.

@Juanlu001

This comment has been minimized.

Show comment
Hide comment
@Juanlu001

Juanlu001 Apr 4, 2015

Member

On second thought, for plotting lines and planets as point masses, matplotlib is enough. But then I have to distinguish the deep space case to actually paint the planets as points and not having to deal with matplotlib 3D limitations.

Member

Juanlu001 commented Apr 4, 2015

On second thought, for plotting lines and planets as point masses, matplotlib is enough. But then I have to distinguish the deep space case to actually paint the planets as points and not having to deal with matplotlib 3D limitations.

@Juanlu001 Juanlu001 modified the milestone: 0.4 Apr 30, 2015

@Juanlu001 Juanlu001 modified the milestones: 0.4, 0.5 Jun 25, 2015

@Juanlu001

This comment has been minimized.

Show comment
Hide comment
@Juanlu001

Juanlu001 Dec 18, 2015

Member

And also: https://github.com/petrushy/CesiumWidget/ this is probably the most straightforward option, since it would suffice with a poliastro -> CZML conversion.

Member

Juanlu001 commented Dec 18, 2015

And also: https://github.com/petrushy/CesiumWidget/ this is probably the most straightforward option, since it would suffice with a poliastro -> CZML conversion.

@Juanlu001

This comment has been minimized.

Show comment
Hide comment
@Juanlu001

Juanlu001 Jan 4, 2016

Member

I have just discovered https://github.com/sinhrks/cesiumpy, which is another Python wrapper for Cesium.js. I don't know if @petrushy and @sinhrks were aware of each other efforts, so I'll ping you both here in case you want to weigh in.

Member

Juanlu001 commented Jan 4, 2016

I have just discovered https://github.com/sinhrks/cesiumpy, which is another Python wrapper for Cesium.js. I don't know if @petrushy and @sinhrks were aware of each other efforts, so I'll ping you both here in case you want to weigh in.

@Juanlu001

This comment has been minimized.

Show comment
Hide comment
@Juanlu001

Juanlu001 Jan 4, 2016

Member

In any case, I don't even have to make a choice since as I stated before my work is to produce a poliastro -> CZML translation, which can later be read by either CesiumWidget or cesiumpy.

Member

Juanlu001 commented Jan 4, 2016

In any case, I don't even have to make a choice since as I stated before my work is to produce a poliastro -> CZML translation, which can later be read by either CesiumWidget or cesiumpy.

@sinhrks

This comment has been minimized.

Show comment
Hide comment
@sinhrks

sinhrks Jan 4, 2016

Thanks, I hadn't aware of CesiumWidget, and will take a look:)

sinhrks commented Jan 4, 2016

Thanks, I hadn't aware of CesiumWidget, and will take a look:)

@petrushy

This comment has been minimized.

Show comment
Hide comment
@petrushy

petrushy Jan 5, 2016

Hi! No, I wasn't aware of any other implementations, very interesting!

petrushy commented Jan 5, 2016

Hi! No, I wasn't aware of any other implementations, very interesting!

@Juanlu001

This comment has been minimized.

Show comment
Hide comment
@Juanlu001

Juanlu001 Jan 7, 2016

Member

Another contender: http://gr-framework.org/

Member

Juanlu001 commented Jan 7, 2016

Another contender: http://gr-framework.org/

@Juanlu001 Juanlu001 added the plotting label Jan 23, 2016

@Juanlu001

This comment has been minimized.

Show comment
Hide comment
@Juanlu001

Juanlu001 Feb 9, 2016

Member

GR does not work properly on Python 3 yet, does not solve matplotlib problems when used as a backend, is poorly documented, a tiny community and has lower quality results.

Member

Juanlu001 commented Feb 9, 2016

GR does not work properly on Python 3 yet, does not solve matplotlib problems when used as a backend, is poorly documented, a tiny community and has lower quality results.

@Juanlu001

This comment has been minimized.

Show comment
Hide comment
@Juanlu001

Juanlu001 Feb 23, 2016

Member

I created #117 as a separate issue to think about CZML exporting, and for this milestone I am focusing on getting 3D plotting with matplotlib right. Those not interested feel free to unsubscribe from this particular thread.

Member

Juanlu001 commented Feb 23, 2016

I created #117 as a separate issue to think about CZML exporting, and for this milestone I am focusing on getting 3D plotting with matplotlib right. Those not interested feel free to unsubscribe from this particular thread.

@Juanlu001

This comment has been minimized.

Show comment
Hide comment
@Juanlu001

Juanlu001 Mar 2, 2016

Member

I'm postponing this to 0.6 to not block the release.

Member

Juanlu001 commented Mar 2, 2016

I'm postponing this to 0.6 to not block the release.

@Juanlu001 Juanlu001 modified the milestones: 0.6, 0.5 Mar 2, 2016

@Juanlu001

This comment has been minimized.

Show comment
Hide comment
@Juanlu001

Juanlu001 Jul 21, 2016

Member

Thanks to @guillem-db I discovered that plotly has quite advanced 3D plotting capabilities, and respects the depth and opacity of objects. I will definitely have to check it out!

Member

Juanlu001 commented Jul 21, 2016

Thanks to @guillem-db I discovered that plotly has quite advanced 3D plotting capabilities, and respects the depth and opacity of objects. I will definitely have to check it out!

@Juanlu001 Juanlu001 removed the 1 - Ready label Aug 22, 2016

@Juanlu001

This comment has been minimized.

Show comment
Hide comment
@Juanlu001

Juanlu001 Sep 8, 2016

Member

Bokeh now has 3D! 😱

https://demo.bokehplots.com/apps/surface3d

(see bokeh/bokeh#3693)

although "it's probably out of scope for the core library", it would be worth it to explore extensions @guillem-db.

Member

Juanlu001 commented Sep 8, 2016

Bokeh now has 3D! 😱

https://demo.bokehplots.com/apps/surface3d

(see bokeh/bokeh#3693)

although "it's probably out of scope for the core library", it would be worth it to explore extensions @guillem-db.

@Juanlu001

This comment has been minimized.

Show comment
Hide comment
@Juanlu001
Member

Juanlu001 commented Jan 2, 2017

@wonki22

This comment has been minimized.

Show comment
Hide comment
@wonki22

wonki22 May 3, 2017

Contributor

What about http://vpython.org/?
Here are some examples of what can be achieved with it https://github.com/BruceSherwood/vpython-jupyter
I think is an interesting option to consider.
Cons are it requires a different kernel in Jupyter and I don't know if that can affect too drastically to the project or if it's a minor issue. Also if you want to repeat an animation you need to restart the kernel which in my opinon is a little bit annoying but if so, at least you can cross it out of the candidates.

Contributor

wonki22 commented May 3, 2017

What about http://vpython.org/?
Here are some examples of what can be achieved with it https://github.com/BruceSherwood/vpython-jupyter
I think is an interesting option to consider.
Cons are it requires a different kernel in Jupyter and I don't know if that can affect too drastically to the project or if it's a minor issue. Also if you want to repeat an animation you need to restart the kernel which in my opinon is a little bit annoying but if so, at least you can cross it out of the candidates.

@Juanlu001

This comment has been minimized.

Show comment
Hide comment
@Juanlu001

Juanlu001 May 4, 2017

Member

The installation instructions recommend using the VPython kernel, but the contents of the kernel.json that vpnotebook installs are extremely simple:

{
 "language": "python",
 "argv": [
  "python",
  "-m",
  "ipykernel",
  "--InteractiveShellApp.exec_lines=['from __future__ import division, print_function','from math import *']",
  "-f",
  "{connection_file}"
 ],
 "display_name": "VPython"
}

I think everything should work if one does

from math import *

But this makes me think that it's not using the math functions of NumPy... which I find suspicious.

Apart from this, vpython-jupyter seems to support Python 3 and GlowScript apparently uses WebGL, so it might be a suitable alternative.

If you are considering working on it for SOCIS, start thinking of a work plan for the summer. I will send the instructions today or tomorrow to the mailing list :)

Member

Juanlu001 commented May 4, 2017

The installation instructions recommend using the VPython kernel, but the contents of the kernel.json that vpnotebook installs are extremely simple:

{
 "language": "python",
 "argv": [
  "python",
  "-m",
  "ipykernel",
  "--InteractiveShellApp.exec_lines=['from __future__ import division, print_function','from math import *']",
  "-f",
  "{connection_file}"
 ],
 "display_name": "VPython"
}

I think everything should work if one does

from math import *

But this makes me think that it's not using the math functions of NumPy... which I find suspicious.

Apart from this, vpython-jupyter seems to support Python 3 and GlowScript apparently uses WebGL, so it might be a suitable alternative.

If you are considering working on it for SOCIS, start thinking of a work plan for the summer. I will send the instructions today or tomorrow to the mailing list :)

@Juanlu001 Juanlu001 added the SOCIS label May 4, 2017

@Juanlu001

This comment has been minimized.

Show comment
Hide comment
@Juanlu001
Member

Juanlu001 commented Jul 19, 2017

This tutorial might be useful:

http://kazuar.github.io/jupyter-widget-tutorial/

@Juanlu001

This comment has been minimized.

Show comment
Hide comment
@Juanlu001

Juanlu001 Aug 8, 2017

Member

The sooner we accept we will have to learn JavaScript/TypeScript for this, the better... @anhiga

Member

Juanlu001 commented Aug 8, 2017

The sooner we accept we will have to learn JavaScript/TypeScript for this, the better... @anhiga

@anhiga

This comment has been minimized.

Show comment
Hide comment
@anhiga

anhiga Aug 8, 2017

Member

Three.js specifically?

Member

anhiga commented Aug 8, 2017

Three.js specifically?

@Juanlu001

This comment has been minimized.

Show comment
Hide comment
@Juanlu001

Juanlu001 Aug 8, 2017

Member

Three.js specifically?

Yes. There is pythreejs, but even so one has to write JS functions here and there, integrate it with the upcoming ipywidgets 7.0 machinery... There is no escape from it :)

Member

Juanlu001 commented Aug 8, 2017

Three.js specifically?

Yes. There is pythreejs, but even so one has to write JS functions here and there, integrate it with the upcoming ipywidgets 7.0 machinery... There is no escape from it :)

@anhiga

This comment has been minimized.

Show comment
Hide comment
@anhiga

anhiga Aug 8, 2017

Member

Well, knowing JS is a great skill nowadays, so... 😆

Member

anhiga commented Aug 8, 2017

Well, knowing JS is a great skill nowadays, so... 😆

@Juanlu001

This comment has been minimized.

Show comment
Hide comment
@Juanlu001

Juanlu001 Aug 25, 2017

Member

I believe we should discuss #218 first, and therefore do not think we will make this in time for 0.7. Moving milestones.

Member

Juanlu001 commented Aug 25, 2017

I believe we should discuss #218 first, and therefore do not think we will make this in time for 0.7. Moving milestones.

@Juanlu001 Juanlu001 modified the milestones: Future, 0.7 Aug 25, 2017

@Juanlu001 Juanlu001 added the blocked label Aug 25, 2017

@Juanlu001

This comment has been minimized.

Show comment
Hide comment
@Juanlu001

Juanlu001 Aug 30, 2017

Member

ipyvolume gained line plots ❗️

https://ipyvolume.readthedocs.io/en/latest/api.html#ipyvolume.pylab.plot

Now we can avoid writing our own thing, at least for now @anhiga. We have a winner! 😄

Member

Juanlu001 commented Aug 30, 2017

ipyvolume gained line plots ❗️

https://ipyvolume.readthedocs.io/en/latest/api.html#ipyvolume.pylab.plot

Now we can avoid writing our own thing, at least for now @anhiga. We have a winner! 😄

@Juanlu001

This comment has been minimized.

Show comment
Hide comment
@Juanlu001

Juanlu001 Aug 30, 2017

Member

...to clarify: the other winner has always been Cesium, of course. My concern has always been that it is too focused on rendering 3D globes and that it is too big. I went to the demo showcase again but found that the orbit predictor one is down:

http://cesiumjs.org/demos/OrbitalPredictor.html

http://www.orbitalpredictor.com/

Perhaps is worth a shot in any case.

Member

Juanlu001 commented Aug 30, 2017

...to clarify: the other winner has always been Cesium, of course. My concern has always been that it is too focused on rendering 3D globes and that it is too big. I went to the demo showcase again but found that the orbit predictor one is down:

http://cesiumjs.org/demos/OrbitalPredictor.html

http://www.orbitalpredictor.com/

Perhaps is worth a shot in any case.

@Juanlu001

This comment has been minimized.

Show comment
Hide comment
@Juanlu001

Juanlu001 Aug 30, 2017

Member

We don't have to get it right first time. Perhaps we can implement a basic version of both, and demand feedback from the community. I intend to work on this for 0.8.

Member

Juanlu001 commented Aug 30, 2017

We don't have to get it right first time. Perhaps we can implement a basic version of both, and demand feedback from the community. I intend to work on this for 0.8.

@Juanlu001 Juanlu001 modified the milestones: 0.8, Future Aug 30, 2017

@Juanlu001

This comment has been minimized.

Show comment
Hide comment
@Juanlu001

Juanlu001 Sep 10, 2017

Member

Decision

Cesium is awesome, but perhaps too complex for the purposes of poliastro not fit for the vision of poliastro (see #117 (comment)). This projects has never had the intention of being a replacement of STK, but rather a tool for quickly experimentation and visualization of simple cases. We can implement CZML export anyway (see #117 for that).

On the other hand, although ipyvolume seems promising, the documentation is still lacking and the code difficult to navigate.

Although I've been reluctant to use plotly, it has a number of wins:

Example of 3D line plot in plotly:

https://plot.ly/python/3d-line-plots/

This issue is already long enough. Let's settle on this, and move away from plotly if we find serious limitations or awesome alternatives.

Member

Juanlu001 commented Sep 10, 2017

Decision

Cesium is awesome, but perhaps too complex for the purposes of poliastro not fit for the vision of poliastro (see #117 (comment)). This projects has never had the intention of being a replacement of STK, but rather a tool for quickly experimentation and visualization of simple cases. We can implement CZML export anyway (see #117 for that).

On the other hand, although ipyvolume seems promising, the documentation is still lacking and the code difficult to navigate.

Although I've been reluctant to use plotly, it has a number of wins:

Example of 3D line plot in plotly:

https://plot.ly/python/3d-line-plots/

This issue is already long enough. Let's settle on this, and move away from plotly if we find serious limitations or awesome alternatives.

@Juanlu001

This comment has been minimized.

Show comment
Hide comment
@Juanlu001

Juanlu001 Oct 12, 2017

Member

Note: depending on time constraints, we might split this in two:

  1. Provide a 3D plotting API, with a matplotlib backend (after #218, it should require few changes)
  2. Change backend to Plotly
Member

Juanlu001 commented Oct 12, 2017

Note: depending on time constraints, we might split this in two:

  1. Provide a 3D plotting API, with a matplotlib backend (after #218, it should require few changes)
  2. Change backend to Plotly
@Juanlu001

This comment has been minimized.

Show comment
Hide comment
@Juanlu001

Juanlu001 Oct 13, 2017

Member

Thanks to the new .sample method, 3D plotting got extremely easy:

screenshot-2017-10-13 untitled

The most complicated part there is... remembering how to create a 3D axes in matplotlib (I always have to look it up 😂)

Plotting a globe is tempting, but we know the the results won't look good in matplotlib. This is totally uncoupled from the 2D simplification being tracked in #218 so I am unblocking this.

Member

Juanlu001 commented Oct 13, 2017

Thanks to the new .sample method, 3D plotting got extremely easy:

screenshot-2017-10-13 untitled

The most complicated part there is... remembering how to create a 3D axes in matplotlib (I always have to look it up 😂)

Plotting a globe is tempting, but we know the the results won't look good in matplotlib. This is totally uncoupled from the 2D simplification being tracked in #218 so I am unblocking this.

@Juanlu001 Juanlu001 added 1 - Ready and removed blocked labels Oct 13, 2017

Juanlu001 added a commit to Juanlu001/poliastro that referenced this issue Oct 24, 2017

WIP: Add simple plot3d method
* No tests
* Still pending some refactoring in plotting
* Should we add a 3D equivalent to OrbitPlotter?

Fix poliastro#22

@wafflebot wafflebot bot added 2 - In Progress and removed 1 - Ready labels Oct 24, 2017

Juanlu001 added a commit to Juanlu001/poliastro that referenced this issue Oct 30, 2017

WIP: Add simple plot3d method
* No tests
* Still pending some refactoring in plotting
* Should we add a 3D equivalent to OrbitPlotter?

Fix poliastro#22

@wafflebot wafflebot bot removed the 2 - In Progress label Nov 15, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment