@@ -67,7 +67,7 @@ def __init__(self, **kwargs):
6767 )
6868 # Filter kwargs
6969 kwargs_in = _sort_supported_kwargs (
70- bound_method = pv .Plotter ,
70+ bound_method = pv .Plotter . __init__ ,
7171 ** kwargs )
7272 # Initiate pyvista Plotter
7373 self ._plotter = pv .Plotter (** kwargs_in )
@@ -601,10 +601,7 @@ def plot_chart(fields_container, off_screen=False, screenshot=None):
601601 def plot_contour (
602602 self ,
603603 field_or_fields_container ,
604- notebook = None ,
605604 shell_layers = None ,
606- off_screen = None ,
607- show_axes = True ,
608605 meshed_region = None ,
609606 ** kwargs
610607 ):
@@ -617,20 +614,9 @@ def plot_contour(
617614 ----------
618615 field_or_fields_container : dpf.core.Field or dpf.core.FieldsContainer
619616 Field or field container that contains the result to plot.
620- notebook : bool, optional
621- Whether to plot a static image within an iPython notebook
622- if available. The default is `None`, in which case an attempt is
623- made to plot a static imaage within an iPython notebook. When ``False``,
624- a plot external to the notebook is generated with an interactive window.
625- When ``True``, a plot is always generated within a notebook.
626617 shell_layers : core.shell_layers, optional
627618 Enum used to set the shell layers if the model to plot
628619 contains shell elements.
629- off_screen : bool, optional
630- Whether to render off screen, which is useful for automated
631- screenshots. The default is ``None``.
632- show_axes : bool, optional
633- Whether to show a VTK axes widget. The default is ``True``.
634620 **kwargs : optional
635621 Additional keyword arguments for the plotter. For more information,
636622 see ``help(pyvista.plot)``.
@@ -726,51 +712,44 @@ def plot_contour(
726712 overall_data [ind ] = field .data [mask ]
727713
728714 # create the plotter and add the meshes
729- background = kwargs .pop ("background" , None )
730- cpos = kwargs .pop ("cpos" , None )
731- return_cpos = kwargs .pop ("return_cpos" , None )
732-
733- # plotter = pv.Plotter(notebook=notebook, off_screen=off_screen)
734- if notebook is not None :
735- self ._internal_plotter ._plotter .notebook = notebook
736- if off_screen is not None :
737- self ._internal_plotter ._plotter .off_screen = off_screen
738715
739716 # add meshes
740717 kwargs .setdefault ("show_edges" , True )
741718 kwargs .setdefault ("nan_color" , "grey" )
742719 kwargs .setdefault ("stitle" , name )
720+
743721 text = kwargs .pop ('text' , None )
744722 if text is not None :
745723 self ._internal_plotter ._plotter .add_text (text , position = 'lower_edge' )
746- kwargs . pop ( "title" , None )
724+
747725 kwargs_in = _sort_supported_kwargs (
748726 bound_method = self ._internal_plotter ._plotter .add_mesh ,
749727 ** kwargs
750728 )
751729 self ._internal_plotter ._plotter .add_mesh (mesh .grid , scalars = overall_data , ** kwargs_in )
752730
731+ background = kwargs .pop ("background" , None )
753732 if background is not None :
754733 self ._internal_plotter ._plotter .set_background (background )
755734
735+ cpos = kwargs .pop ("cpos" , None )
756736 if cpos is not None :
757737 self ._internal_plotter ._plotter .camera_position = cpos
758738
759739 # show result
760- if show_axes :
761- self ._internal_plotter ._plotter .add_axes ()
740+ return_cpos = kwargs .pop ("return_cpos" , None )
741+ kwargs_in = _sort_supported_kwargs (
742+ bound_method = self ._internal_plotter ._plotter .show ,
743+ ** kwargs )
762744 if return_cpos is None :
763- kwargs_in = _sort_supported_kwargs (
764- bound_method = self ._internal_plotter ._plotter .show ,
765- ** kwargs )
766745 return self ._internal_plotter ._plotter .show (** kwargs_in )
767746 else :
768747 import pyvista as pv
769748 pv_version = pv .__version__
770749 version_to_reach = '0.32.0'
771750 meet_ver = meets_version (pv_version , version_to_reach )
772751 if meet_ver :
773- return self ._internal_plotter ._plotter .show (return_cpos = return_cpos )
752+ return self ._internal_plotter ._plotter .show (return_cpos = return_cpos , ** kwargs_in )
774753 else :
775754 txt = """To use the return_cpos option, please upgrade
776755 your pyvista module with a version higher than """
0 commit comments