|
64 | 64 |
|
65 | 65 | Since it has only two variables, we can solve it graphically::
|
66 | 66 |
|
67 |
| - sage: P.plot() |
| 67 | + sage: P.plot() # optional - sage.plot |
68 | 68 | Graphics object consisting of 19 graphics primitives
|
69 | 69 |
|
70 | 70 |
|
|
182 | 182 | from copy import copy
|
183 | 183 |
|
184 | 184 | from sage.misc.abstract_method import abstract_method
|
185 |
| -from sage.geometry.all import Polyhedron |
| 185 | +from sage.geometry.polyhedron.constructor import Polyhedron |
186 | 186 | from sage.matrix.special import column_matrix
|
187 | 187 | from sage.matrix.special import identity_matrix
|
188 | 188 | from sage.matrix.constructor import Matrix as matrix
|
@@ -1534,19 +1534,19 @@ def plot(self, *args, **kwds):
|
1534 | 1534 | sage: b = (1000, 1500)
|
1535 | 1535 | sage: c = (10, 5)
|
1536 | 1536 | sage: P = InteractiveLPProblem(A, b, c, ["C", "B"], variable_type=">=")
|
1537 |
| - sage: p = P.plot() |
1538 |
| - sage: p.show() |
| 1537 | + sage: p = P.plot() # optional - sage.plot |
| 1538 | + sage: p.show() # optional - sage.plot |
1539 | 1539 |
|
1540 | 1540 | In this case the plot works better with the following axes ranges::
|
1541 | 1541 |
|
1542 |
| - sage: p = P.plot(0, 1000, 0, 1500) |
1543 |
| - sage: p.show() |
| 1542 | + sage: p = P.plot(0, 1000, 0, 1500) # optional - sage.plot |
| 1543 | + sage: p.show() # optional - sage.plot |
1544 | 1544 |
|
1545 | 1545 | TESTS:
|
1546 | 1546 |
|
1547 | 1547 | We check that zero objective can be dealt with::
|
1548 | 1548 |
|
1549 |
| - sage: InteractiveLPProblem(A, b, (0, 0), ["C", "B"], variable_type=">=").plot() |
| 1549 | + sage: InteractiveLPProblem(A, b, (0, 0), ["C", "B"], variable_type=">=").plot() # optional - sage.plot |
1550 | 1550 | Graphics object consisting of 8 graphics primitives
|
1551 | 1551 | """
|
1552 | 1552 | FP = self.plot_feasible_set(*args, **kwds)
|
@@ -1611,13 +1611,13 @@ def plot_feasible_set(self, xmin=None, xmax=None, ymin=None, ymax=None,
|
1611 | 1611 | sage: b = (1000, 1500)
|
1612 | 1612 | sage: c = (10, 5)
|
1613 | 1613 | sage: P = InteractiveLPProblem(A, b, c, ["C", "B"], variable_type=">=")
|
1614 |
| - sage: p = P.plot_feasible_set() |
1615 |
| - sage: p.show() |
| 1614 | + sage: p = P.plot_feasible_set() # optional - sage.plot |
| 1615 | + sage: p.show() # optional - sage.plot |
1616 | 1616 |
|
1617 | 1617 | In this case the plot works better with the following axes ranges::
|
1618 | 1618 |
|
1619 |
| - sage: p = P.plot_feasible_set(0, 1000, 0, 1500) |
1620 |
| - sage: p.show() |
| 1619 | + sage: p = P.plot_feasible_set(0, 1000, 0, 1500) # optional - sage.plot |
| 1620 | + sage: p.show() # optional - sage.plot |
1621 | 1621 | """
|
1622 | 1622 | if self.n() != 2:
|
1623 | 1623 | raise ValueError("only problems with 2 variables can be plotted")
|
|
0 commit comments