1717from .util import GraphicsGenerator
1818
1919
20- def make_plot (
21- plot_options ,
22- evaluation : Evaluation ,
23- dim : int
24- ):
20+ def make_plot (plot_options , evaluation : Evaluation , dim : int ):
2521 graphics = GraphicsGenerator (dim )
2622
2723 # pull out plot options
@@ -106,7 +102,6 @@ def compute_over_grid(nx, ny):
106102
107103 # Plot3D
108104 if dim == 3 :
109-
110105 # choose a color
111106 rgb = palette [i % len (palette )]
112107 rgb = [c / 255.0 for c in rgb ]
@@ -118,20 +113,21 @@ def compute_over_grid(nx, ny):
118113
119114 # DensityPlot
120115 elif dim == 2 :
121-
122116 # Fixed palette for now
123117 # TODO: accept color options
124118 with Timer ("compute colors" ):
125- zs = xyzs [:,2 ]
119+ zs = xyzs [:, 2 ]
126120 z_min , z_max = min (zs ), max (zs )
127- zs = zs [:, np .newaxis ] # allow broadcasting
121+ zs = zs [:, np .newaxis ] # allow broadcasting
128122 c_min , c_max = [0.5 , 0 , 0.1 ], [1.0 , 0.9 , 0.5 ]
129- c_min , c_max = np .full ((len (zs ),3 ), c_min ), np .full ((len (zs ),3 ), c_max )
123+ c_min , c_max = (
124+ np .full ((len (zs ), 3 ), c_min ),
125+ np .full ((len (zs ), 3 ), c_max ),
126+ )
130127 colors = ((zs - z_min ) * c_max + (z_max - zs ) * c_min ) / (z_max - z_min )
131128
132129 # flatten the points and add the quads
133- graphics .add_complex (xyzs [:,0 :2 ], lines = None , polys = quads , colors = colors )
134-
130+ graphics .add_complex (xyzs [:, 0 :2 ], lines = None , polys = quads , colors = colors )
135131
136132 # If requested by the Mesh attribute create a mesh of lines covering the surfaces
137133 # For now only for Plot3D
0 commit comments