@@ -257,48 +257,93 @@ def plot_implicit(expr, x_var=None, y_var=None, adaptive=True, depth=0,
257
257
258
258
Plot expressions:
259
259
260
- >>> from sympy import plot_implicit, cos, sin, symbols, Eq, And
261
- >>> x, y = symbols('x y')
260
+ .. plot::
261
+ :context: reset
262
+ :format: doctest
263
+ :include-source: True
262
264
263
- Without any ranges for the symbols in the expression
265
+ >>> from sympy import plot_implicit, cos, sin, symbols, Eq, And
266
+ >>> x, y = symbols('x y')
264
267
265
- >>> p1 = plot_implicit(Eq(x**2 + y**2, 5))
268
+ Without any ranges for the symbols in the expression:
266
269
267
- With the range for the symbols
270
+ .. plot::
271
+ :context: close-figs
272
+ :format: doctest
273
+ :include-source: True
268
274
269
- >>> p2 = plot_implicit(Eq(x**2 + y**2, 3),
270
- ... (x, -3, 3), (y, -3, 3))
275
+ >>> plot_implicit(Eq(x**2 + y**2, 5))
271
276
272
- With depth of recursion as argument.
277
+ With the range for the symbols:
273
278
274
- >>> p3 = plot_implicit(Eq(x**2 + y**2, 5),
275
- ... (x, -4, 4), (y, -4, 4), depth = 2)
279
+ .. plot::
280
+ :context: close-figs
281
+ :format: doctest
282
+ :include-source: True
276
283
277
- Using mesh grid and not using adaptive meshing.
284
+ >>> plot_implicit(Eq(x**2 + y**2, 3), (x, -3, 3), (y, -3, 3))
278
285
279
- >>> p4 = plot_implicit(Eq(x**2 + y**2, 5),
280
- ... (x, -5, 5), (y, -2, 2), adaptive=False)
286
+ With depth of recursion as argument:
281
287
282
- Using mesh grid with number of points as input.
288
+ .. plot::
289
+ :context: close-figs
290
+ :format: doctest
291
+ :include-source: True
283
292
284
- >>> p5 = plot_implicit(Eq(x**2 + y**2, 5),
285
- ... (x, -5, 5), (y, -2, 2),
286
- ... adaptive=False, points=400)
293
+ >>> plot_implicit(
294
+ ... Eq(x**2 + y**2, 5), (x, -4, 4), (y, -4, 4), depth = 2)
287
295
288
- Plotting regions.
296
+ Using mesh grid and not using adaptive meshing:
289
297
290
- >>> p6 = plot_implicit(y > x**2)
298
+ .. plot::
299
+ :context: close-figs
300
+ :format: doctest
301
+ :include-source: True
291
302
292
- Plotting Using boolean conjunctions.
303
+ >>> p4 = plot_implicit(
304
+ ... Eq(x**2 + y**2, 5), (x, -5, 5), (y, -2, 2),
305
+ ... adaptive=False)
293
306
294
- >>> p7 = plot_implicit(And(y > x, y > -x))
307
+ Using mesh grid without using adaptive meshing with number of points
308
+ specified:
309
+
310
+ .. plot::
311
+ :context: close-figs
312
+ :format: doctest
313
+ :include-source: True
314
+
315
+ >>> p5 = plot_implicit(
316
+ ... Eq(x**2 + y**2, 5), (x, -5, 5), (y, -2, 2),
317
+ ... adaptive=False, points=400)
318
+
319
+ Plotting regions:
320
+
321
+ .. plot::
322
+ :context: close-figs
323
+ :format: doctest
324
+ :include-source: True
325
+
326
+ >>> p6 = plot_implicit(y > x**2)
327
+
328
+ Plotting Using boolean conjunctions:
329
+
330
+ .. plot::
331
+ :context: close-figs
332
+ :format: doctest
333
+ :include-source: True
334
+
335
+ >>> p7 = plot_implicit(And(y > x, y > -x))
295
336
296
337
When plotting an expression with a single variable (y - 1, for example),
297
338
specify the x or the y variable explicitly:
298
339
299
- >>> p8 = plot_implicit(y - 1, y_var=y)
300
- >>> p9 = plot_implicit(x - 1, x_var=x)
340
+ .. plot::
341
+ :context: close-figs
342
+ :format: doctest
343
+ :include-source: True
301
344
345
+ >>> p8 = plot_implicit(y - 1, y_var=y)
346
+ >>> p9 = plot_implicit(x - 1, x_var=x)
302
347
"""
303
348
has_equality = False # Represents whether the expression contains an Equality,
304
349
#GreaterThan or LessThan
0 commit comments