Hi, everybody
Having a little problem here in defining thickness and color of plot
objects.
Any help would be great!
I'm running Python 2.5.2 with EPD with Py2.5 4.0.30002
I need to plot three simpe things, in 3d, domain is x, y in [0,3] x
[0,3:
1. the graph of the function f(x,y) = x**(0.3) * y**(0.7)
2. the parametric straight line (x, 2 - 2*x, 0) for x in [0,1]
3. the parametric curve (x, 2 - 2*x, f(x, 2 - 2*x))
The code I have below works fine. However, I need to highlight 2 and 3
(the
parametric line and curve), with a thicker trace and a different color
(say,
solid red). I couldn't figure out how to do that.
Any ideas?
###########################################
#!/usr/env python
from sympy import var, Plot, solve
var('x y z')
# Auxiliary defs and functions
def u(x, y):
return x**(0.3) * y**(0.7)
def budget(x, y):
return 2*x + y - 2
def ybudget(x):
return solve(budget(x, y), y)[0]
# Graph
p = Plot(visible=False)
utility_graph = u(x, y), [x, 0, 3], [y, 0, 3]
budget_graph = (x, ybudget(x), 0, [x, 0, 1])
consutil_graph = (x, ybudget(x), u(x, ybudget(x)))
p[1] = utility_graph
p[2] = budget_graph
p[3] = consutil_graph
p.show()
print("p.close() to close it.")
###########################################
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sympy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/sympy?hl=en
-~----------~----~----~----~------~----~------~--~---