Changeset 7799:8971fdeaf8a4
- Timestamp:
- 12/08/07 19:02:37 (6 years ago)
- Branch:
- default
- File:
-
- 1 edited
-
sage/plot/plot.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sage/plot/plot.py
r7676 r7799 127 127 ... 128 128 sage: P.show(ymin=-pi,ymax=pi) 129 130 PYX EXAMPLES: 131 These are some examples of plots similar to some of the plots in the 132 PyX (http://pyx.sourceforge.net) documentation: 133 134 Symbolline: 135 sage: y(x) = x*sin(x**2) 136 sage: v = [(x, y(x)) for x in [-3,-2.95,..,3]] 137 sage: show(points(v, rgbcolor=(0.2,0.6, 0.1), pointsize=30) + plot(spline(v), -3.1, 3)) 138 139 Cycliclink: 140 sage: x = var('x') 141 sage: g1 = plot(cos(20*x)*exp(-2*x), 0, 1) 142 sage: g2 = plot(2*exp(-30*x) - exp(-3*x), 0, 1) 143 sage: show(graphics_array([g1, g2], 2, 1), xmin=0) 144 145 Pi Axis: 146 In the PyX manual, the point of this example is to show labeling the 147 X-axis using rational multiples of Pi. Sage currently has no support 148 for controlling how the ticks on the x and y axes are labeled, so 149 this is really a bad example: 150 151 sage: g1 = plot(sin(x), 0, 2*pi) 152 sage: g2 = plot(cos(x), 0, 2*pi, linestyle = "--") 153 sage: show(g1 + g2) 154 155 An illustration of integration: 156 sage: def f(x): return (x-3)*(x-5)*(x-7)+40 157 sage: P = line([(2,0),(2,f(2))], rgbcolor=(0,0,0)) 158 sage: P += line([(8,0),(8,f(8))], rgbcolor=(0,0,0)) 159 sage: P += polygon([(2,0),(2,f(2))] + [(x, f(x)) for x in [2,2.1,..,8]] + [(8,0),(2,0)], rgbcolor=(0.8,0.8,0.8)) 160 sage: P += text("$\\int_{a}^b f(x) dx$", (5, 20), fontsize=16, rgbcolor=(0,0,0)) 161 sage: P += plot(f, 1, 8.5, thickness=3) 162 sage: show(P) 129 163 130 164 AUTHORS:
Note: See TracChangeset
for help on using the changeset viewer.
