@@ -1763,7 +1763,7 @@ def b(n): return lambda x: bessel_J(n, x) + 0.5*(n-1)
1763
1763
1764
1764
.. PLOT::
1765
1765
1766
- g = plot(sin(pi*x), (x, -8, 8), ticks=[[-7,-3,0,3,7],[-1/2,0,1/2]])
1766
+ g = plot(sin(pi*x), (x, -8, 8), ticks=[[-7,-3,0,3,7], [-1/2,0,1/2]])
1767
1767
sphinx_plot(g)
1768
1768
1769
1769
::
@@ -1799,7 +1799,7 @@ def b(n): return lambda x: bessel_J(n, x) + 0.5*(n-1)
1799
1799
1800
1800
.. PLOT::
1801
1801
1802
- g = plot(x**2, (x,0,3), ticks=[[1,2.5],[0.5,1,2]], tick_formatter=[["$x_1$","$x_2$"],["$y_1$","$y_2$","$y_3$"]])
1802
+ g = plot(x**2, (x,0,3), ticks=[[1,2.5],[0.5,1,2]], tick_formatter=[["$x_1$","$x_2$"], ["$y_1$","$y_2$","$y_3$"]])
1803
1803
sphinx_plot(g)
1804
1804
1805
1805
You can force Type 1 fonts in your figures by providing the relevant
@@ -1891,7 +1891,7 @@ def f(x): return (floor(x)+0.5) / (1-(x-0.5)**2)
1891
1891
1892
1892
sage: plot(arcsec(x/2), -2, 2) # plot should be empty; no valid points
1893
1893
Graphics object consisting of 0 graphics primitives
1894
- sage: plot(sqrt(x^2- 1), -2, 2) # [-1, 1] is excluded automatically
1894
+ sage: plot(sqrt(x^2 - 1), -2, 2) # [-1, 1] is excluded automatically
1895
1895
Graphics object consisting of 2 graphics primitives
1896
1896
1897
1897
.. PLOT::
@@ -2573,7 +2573,7 @@ def parametric_plot(funcs, *args, **kwargs):
2573
2573
is 1, so that circles look like circles. ::
2574
2574
2575
2575
sage: t = var('t')
2576
- sage: parametric_plot( (cos(t), sin(t)), (t, 0, 2*pi))
2576
+ sage: parametric_plot((cos(t), sin(t)), (t, 0, 2*pi))
2577
2577
Graphics object consisting of 1 graphics primitive
2578
2578
2579
2579
.. PLOT::
@@ -2613,23 +2613,25 @@ def parametric_plot(funcs, *args, **kwargs):
2613
2613
2614
2614
.. PLOT::
2615
2615
2616
- t =var('t')
2616
+ t = var('t')
2617
2617
g = parametric_plot((t, t**2), (t, -4, 4), fill=True)
2618
2618
sphinx_plot(g)
2619
2619
2620
2620
A filled Hypotrochoid::
2621
2621
2622
- sage: parametric_plot([cos(x) + 2 * cos(x/4), sin(x) - 2 * sin(x/4)], (x,0, 8*pi), fill=True)
2622
+ sage: parametric_plot([cos(x) + 2 * cos(x/4), sin(x) - 2 * sin(x/4)],
2623
+ ....: (x, 0, 8*pi), fill=True)
2623
2624
Graphics object consisting of 2 graphics primitives
2624
2625
2625
2626
.. PLOT::
2626
2627
2627
- g = parametric_plot([cos(x) + 2 * cos(x/4), sin(x) - 2 * sin(x/4)], (x,0, 8*pi), fill=True)
2628
+ g = parametric_plot([cos(x) + 2 * cos(x/4), sin(x) - 2 * sin(x/4)], (x, 0, 8*pi), fill=True)
2628
2629
sphinx_plot(g)
2629
2630
2630
2631
::
2631
2632
2632
- sage: parametric_plot( (5*cos(x), 5*sin(x), x), (x,-12, 12), plot_points=150, color="red") # long time
2633
+ sage: parametric_plot((5*cos(x), 5*sin(x), x), (x, -12, 12), # long time
2634
+ ....: plot_points=150, color="red")
2633
2635
Graphics3d Object
2634
2636
2635
2637
.. PLOT::
@@ -2829,7 +2831,8 @@ def polar_plot(funcs, *args, **kwds):
2829
2831
2830
2832
Fill the area between two functions::
2831
2833
2832
- sage: polar_plot(cos(4*x) + 1.5, 0, 2*pi, fill=0.5 * cos(4*x) + 2.5, fillcolor='orange')
2834
+ sage: polar_plot(cos(4*x) + 1.5, 0, 2*pi, fill=0.5 * cos(4*x) + 2.5,
2835
+ ....: fillcolor='orange')
2833
2836
Graphics object consisting of 2 graphics primitives
2834
2837
2835
2838
.. PLOT::
@@ -2839,7 +2842,8 @@ def polar_plot(funcs, *args, **kwds):
2839
2842
2840
2843
Fill the area between several spirals::
2841
2844
2842
- sage: polar_plot([(1.2+k*0.2)*log(x) for k in range(6)], 1, 3 * pi, fill={0: [1], 2: [3], 4: [5]})
2845
+ sage: polar_plot([(1.2+k*0.2)*log(x) for k in range(6)], 1, 3 * pi,
2846
+ ....: fill={0: [1], 2: [3], 4: [5]})
2843
2847
Graphics object consisting of 9 graphics primitives
2844
2848
2845
2849
.. PLOT::
@@ -2895,7 +2899,7 @@ def list_plot(data, plotjoined=False, **kwargs):
2895
2899
2896
2900
EXAMPLES::
2897
2901
2898
- sage: list_plot([i^2 for i in range(5)]) # long time
2902
+ sage: list_plot([i^2 for i in range(5)]) # long time
2899
2903
Graphics object consisting of 1 graphics primitive
2900
2904
2901
2905
.. PLOT::
@@ -3008,7 +3012,9 @@ def list_plot(data, plotjoined=False, **kwargs):
3008
3012
sage: list_plot(x_coords, y_coords)
3009
3013
Traceback (most recent call last):
3010
3014
...
3011
- TypeError: The second argument 'plotjoined' should be boolean (True or False). If you meant to plot two lists 'x' and 'y' against each other, use 'list_plot(list(zip(x,y)))'.
3015
+ TypeError: The second argument 'plotjoined' should be boolean (True or False).
3016
+ If you meant to plot two lists 'x' and 'y' against each other,
3017
+ use 'list_plot(list(zip(x,y)))'.
3012
3018
3013
3019
Dictionaries with numeric keys and values can be plotted::
3014
3020
@@ -3055,12 +3061,12 @@ def list_plot(data, plotjoined=False, **kwargs):
3055
3061
3056
3062
Instead this will work. We drop the point `(0,1)`.::
3057
3063
3058
- sage: list_plot(list(zip(range(1,len(yl)), yl[1:])), scale='loglog') # long time
3064
+ sage: list_plot(list(zip(range(1,len(yl)), yl[1:])), scale='loglog') # long time
3059
3065
Graphics object consisting of 1 graphics primitive
3060
3066
3061
3067
We use :func:`list_plot_loglog` and plot in a different base.::
3062
3068
3063
- sage: list_plot_loglog(list(zip(range(1,len(yl)), yl[1:])), base=2) # long time
3069
+ sage: list_plot_loglog(list(zip(range(1,len(yl)), yl[1:])), base=2) # long time
3064
3070
Graphics object consisting of 1 graphics primitive
3065
3071
3066
3072
.. PLOT::
@@ -3267,22 +3273,22 @@ def plot_semilogy(funcs, *args, **kwds):
3267
3273
3268
3274
EXAMPLES::
3269
3275
3270
- sage: plot_semilogy(exp, (1,10)) # long time # plot in semilogy scale, base 10
3276
+ sage: plot_semilogy(exp, (1, 10)) # long time # plot in semilogy scale, base 10
3271
3277
Graphics object consisting of 1 graphics primitive
3272
3278
3273
3279
.. PLOT::
3274
3280
3275
- g = plot_semilogy(exp, (1,10)) # long time # plot in semilogy scale, base 10
3281
+ g = plot_semilogy(exp, (1,10)) # long time # plot in semilogy scale, base 10
3276
3282
sphinx_plot(g)
3277
3283
3278
3284
::
3279
3285
3280
- sage: plot_semilogy(exp, (1,10), base=2) # long time # with base 2
3286
+ sage: plot_semilogy(exp, (1, 10), base=2) # long time # with base 2
3281
3287
Graphics object consisting of 1 graphics primitive
3282
3288
3283
3289
.. PLOT::
3284
3290
3285
- g = plot_semilogy(exp, (1,10), base=2) # long time # with base 2
3291
+ g = plot_semilogy(exp, (1,10), base=2) # long time # with base 2
3286
3292
sphinx_plot(g)
3287
3293
3288
3294
"""
@@ -3505,13 +3511,14 @@ def reshape(v, n, m):
3505
3511
3506
3512
::
3507
3513
3508
- sage: M = [[plot(sin(k*x),(x,-pi,pi)) for k in range(3)],[plot(cos(j*x),(x,-pi,pi)) for j in [3..5]]]
3514
+ sage: M = [[plot(sin(k*x), (x,-pi,pi)) for k in range(3)],
3515
+ ....: [plot(cos(j*x), (x,-pi,pi)) for j in [3..5]]]
3509
3516
sage: graphics_array(M,6,1) # long time (up to 4s on sage.math, 2012)
3510
3517
Graphics Array of size 6 x 1
3511
3518
3512
3519
TESTS::
3513
3520
3514
- sage: L = [plot(sin(k*x),(x,-pi,pi)) for k in [1..3]]
3521
+ sage: L = [plot(sin(k*x), (x,-pi,pi)) for k in [1..3]]
3515
3522
sage: graphics_array(L,0,-1) # indirect doctest
3516
3523
Traceback (most recent call last):
3517
3524
...
@@ -3860,7 +3867,8 @@ def adaptive_refinement(f, p1, p2, adaptive_tolerance=0.01,
3860
3867
TESTS::
3861
3868
3862
3869
sage: from sage.plot.plot import adaptive_refinement
3863
- sage: adaptive_refinement(sin, (0,0), (pi,0), adaptive_tolerance=0.01, adaptive_recursion=0)
3870
+ sage: adaptive_refinement(sin, (0,0), (pi,0), adaptive_tolerance=0.01,
3871
+ ....: adaptive_recursion=0)
3864
3872
[]
3865
3873
sage: adaptive_refinement(sin, (0,0), (pi,0), adaptive_tolerance=0.01)
3866
3874
[(0.125*pi, 0.3826834323650898), (0.1875*pi, 0.5555702330196022),
@@ -3881,7 +3889,8 @@ def adaptive_refinement(f, p1, p2, adaptive_tolerance=0.01,
3881
3889
sage: f(x) = sin(1/x)
3882
3890
sage: n1 = len(adaptive_refinement(f, (0,0), (pi,0), adaptive_tolerance=0.01)); n1
3883
3891
15
3884
- sage: n2 = len(adaptive_refinement(f, (0,0), (pi,0), adaptive_recursion=10, adaptive_tolerance=0.01)); n2
3892
+ sage: n2 = len(adaptive_refinement(f, (0,0), (pi,0), adaptive_recursion=10,
3893
+ ....: adaptive_tolerance=0.01)); n2
3885
3894
79
3886
3895
sage: n3 = len(adaptive_refinement(f, (0,0), (pi,0), adaptive_tolerance=0.001)); n3
3887
3896
26
0 commit comments