@@ -1866,7 +1866,7 @@ def valid_coordinates(self, *coordinates, **kwds):
18661866 @options (max_range = 8 , color = 'red' , style = '-' , thickness = 1 , plot_points = 75 ,
18671867 label_axes = True )
18681868 def plot (self , chart = None , ambient_coords = None , mapping = None ,
1869- fixed_coords = None , ranges = None , nb_values = None ,
1869+ fixed_coords = None , ranges = None , number_values = None ,
18701870 steps = None , parameters = None , ** kwds ):
18711871 r"""
18721872 Plot ``self`` as a grid in a Cartesian graph based on
@@ -1907,16 +1907,16 @@ def plot(self, chart=None, ambient_coords=None, mapping=None,
19071907 entire coordinate range declared during the chart construction
19081908 is considered (with ``-Infinity`` replaced by ``-max_range``
19091909 and ``+Infinity`` by ``max_range``)
1910- - ``nb_values `` -- (default: ``None``) either an integer or a dictionary
1911- with keys the coordinates to be drawn and values the number of
1912- constant values of the coordinate to be considered; if ``nb_values``
1913- is a single integer, it represents the number of constant values for
1914- all coordinates; if ``nb_values `` is ``None``, it is set to 9 for a
1915- 2D plot and to 5 for a 3D plot
1910+ - ``number_values `` -- (default: ``None``) either an integer or a
1911+ dictionary with keys the coordinates to be drawn and values the
1912+ number of constant values of the coordinate to be considered; if
1913+ ``number_values`` is a single integer, it represents the number of
1914+ constant values for all coordinates; if ``number_values `` is ``None``,
1915+ it is set to 9 for a 2D plot and to 5 for a 3D plot
19161916 - ``steps`` -- (default: ``None``) dictionary with keys the coordinates
19171917 to be drawn and values the step between each constant value of
19181918 the coordinate; if ``None``, the step is computed from the coordinate
1919- range (specified in ``ranges``) and ``nb_values ``. On the contrary
1919+ range (specified in ``ranges``) and ``number_values ``. On the contrary
19201920 if the step is provided for some coordinate, the corresponding
19211921 number of constant values is deduced from it and the coordinate range.
19221922 - ``parameters`` -- (default: ``None``) dictionary giving the numerical
@@ -2001,8 +2001,10 @@ def plot(self, chart=None, ambient_coords=None, mapping=None,
20012001
20022002 Call with non-default values::
20032003
2004- sage: g = c_pol.plot(c_cart, ranges={ph:(pi/4,pi)}, nb_values={r:7, ph:17},
2005- ....: color={r:'red', ph:'green'}, style={r:'-', ph:'--'})
2004+ sage: g = c_pol.plot(c_cart, ranges={ph:(pi/4,pi)},
2005+ ....: number_values={r:7, ph:17},
2006+ ....: color={r:'red', ph:'green'},
2007+ ....: style={r:'-', ph:'--'})
20062008
20072009 .. PLOT::
20082010
@@ -2011,7 +2013,7 @@ def plot(self, chart=None, ambient_coords=None, mapping=None,
20112013 U = R2.open_subset('U', coord_def={c_cart: (y!=0, x<0)})
20122014 c_pol = U.chart(r'r:(0,+oo) ph:(0,2*pi):\phi'); r, ph = c_pol[:]
20132015 pol_to_cart = c_pol.transition_map(c_cart, [r*cos(ph), r*sin(ph)])
2014- g = c_pol.plot(c_cart, ranges={ph:(pi/4,pi)}, nb_values ={r:7, ph:17}, \
2016+ g = c_pol.plot(c_cart, ranges={ph:(pi/4,pi)}, number_values ={r:7, ph:17},
20152017 color={r:'red', ph:'green'}, style={r:'-', ph:'--'})
20162018 sphinx_plot(g)
20172019
@@ -2089,9 +2091,9 @@ def plot(self, chart=None, ambient_coords=None, mapping=None,
20892091 sphinx_plot(c_xy.plot(c_cart, mapping=Phi))
20902092
20912093 NB: to get a better coverage of the whole sphere, one should increase
2092- the coordinate sampling via the argument ``nb_values `` or the
2093- argument ``steps`` (only the default value, ``nb_values = 5``, is used
2094- here, which is pretty low).
2094+ the coordinate sampling via the argument ``number_values `` or the
2095+ argument ``steps`` (only the default value, ``number_values = 5``, is
2096+ used here, which is pretty low).
20952097
20962098 The same plot without the ``(X,Y,Z)`` axes labels::
20972099
@@ -2142,8 +2144,8 @@ def plot(self, chart=None, ambient_coords=None, mapping=None,
21422144 U = S2.open_subset('U'); V = S2.open_subset('V'); S2.declare_union(U,V)
21432145 c_xy = U.chart('x y'); x, y = c_xy[:]
21442146 c_uv = V.chart('u v'); u, v = c_uv[:]
2145- xy_to_uv = c_xy.transition_map(c_uv, (x/(x**2+y**2), y/(x**2+y**2)), \
2146- intersection_name='W', restrictions1= x**2+y**2!=0, \
2147+ xy_to_uv = c_xy.transition_map(c_uv, (x/(x**2+y**2), y/(x**2+y**2)),
2148+ intersection_name='W', restrictions1= x**2+y**2!=0,
21472149 restrictions2= u**2+v**2!=0)
21482150 uv_to_xy = xy_to_uv.inverse()
21492151 c_uvW = c_uv.restrict(U.intersection(V))
@@ -2168,13 +2170,14 @@ def plot(self, chart=None, ambient_coords=None, mapping=None,
21682170 U = S2.open_subset('U'); V = S2.open_subset('V'); S2.declare_union(U,V)
21692171 c_xy = U.chart('x y'); x, y = c_xy[:]
21702172 c_uv = V.chart('u v'); u, v = c_uv[:]
2171- xy_to_uv = c_xy.transition_map(c_uv, (x/(x**2+y**2), y/(x**2+y**2)), \
2172- intersection_name='W', restrictions1= x**2+y**2!=0, \
2173+ xy_to_uv = c_xy.transition_map(c_uv, (x/(x**2+y**2), y/(x**2+y**2)),
2174+ intersection_name='W', restrictions1= x**2+y**2!=0,
21732175 restrictions2= u**2+v**2!=0)
21742176 uv_to_xy = xy_to_uv.inverse()
21752177 c_uvW = c_uv.restrict(U.intersection(V))
21762178 gu1 = c_uvW.plot(c_xy, fixed_coords={u: 1}, max_range=20, plot_points=300)
2177- gv1 = c_uvW.plot(c_xy, fixed_coords={v: 1}, max_range=20, plot_points=300, color='green')
2179+ gv1 = c_uvW.plot(c_xy, fixed_coords={v: 1}, max_range=20, plot_points=300,
2180+ color='green')
21782181 sphinx_plot(gu1+gv1)
21792182
21802183 Note that we have set ``max_range=20`` to have a wider range for
@@ -2255,7 +2258,7 @@ def plot(self, chart=None, ambient_coords=None, mapping=None,
22552258 plot_points = kwds ['plot_points' ]
22562259 label_axes = kwds ['label_axes' ]
22572260
2258- def _plot_xx_list (xx_list , rem_coords , ranges , steps , nb_values ):
2261+ def _plot_xx_list (xx_list , rem_coords , ranges , steps , number_values ):
22592262 r"""
22602263 Helper function to plot the coordinate grid.
22612264 """
@@ -2265,7 +2268,7 @@ def _plot_xx_list(xx_list, rem_coords, ranges, steps, nb_values):
22652268 resu = []
22662269 for xx in xx_list :
22672270 xc = xmin
2268- for i in range (nb_values [coord ]):
2271+ for i in range (number_values [coord ]):
22692272 nxx = list (xx )
22702273 nxx [self ._xx .index (coord )] = xc
22712274 resu .append (nxx )
@@ -2275,7 +2278,7 @@ def _plot_xx_list(xx_list, rem_coords, ranges, steps, nb_values):
22752278 else :
22762279 rem_coords .remove (coord )
22772280 return _plot_xx_list (resu , rem_coords , ranges , steps ,
2278- nb_values )
2281+ number_values )
22792282
22802283 if chart is None :
22812284 chart = self
@@ -2374,25 +2377,25 @@ def _plot_xx_list(xx_list, rem_coords, ranges, steps, nb_values):
23742377 xmax = numerical_approx (bounds [1 ][0 ] - 1.e-3 )
23752378 ranges0 [coord ] = (xmin , xmax )
23762379 ranges = ranges0
2377- if nb_values is None :
2380+ if number_values is None :
23782381 if nca == 2 : # 2D plot
2379- nb_values = 9
2382+ number_values = 9
23802383 else : # 3D plot
2381- nb_values = 5
2382- if not isinstance (nb_values , dict ):
2383- nb_values0 = {}
2384+ number_values = 5
2385+ if not isinstance (number_values , dict ):
2386+ number_values0 = {}
23842387 for coord in coords :
2385- nb_values0 [coord ] = nb_values
2386- nb_values = nb_values0
2388+ number_values0 [coord ] = number_values
2389+ number_values = number_values0
23872390 if steps is None :
23882391 steps = {}
23892392 for coord in coords :
23902393 if coord not in steps :
23912394 steps [coord ] = ((ranges [coord ][1 ] - ranges [coord ][0 ])
2392- / (nb_values [coord ]- 1 ))
2395+ / (number_values [coord ]- 1 ))
23932396 else :
23942397 from sage .functions .other import floor
2395- nb_values [coord ] = 1 + floor ((ranges [coord ][1 ] - ranges [coord ][0 ])
2398+ number_values [coord ] = 1 + floor ((ranges [coord ][1 ] - ranges [coord ][0 ])
23962399 / steps [coord ])
23972400 if not isinstance (color , dict ):
23982401 color0 = {}
@@ -2433,7 +2436,7 @@ def _plot_xx_list(xx_list, rem_coords, ranges, steps, nb_values):
24332436 xx_list = [xx0 ]
24342437 if len (rem_coords ) >= 1 :
24352438 xx_list = _plot_xx_list (xx_list , rem_coords , ranges , steps ,
2436- nb_values )
2439+ number_values )
24372440 xmin , xmax = ranges [coord ]
24382441 nbp = plot_points [coord ]
24392442 dx = (xmax - xmin ) / (nbp - 1 )
0 commit comments