3D box plot in python

200 views
Skip to first unread message

Wladimir Lyra

unread,
May 28, 2018, 4:02:55 PM5/28/18
to pencil-co...@googlegroups.com
Hi folks, 

Do we have a python equivalent to rvid_box.pro to plot the 3D box? 

Cheers,
Wlad

SimonC (Iomsn)

unread,
May 29, 2018, 10:12:12 AM5/29/18
to pencil-code-discuss
Hi Wlad,

Do you mean the usual Brandenburgesque plots of the box boundaries as a 3d cube? Like in Fig. 5.7 (10.1016/j.physrep.2005.06.005)? If so, we do not have that at the moment. But should not be difficult to implement. Do you think there is a demand?

Simon

Frederick Gent

unread,
May 29, 2018, 11:13:43 AM5/29/18
to pencil-co...@googlegroups.com
Yes there is a demand :-)
--
You received this message because you are subscribed to the Google Groups "pencil-code-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pencil-code-dis...@googlegroups.com.
To post to this group, send email to pencil-co...@googlegroups.com.
Visit this group at https://groups.google.com/group/pencil-code-discuss.
For more options, visit https://groups.google.com/d/optout.

Wladimir Lyra

unread,
May 29, 2018, 12:30:10 PM5/29/18
to pencil-co...@googlegroups.com
Yes there is a demand :-)

SimonC (Iomsn)

unread,
May 29, 2018, 2:37:27 PM5/29/18
to pencil-code-discuss
OK. Will see how to implement it. But will be in pencilnew with consistent documentation, objects and python3/2 compatibility. If anyone likes to contribute or start?


On Tuesday, May 29, 2018 at 5:30:10 PM UTC+1, Wladimir Lyra wrote:
Yes there is a demand :-)

On Tue, May 29, 2018 at 8:13 AM Frederick Gent <fred.g...@gmail.com> wrote:
Yes there is a demand :-)


On 2018-05-29 17:12, 'SimonC (Iomsn)' via pencil-code-discuss wrote:
Hi Wlad,

Do you mean the usual Brandenburgesque plots of the box boundaries as a 3d cube? Like in Fig. 5.7 (10.1016/j.physrep.2005.06.005)? If so, we do not have that at the moment. But should not be difficult to implement. Do you think there is a demand?

Simon


On Monday, May 28, 2018 at 9:02:55 PM UTC+1, Wladimir Lyra wrote:
Hi folks, 

Do we have a python equivalent to rvid_box.pro to plot the 3D box? 

Cheers,
Wlad

--
You received this message because you are subscribed to the Google Groups "pencil-code-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pencil-code-discuss+unsub...@googlegroups.com.

To post to this group, send email to pencil-co...@googlegroups.com.
Visit this group at https://groups.google.com/group/pencil-code-discuss.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "pencil-code-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pencil-code-discuss+unsub...@googlegroups.com.

Chao-Chin Yang

unread,
May 30, 2018, 11:02:20 AM5/30/18
to pencil-code-discuss
I tried it some time ago, but gave up in the end.  The mplot3d toolkit is toooooo slow.  It is doable, but you need to be prepared for a few days to generate one animation.

I requested a feature update to matplotlib, but no developer wants to pick it up yet.  There is still difficulty for them to straighten out the backbone of 3D transformations.  See the discussion thread here.

Sincerely,
Chao-Chin

SimonC (Iomsn)

unread,
May 31, 2018, 4:31:25 AM5/31/18
to pencil-code-discuss
Hi Chao-Chin,

glad to hear you gave it a try. I think all the functionalities are already in matplotlib. One "just" needs to produce some sort of imshow and transform it into a diamond shape, or parallelogram to get the box shape. Mplot produces vector graphics, so I can imagine that it might be slow when plotting images of size 512x512.
Can anyone using IDL post an example on whet such a plot should look like? Or a reference to a figure in a paper.

Cheers

Simon

Wladimir Lyra

unread,
May 31, 2018, 12:54:27 PM5/31/18
to pencil-co...@googlegroups.com
Hi Simon

It should look like the plots in attachment. This fig is particular is fig 11 from Lyra & Klahr 2011 http://adsabs.harvard.edu/abs/2011A%26A...527A.138L

IDL's rvid_box uses the procedure boxbotex_scl.pro, which, if I recall, uses polyfill with the field as the pattern.

--
You received this message because you are subscribed to the Google Groups "pencil-code-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pencil-code-discuss+unsub...@googlegroups.com.
To post to this group, send email to pencil-code-discuss@googlegroups.com.
Screen Shot 2018-05-31 at 9.50.55 AM.png

Chao-Chin Yang

unread,
May 31, 2018, 12:54:50 PM5/31/18
to pencil-code-discuss
Hi Simon,

Yes, it should be fast for imshow, or pcolormesh, to be skewed, as many other plot functions that can accept the keyword “projection” supported by mplot3d.  However, the objects returned by either imshow (AxesImage) or pcolormesh (QuadMesh) are not ready to be put into coordinate transformation like projection.

It would be awesome if you could make this work.  Please also send your solution to matplotlib for them to include into mplot3d.

Sincerely,

Chao-Chin Yang
Postdoctoral Scholar
Department of Physics and Astronomy
University of Nevada, Las Vegas, U.S.A.



--
You received this message because you are subscribed to a topic in the Google Groups "pencil-code-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pencil-code-discuss/ZG5-j9oUGNI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pencil-code-dis...@googlegroups.com.

Wenyin Wei

unread,
Nov 20, 2018, 7:52:56 AM11/20/18
to pencil-code-discuss
Hi Simon,

3D box animation is an powerful tool to visualize what procedure is happening. This discussion has stopped since June 1st. Could I ask about the current situation of this python function?  It would be really helpful to show what changes during the simulation.

Sincerely,
Wenyin

SimonC (Iomsn)

unread,
Nov 21, 2018, 10:26:23 AM11/21/18
to pencil-code-discuss
Hi Wenyin,

currently we have an interactive tool for plotting slices/tomography. It's in visu/animate_interactive. You can use that for some ideas about how to create the typical PencilCode box plot in python. If you have any questions about that routine, you can just ask me.

Cheers

Simon
Reply all
Reply to author
Forward
0 new messages