Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

a functional java applet for 2d plots

3d plotting with jmol is great idea. However, all what I find for 2d plotting generates a picture only. I'd like to have an applet for that which supports cursors, zooming, maybe hiding certain plotted lines and other interactive control elements. Of course, this can be somehow done with @interact, but the applet would work much faster than the link browser-worksheet-sage. At least, an attempt to introduce cursor did not seem to have a handy result:

p1=plot (sin(x))
@interact
def _(b = slider(-1, 1, 0.01, default=0.5, label='cursor')):
   p2=line(((b,-1),(b,1)), color='green')
   show(p1+p2,xmin=-1,xmax=1,ymax=1,ymin=-1)

Does anybody know if there is an easy way to do this, or if there is not, where one may start integrating such an applet into sage? There are a number of open-source graphing applets. Here is the example, maybe, even not the best one.