Re: [sage-support] Re: arrows in 3d field plots
>> Now to try to track down how to set jmol parameters in a web page... I've given up for now on using Sage for this project, as it turns out that Geogebra can accomplish what I need out of the box. For reference, the resulting webpage is: http://math.oregonstate.edu/bridge/ideas/fields Happy to revisit this choice as we start to port these applets into our online book over the next couple of years. Thanks to all for their suggestions. Tevian -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
Re: [sage-support] Re: arrows in 3d field plots
> Hopefully, some day threejs will replace jmol as the default 3d viewer: > https://trac.sagemath.org/ticket/22408 Good, although I reiterate that it does not appear to respect the orientation flag. > Meanwhile, you can define a subdomain of E, U say, where the vector field > is everywhere regular and plot the restriction of the vector field to U. > For your example, U can be E minus the disk x^2+y^2 <= 0.01: ... Yes, that works perfectly; thank you. Now to try to track down how to set jmol parameters in a web page... Tevian -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
Re: [sage-support] Re: arrows in 3d field plots
Le jeudi 31 janvier 2019 06:52:10 UTC+1, Tevian Dray a écrit : > > >> You can use the plot functionality of vector fields on > >> Euclidean spaces to get better arrowheads: > > OK; I can get jmol to work with some browsers, although it is painfully > slow. But the results are very nice. > > Hopefully, some day threejs will replace jmol as the default 3d viewer: https://trac.sagemath.org/ticket/22408 > Finally, is there a simple mechanism to enable Sage to plot vector fields > with singularities, such as a pole at the origin? I've had no luck yet > trying to plot something like: > E.vector_field((-y/(x^2+y^2),x/(x^2+y^2))) > I've tried piecing together nonsingular domains, although I'm possibly not > doing it correctly. But there is surely a more elegant solution, such as > cutting off the vector field at some maximum magnitude. > The cut off should definitely be added to the plot method of vector fields, among many other improvements to be done... Meanwhile, you can define a subdomain of E, U say, where the vector field is everywhere regular and plot the restriction of the vector field to U. For your example, U can be E minus the disk x^2+y^2 <= 0.01: sage: E. = EuclideanSpace() sage: v = E.vector_field((-y/(x^2+y^2),x/(x^2+y^2))) sage: U = E.open_subset('U', coord_def={E.cartesian_coordinates(): x^2+y^2>0.01}) sage: v.restrict(U).plot(max_range=1, scale=0.2) In the above code, "coord_def" stands for the coordinate definition of the open subset U and "v.restrict(U)" is the restriction of v to U. Best wishes, Eric. -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
Re: [sage-support] Re: arrows in 3d field plots
>> You can use the plot functionality of vector fields on >> Euclidean spaces to get better arrowheads: OK; I can get jmol to work with some browsers, although it is painfully slow. But the results are very nice. >> And is there a way to disable the perspective view? >> I want the 2d-view seen from above to look like a with the >> 2d vector field, arrows sitting exactly on top of each other; >> the perspective tries to show them all. I reported this issue with threejs, but it's also present with jmol. Yes, it's possible to eliminate the perspective view interactively, by right-clicking, and unchecking "Perspective Depth" in the Style menu. But I'd like to place these images in final form on a webpage, so I'm looking for a way to encode jmol settings in either Sage or HTML. Is this possible? Finally, is there a simple mechanism to enable Sage to plot vector fields with singularities, such as a pole at the origin? I've had no luck yet trying to plot something like: E.vector_field((-y/(x^2+y^2),x/(x^2+y^2))) I've tried piecing together nonsingular domains, although I'm possibly not doing it correctly. But there is surely a more elegant solution, such as cutting off the vector field at some maximum magnitude. Thanks, Tevian -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
Re: [sage-support] Re: arrows in 3d field plots
>> You can use the plot functionality of vector fields on Euclidean >> spaces to get better arrowheads: Excellent! Thank you! >> You may also replace the last line by >> sage: show(xy, orientation=(0,0,0,0), viewer='threejs') Yes, I had to do that -- jmol froze my browser. I haven't had a chance yet to debug that problem, nor to experiment with parameters. But threejs unfortunately appears to ignore the orientation parameter, which defeats the purpose. And is there a way to disable the perspective view? I want the 2d-view seen from above to look like a 2d vector field, with the arrows sitting exactly on top of each other; the perspective tries to show them all. Again, I haven't had a chance yet myself to debug or explore parameters... Thanks again, Tevian -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
[sage-support] Re: arrows in 3d field plots
On Monday, January 28, 2019 at 4:54:49 AM UTC-5, Eric Gourgoulhon wrote: > > Hi, > > You can use the plot functionality of vector fields on Euclidean spaces to > get better arrowheads: > > sage: E. = EuclideanSpace() > sage: v = E.vector_field((x,y,0)) > sage: xy = v.plot(max_range=1, color='black') > sage: show(xy, orientation=(0,0,0,0)) > > You may also replace the last line by > > sage: show(xy, orientation=(0,0,0,0), viewer='threejs') > > to use threejs instead of jmol. > Wow, that should probably be in the plot documentation (and/or even replace some of the current functionality). -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
[sage-support] Re: arrows in 3d field plots
Hi, You can use the plot functionality of vector fields on Euclidean spaces to get better arrowheads: sage: E. = EuclideanSpace() sage: v = E.vector_field((x,y,0)) sage: xy = v.plot(max_range=1, color='black') sage: show(xy, orientation=(0,0,0,0)) You may also replace the last line by sage: show(xy, orientation=(0,0,0,0), viewer='threejs') to use threejs instead of jmol. More options of the vector field plot functions are described here, especially to control the arrow size are described here: http://doc.sagemath.org/html/en/reference/manifolds/sage/manifolds/differentiable/vectorfield.html#sage.manifolds.differentiable.vectorfield.VectorField.plot Best wishes, Eric. -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
[sage-support] Re: arrows in 3d field plots
Thanks, Tom. So far as I can tell, your examples use "arrowsize" and "width" to control the arrows. But so far as I can tell, those parameters have no effect on 3d plots -- yours are all 2d. Am I missing something? I'm using the SageMathCell server to test; not sure if that affects the answer. Tevian -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
[sage-support] Re: arrows in 3d field plots
You can adjust the arrowheads. Look at http://faculty.sfasu.edu/judsontw/ode/html-20190111/firstlook03.html for some examples. On Sunday, January 27, 2019 at 10:11:47 AM UTC-6, Tevian Dray wrote: > > Can the formatting of arrows in 3d field plots be adjusted? > > I'm trying to make rotatable, 3d versions of 2d field plots. > I can get most of what I want with, say: > > xy=plot_vector_field3d((x,y,0),(x,-1,1),(y,-1,1),(z,-1,1),colors='black') > show(xy,orientation=(0,0,0,0)) > but I'd really like the output to look more like: > plot_vector_field((x,y),(x,-1,1),(y,-1,1)) > In other words, more obvious arrowheads. A bigger plot would also help, > to allow setting plot_points to 20 -- the default for 2d. > > Are the arrows and/or size (easily) configurable? > > Thanks, > Tevian > > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.