Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Here is a py func for plotting entirely different functions in different colors on the same graph, for comparison. example: multiplot(x^4,4x^3,13+x^-2,sin(4x)) comes out nicely. You can change the defaults if the graph looks funny.

def multiplot(*funcs,leftx=-10,rightx=10,ymin=-20,ymax=20,aspect_ratio="automatic"):
    """Plot multiple math objects. Reasonable defaults - reset if the graph looks funny"""
    K=Graphics()
    a = plot(funcs,leftx,rightx,aspect_ratio=aspect_ratio,ymax=ymax,ymin=ymin,
             legend_label=" ")
    K += a
    show(K)
    K=plot(0)

Here is a py func for plotting entirely different functions in different colors on the same graph, for comparison. example: multiplot(x^4,4x^3,13+x^-2,sin(4x)) comes out nicely. You can change the defaults if the graph looks funny.funny. Legend colors from top to bottom differentiate the funcs plotted, from right to left.

def multiplot(*funcs,leftx=-10,rightx=10,ymin=-20,ymax=20,aspect_ratio="automatic"):
    """Plot multiple math objects. Reasonable defaults - reset if the graph looks funny"""
    K=Graphics()
    a = plot(funcs,leftx,rightx,aspect_ratio=aspect_ratio,ymax=ymax,ymin=ymin,
             legend_label=" ")
    K += a
    show(K)
    K=plot(0)

Here is a py func for plotting entirely different functions in different colors on the same graph, for comparison. example: multiplot(x^4,4x^3,13+x^-2,sin(4x)) comes out nicely. You can change the defaults if the graph looks funny. Legend colors from top to bottom differentiate the funcs plotted, from right to left.

def multiplot(*funcs,leftx=-10,rightx=10,ymin=-20,ymax=20,aspect_ratio="automatic"):
    """Plot multiple math objects. Reasonable defaults - reset if the graph looks funny"""
    K=Graphics()
    a = plot(funcs,leftx,rightx,aspect_ratio=aspect_ratio,ymax=ymax,ymin=ymin,
             legend_label=" ")
    K += return a
    show(K)
    K=plot(0)

Here is a py func for plotting entirely different functions in different colors on the same graph, for comparison. example: multiplot(x^4,4x^3,13+x^-2,sin(4x)) comes out nicely. You can change the defaults if the graph looks funny. Legend colors from top to bottom differentiate the funcs plotted, from right to left.

def multiplot(*funcs,leftx=-10,rightx=10,ymin=-20,ymax=20,aspect_ratio="automatic"):
    """Plot multiple math objects. Reasonable defaults - reset if the graph looks funny"""
    K=Graphics()
    a = plot(funcs,leftx,rightx,aspect_ratio=aspect_ratio,ymax=ymax,ymin=ymin,
             legend_label=" ")
    return a

Here is a py func for plotting entirely different functions in different colors on the same graph, for comparison. example: multiplot(x^4,4x^3,13+x^-2,sin(4x)) comes out nicely. You can change the defaults if the graph looks funny. Legend colors from top to bottom differentiate the funcs plotted, from right to left.

def multiplot(*funcs,leftx=-10,rightx=10,ymin=-20,ymax=20,aspect_ratio="automatic"):
    """Plot multiple math objects. Reasonable defaults - reset if the graph looks funny"""
    K=Graphics()
    a = plot(funcs,leftx,rightx,aspect_ratio=aspect_ratio,ymax=ymax,ymin=ymin,
             legend_label=" ")
    return a

Here is a py func for plotting entirely different functions in different colors on the same graph, for comparison. example: multiplot(x^4,4x^3,13+x^-2,sin(4x)) comes out nicely. You can change the defaults if the graph looks funny. Legend colors from top to bottom differentiate the funcs plotted, from right left to left.right.

def multiplot(*funcs,leftx=-10,rightx=10,ymin=-20,ymax=20,aspect_ratio="automatic"):
    """Plot multiple math objects. Reasonable defaults - reset if the graph looks funny"""
    a = plot(funcs,leftx,rightx,aspect_ratio=aspect_ratio,ymax=ymax,ymin=ymin,
             legend_label=" ")
    return a

Here is a py func for plotting entirely different functions in different colors on the same graph, for comparison. example: multiplot(x^4,4x^3,13+x^-2,sin(4x)) comes out nicely. You can change the defaults if the graph looks funny. Legend colors from top to bottom differentiate the funcs plotted, from left to right.

def multiplot(*funcs,leftx=-10,rightx=10,ymin=-20,ymax=20,aspect_ratio="automatic"):
    """Plot multiple math objects. Reasonable defaults - reset if the graph looks funny"""
funny.
    Legend colors from top to bottom differentiate the funcs plotted, from left to right."""
    a = plot(funcs,leftx,rightx,aspect_ratio=aspect_ratio,ymax=ymax,ymin=ymin,
             legend_label=" ")
    return a

Here is a py func for plotting entirely different functions in different colors on the same graph, for comparison. example: multiplot(x^4,4x^3,13+x^-2,sin(4x)) multiplot(x^4,4*x^3,13+x^-2,sin(4*x)) comes out nicely. You can change the defaults if the graph looks funny. Legend colors from top to bottom differentiate the funcs plotted, from left to right.

def multiplot(*funcs,leftx=-10,rightx=10,ymin=-20,ymax=20,aspect_ratio="automatic"):
    """Plot multiple math objects. Reasonable defaults - reset if the graph looks funny.
    Legend colors from top to bottom differentiate the funcs plotted, from left to right."""
    a = plot(funcs,leftx,rightx,aspect_ratio=aspect_ratio,ymax=ymax,ymin=ymin,
             legend_label=" ")
    return a