Differences between revisions 14 and 24 (spanning 10 versions)
Revision 14 as of 2010-02-17 12:41:32
Size: 14042
Editor: JavierPérez
Comment:
Revision 24 as of 2020-06-02 15:13:32
Size: 14300
Editor: kcrisman
Comment:
Deletions are marked like this. Additions are marked like this.
Line 9: Line 9:
{{{ {{{#!sagecell
Line 11: Line 11:
from math import cos,sin
Line 13: Line 12:
    from math import cos, sin
Line 51: Line 51:
{{{ {{{#!sagecell
Line 107: Line 107:
        print "Bug selecting plot?"         print("Bug selecting plot?")
Line 111: Line 111:
    html('<h2>%s</h2>'%example)     pretty_print(html('<h2>%s</h2>'%example))
Line 113: Line 113:
        html('<h3><a target="_new" href="%s">%s</a></h3>'%(url,url))
    show(P, viewer='tachyon' if tachyon else 'jmol', frame=frame)
        pretty_print(html('<h3><a target="_new" href="%s">%s</a></h3>'%(url,url)))
    show(P, viewer='tachyon' if tachyon else 'threejs', frame=frame)
Line 121: Line 121:
{{{ {{{#!sagecell
Line 134: Line 134:
{{{ {{{#!sagecell
Line 145: Line 145:
         viewer='tachyon' if tachyon else 'jmol',          viewer='tachyon' if tachyon else 'threejs',
Line 157: Line 157:
{{{ {{{#!sagecell
Line 163: Line 163:
@interact
def _(band_number = selector(range(1,5)), current_color = Color('red')):

@interact
def _(band_number = selector(range(1,5)), current_color = Color('red'), auto_update=False):
Line 174: Line 175:
{{{
@interact
def color_experimenter(expression=input_box('', 'Expression', str), color=Color('red')):
{{{#!sagecell
@interact
def color_experimenter(expression=input_box('x^2', 'Expression', str), color=Color('red')):
Line 181: Line 182:
            print "There's a problem with your expression."             print("There's a problem with your expression.")
    else:
        print("Be sure to enter a plottable expression")
Line 185: Line 188:
== Interactive 2d Plotting == == Interactive 2D Plotting ==
Line 187: Line 190:
{{{ {{{#!sagecell
Line 189: Line 192:
    print '<html><p style="font-family:Arial, sans-serif;color:#000"><span style="color:red;font-weight:bold">Error</span>: %s</p></html>' % msg     pretty_print(html('<p style="font-family:Arial, sans-serif;color:#000"><span style="color:red;font-weight:bold">Error</span>: %s</p>' % msg))
Line 197: Line 200:
            print error_msg('This is not an expression.')             print(error_msg('This is not an expression.'))
Line 202: Line 205:
                    print "var('%s')\nplot(%s).show(%s%s%s)" % (expression.variables()[0], repr(expression), 'aspect_ratio=1' if square else '', ', ' if square and not axes else '', 'axes=False' if not axes else '')                     print("var('%s')\nplot(%s).show(%s%s%s)" % (expression.variables()[0], repr(expression), 'aspect_ratio=1' if square else '', ', ' if square and not axes else '', 'axes=False' if not axes else ''))
Line 208: Line 211:
                    print "var('%s')\nplot(%s)" % (expression.variables()[0], repr(expression))                     print("var('%s')\nplot(%s)" % (expression.variables()[0], repr(expression)))
Line 211: Line 214:
            print error_msg('This expression has more than one variable.')             print(error_msg('This expression has more than one variable.'))
Line 214: Line 217:
            print error_msg("This expression contains an unknown function.")             print(error_msg("This expression contains an unknown function."))
Line 220: Line 223:
{{{ {{{#!sagecell
Line 241: Line 244:
{{{ {{{#!sagecell
Line 250: Line 253:
html('<h1><center>Spirograph</center></h1>') pretty_print(html('<h1><center>Spirograph</center></h1>'))
Line 272: Line 275:
    if h=='hypotrochoid' and (b>=1 or b<=0):
        print "In a hypotrochoid, radius must be between 0 and 1."
        draw=False
    if h=='epitrochoid' and b<=0:
        print "In a epitrochoid, radius must be positive"
    if h == 'hypotrochoid' and (b >= 1 or b <= 0):
        print("In a hypotrochoid, radius must be between 0 and 1.")
        draw = False
    if h == 'epitrochoid' and b <= 0:
        print("In a epitrochoid, radius must be positive")

Sage Interactions - Graphics

goto interact main page

Curves of Pursuit

by Marshall Hampton.

pcurves.png

Catalog of 3D Parametric Plots

parametricplot3d.png

Interactive rotatable raytracing with Tachyon3d

tachyonrotate.png

Interactive 3d plotting

tachyonplot3d.png

Somewhat Silly Egg Painter

by Marshall Hampton (refereed by William Stein)

eggpaint.png

Plot Coloring

by Timothy Clemans

color_of_plot_changer.png

Interactive 2D Plotting

by Timothy Clemans

interactive_2d_plotting.png

Interact with matplotlib

matplotlib_interact.png

Spirograph

interactive_animate_spirograph.png

interact/graphics (last edited 2020-06-02 15:13:32 by kcrisman)