@@ -534,7 +534,36 @@ def validate_ps_distiller(s):
534534_validate_negative_linestyle = ValidateInStrings ('negative_linestyle' ,
535535 ['solid' , 'dashed' ],
536536 ignorecase = True )
537+ def validate_markevery (s ):
538+ """
539+ Validate the markevery property of a Line2D object.
540+
541+ Parameters
542+ ----------
543+ s : None, int, float, slice, length-2 tuple of ints,
544+ length-2 tuple of floats, list
545+
546+ Returns
547+ -------
548+ s : None, int, float, slice, length-2 tuple of ints,
549+ length-2 tuple of floats, list, ValueError
550+
551+ """
552+
553+ if isinstance (s , tuple ):
554+ # Ensure correct length of 2
555+ if len (s ) != 2 :
556+ raise ValueError ("'markevery' tuple must be a length of 2" )
557+ # Ensure that all elements in the tuple are of type int
558+ if not all (isinstance (x , int ) for x in s ):
559+ raise ValueError ("'markevery' tuple " )
560+ # Ensure that all elements in the tuple are of type float
561+ elif not all (isinstance (x , float ) for x in s ):
562+ raise ValueError ("'markevery' tuple " )
563+
564+ return s ;
537565
566+ validate_markeverylist = _listify_validator (validate_markevery )
538567
539568validate_legend_loc = ValidateInStrings (
540569 'legend_loc' ,
@@ -676,6 +705,7 @@ def validate_hatch(s):
676705 'markersize' : validate_floatlist ,
677706 'markeredgewidth' : validate_floatlist ,
678707 'markeredgecolor' : validate_colorlist ,
708+ 'markevery' : validate_markeverylist ,
679709 'alpha' : validate_floatlist ,
680710 'marker' : validate_stringlist ,
681711 'hatch' : validate_hatchlist ,
0 commit comments