@@ -210,34 +210,35 @@ def plot3d(
210
210
kwargs = self ._preprocess (** kwargs )
211
211
212
212
kind = data_kind (data )
213
- extra_arrays = []
214
-
215
213
if kind == "empty" : # Add more columns for vectors input
214
+ data = {"x" : x , "y" : y , "z" : z }
215
+ x , y , z = None , None , None
216
+
216
217
# Parameters for vector styles
217
218
if (
218
219
isinstance (kwargs .get ("S" ), str )
219
220
and len (kwargs ["S" ]) >= 1
220
221
and kwargs ["S" ][0 ] in "vV"
221
222
and is_nonstr_iter (direction )
222
223
):
223
- extra_arrays . extend ( direction )
224
+ data . update ({ "x2" : direction [ 0 ], "y2" : direction [ 1 ]} )
224
225
# Fill
225
226
if is_nonstr_iter (kwargs .get ("G" )):
226
- extra_arrays . append ( kwargs . get ( "G" ))
227
+ data [ "fill" ] = kwargs [ "G" ]
227
228
del kwargs ["G" ]
228
229
# Size
229
230
if is_nonstr_iter (size ):
230
- extra_arrays . append ( size )
231
+ data [ " size" ] = size
231
232
# Intensity and transparency
232
- for flag in ["I" , "t" ]:
233
+ for flag , name in [( "I" , "intensity" ), ( "t" , "transparency" ) ]:
233
234
if is_nonstr_iter (kwargs .get (flag )):
234
- extra_arrays . append ( kwargs . get ( flag ))
235
+ data [ name ] = kwargs [ flag ]
235
236
kwargs [flag ] = ""
236
237
# Symbol must be at the last column
237
238
if is_nonstr_iter (symbol ):
238
239
if "S" not in kwargs :
239
240
kwargs ["S" ] = True
240
- extra_arrays . append ( symbol )
241
+ data [ " symbol" ] = symbol
241
242
else :
242
243
for name , value in [
243
244
("direction" , direction ),
@@ -257,12 +258,6 @@ def plot3d(
257
258
258
259
with Session () as lib :
259
260
with lib .virtualfile_in (
260
- check_kind = "vector" ,
261
- data = data ,
262
- x = x ,
263
- y = y ,
264
- z = z ,
265
- extra_arrays = extra_arrays ,
266
- required_z = True ,
261
+ check_kind = "vector" , data = data , required_z = True
267
262
) as vintbl :
268
263
lib .call_module (module = "plot3d" , args = build_arg_list (kwargs , infile = vintbl ))
0 commit comments