@@ -674,13 +674,15 @@ def show_3d_model(self, model_type: str,
674674 show_clusters : Optional [bool ] = False ,
675675 colored_endpoint_indices : List [Tuple ] = None ,
676676 colored_surf3d_indices : List [Tuple ] = None ,
677+ default_face_color : Tuple = (1 , 1 , 1 , 0.5 ),
677678 show_surf3d_indices : bool = False ,
678679 show_endpoint_indices : bool = False ,
679680 x_min_limit : float = None , x_max_limit : float = None ,
680681 y_min_limit : float = None , y_max_limit : float = None ,
681682 z_min_limit : float = None , z_max_limit : float = None ,
682683 plot_origin : np .ndarray = None , plot_radius : float = None ,
683- transformation_vector : Coordinate = None ) -> Tuple :
684+ transformation_vector : Coordinate = None ,
685+ axes_off = True ) -> Tuple :
684686 """
685687 Open a plot showing the 3D model of the model_type given.
686688
@@ -695,6 +697,7 @@ def show_3d_model(self, model_type: str,
695697 :param colored_surf3d_indices: same as 'colored_endpoint_indices' only that indices into
696698 model['trunk'].surface_3d are given.
697699 :param show_surf3d_indices: Show the index of each surface patch
700+ :param default_face_color: Default color of the patches given as (r, g, b, alpha) tuple.
698701 :param x_max_limit: maximum x value to plot
699702 :param x_min_limit: minimum x value to plot
700703 :param y_max_limit: maximum y value to plot
@@ -704,6 +707,7 @@ def show_3d_model(self, model_type: str,
704707 :param plot_origin: origin for setting axis scaling equal -> handed over to set_axes_equal()
705708 :param plot_radius: radius for setting axis scaling equal -> handed over to set_axes_equal()
706709 :param transformation_vector: a vector giving the translation applied to all patches before drawing
710+ :param axes_off: turns axes of the figure off by default
707711 :return:
708712 """
709713
@@ -734,12 +738,11 @@ def show_3d_model(self, model_type: str,
734738 if index in indices ]
735739 colored_surf3d .append ((color , hatch , endpoints ))
736740
737- # the default face color:
738- default_face_color = (1 , 1 , 1 , 0.5 )
739741
740742 fig = plt .figure ()
741743 ax = fig .add_subplot (111 , projection = '3d' )
742- ax .set_aspect ('equal' )
744+ # ax.set_aspect('equal')
745+ ax .set_box_aspect ((1 , 1 , 1 ))
743746
744747 # save a list of min. and max. X, Y, Z coordinates
745748 x_min , y_min , z_min = [1e10 ] * 3
@@ -902,7 +905,8 @@ def show_3d_model(self, model_type: str,
902905 ax .elev = 19
903906 ax .azim = 10
904907 ax .dist = 6
905- ax .set_axis_off ()
908+ if axes_off :
909+ ax .set_axis_off ()
906910 return fig , ax
907911
908912 def determine_physical_endpoint_mapping (self ):
@@ -1071,7 +1075,7 @@ def plot_abdominal_endpoint_patches(self, endpoint_colors: Dict = None,
10711075 Plot all the abdominal endpoint patches as viewed from the front of the body.
10721076
10731077 :param endpoint_colors: Dict containing the colors for each abdominal endpoint.
1074- key = endpoint index, value = color . For all endpoints not in the dict, the
1078+ key = endpoint index, value = list of colors . For all endpoints not in the dict, the
10751079 default_color will be used. The color value may be a tuple or list of colors.
10761080 :param default_color: The default color of the patches
10771081 :param hf Figure handle to plot the data in
0 commit comments