<sagecell> var('x,y') #first declare your variables
- We now create each graph one by one.
- We'll name the first plot "p" and then use += to add each equation to the same plot.
p=implicit_plot(x+.7*y==110,(x,0,140),(y,0,140)) #This adds the cookie dough constraint. p+=implicit_plot(.4*y==32,(x,0,140),(y,0,140),color='red') #This adds the icing constraint. p+=implicit_plot(x+y==140,(x,0,140),(y,0,140),color='green') #This adds the baking constraint. p+=implicit_plot(.1*x+.15*y==15,(x,0,140),(y,0,140),color='orange')#This adds the prep time constraint.
- If you want to add more plots, then use "p+=" and then add your plot. Use implicit_plot if you don't want to
- After you're finished adding plots, use show(p) to have the computer draw your work.
show(p)
</sagecell>