# HG changeset patch
# User Jason Grout <jason-sage@creativetrax.com>
# Date 1203547569 21600
# Node ID 1748eee29fc9653c165e5db933934f9461c66a70
# Parent 8d54924196479b30c9b98d6da95e7ec76fab00f3
imported patch plot_fix_endpoints.patch
diff -r 8d5492419647 -r 1748eee29fc9 sage/plot/plot.py
|
a
|
b
|
|
| 3321 | 3321 | We can change the line style to one of '--' (dashed), '-.' (dash dot), |
| 3322 | 3322 | '-' (solid), 'steps', ':' (dotted): |
| 3323 | 3323 | sage: plot(sin(x), 0, 10, linestyle='-.') |
| | 3324 | |
| | 3325 | TESTS: |
| | 3326 | We do not randomize the endpoints: |
| | 3327 | sage: p = plot(x, (x,-1,1)) |
| | 3328 | sage: p[0].xdata[0] == -1 |
| | 3329 | True |
| | 3330 | sage: p[0].xdata[-1] == 1 |
| | 3331 | True |
| | 3332 | |
| 3324 | 3333 | """ |
| 3325 | 3334 | def _reset(self): |
| 3326 | 3335 | o = self.options |
| … |
… |
|
| 3402 | 3411 | exceptions = 0; msg='' |
| 3403 | 3412 | for i in range(plot_points): |
| 3404 | 3413 | xi = xmin + i*delta |
| 3405 | | if i < plot_points: |
| | 3414 | # Slightly randomize points except for the first and last |
| | 3415 | if i > 0 and i < plot_points-1: |
| 3406 | 3416 | xi += delta*random.random() |
| 3407 | 3417 | if xi > xmax: |
| 3408 | 3418 | xi = xmax |
| 3409 | | else: |
| | 3419 | elif i == plot_points-1: |
| 3410 | 3420 | xi = xmax # guarantee that we get the last point. |
| 3411 | 3421 | |
| 3412 | 3422 | try: |