@@ -384,19 +384,27 @@ def set_title(self, title: str, row: int | None = None, col: int | None = None):
384384 """Set the title for a subplot (default top-left)."""
385385 self ._get_or_create_subplot (row , col ).set_title (title )
386386
387- def set_xlim (self , left = None , right = None , row : int | None = None , col : int | None = None ):
387+ def set_xlim (
388+ self , left = None , right = None , row : int | None = None , col : int | None = None
389+ ):
388390 """Set the x-axis limits for a subplot (default top-left)."""
389391 self ._get_or_create_subplot (row , col ).set_xlim (left , right )
390392
391- def set_ylim (self , bottom = None , top = None , row : int | None = None , col : int | None = None ):
393+ def set_ylim (
394+ self , bottom = None , top = None , row : int | None = None , col : int | None = None
395+ ):
392396 """Set the y-axis limits for a subplot (default top-left)."""
393397 self ._get_or_create_subplot (row , col ).set_ylim (bottom , top )
394398
395- def set_grid (self , visible : bool = True , row : int | None = None , col : int | None = None ):
399+ def set_grid (
400+ self , visible : bool = True , row : int | None = None , col : int | None = None
401+ ):
396402 """Show or hide the grid for a subplot (default top-left)."""
397403 self ._get_or_create_subplot (row , col ).set_grid (visible )
398404
399- def set_legend (self , visible : bool = True , row : int | None = None , col : int | None = None ):
405+ def set_legend (
406+ self , visible : bool = True , row : int | None = None , col : int | None = None
407+ ):
400408 """Show or hide the legend for a subplot (default top-left)."""
401409 self ._get_or_create_subplot (row , col ).set_legend (visible )
402410
@@ -408,43 +416,109 @@ def set_yscale(self, scale: str, row: int | None = None, col: int | None = None)
408416 """Set y-axis scale ('linear', 'log', 'symlog') for a subplot."""
409417 self ._get_or_create_subplot (row , col ).set_yscale (scale )
410418
411- def set_xticks (self , ticks , labels = None , row : int | None = None , col : int | None = None ):
419+ def set_xticks (
420+ self , ticks , labels = None , row : int | None = None , col : int | None = None
421+ ):
412422 """Set x-axis tick positions (and optional labels) for a subplot."""
413423 self ._get_or_create_subplot (row , col ).set_xticks (ticks , labels )
414424
415- def set_yticks (self , ticks , labels = None , row : int | None = None , col : int | None = None ):
425+ def set_yticks (
426+ self , ticks , labels = None , row : int | None = None , col : int | None = None
427+ ):
416428 """Set y-axis tick positions (and optional labels) for a subplot."""
417429 self ._get_or_create_subplot (row , col ).set_yticks (ticks , labels )
418430
419- def fill_between (self , x , y1 , y2 = 0 , layer = 0 , row : int | None = None , col : int | None = None , ** kwargs ):
431+ def fill_between (
432+ self ,
433+ x ,
434+ y1 ,
435+ y2 = 0 ,
436+ layer = 0 ,
437+ row : int | None = None ,
438+ col : int | None = None ,
439+ ** kwargs ,
440+ ):
420441 """Fill the region between two curves on a subplot."""
421- self ._get_or_create_subplot (row , col ).fill_between (x , y1 , y2 , layer = layer , ** kwargs )
442+ self ._get_or_create_subplot (row , col ).fill_between (
443+ x , y1 , y2 , layer = layer , ** kwargs
444+ )
422445
423- def errorbar (self , x , y , yerr = None , xerr = None , layer = 0 , row : int | None = None , col : int | None = None , ** kwargs ):
446+ def errorbar (
447+ self ,
448+ x ,
449+ y ,
450+ yerr = None ,
451+ xerr = None ,
452+ layer = 0 ,
453+ row : int | None = None ,
454+ col : int | None = None ,
455+ ** kwargs ,
456+ ):
424457 """Add an error-bar line to a subplot."""
425- self ._get_or_create_subplot (row , col ).errorbar (x , y , yerr = yerr , xerr = xerr , layer = layer , ** kwargs )
458+ self ._get_or_create_subplot (row , col ).errorbar (
459+ x , y , yerr = yerr , xerr = xerr , layer = layer , ** kwargs
460+ )
426461
427- def axhline (self , y = 0 , layer = 0 , row : int | None = None , col : int | None = None , ** kwargs ):
462+ def axhline (
463+ self , y = 0 , layer = 0 , row : int | None = None , col : int | None = None , ** kwargs
464+ ):
428465 """Add a full-width horizontal reference line to a subplot."""
429466 self ._get_or_create_subplot (row , col ).axhline (y = y , layer = layer , ** kwargs )
430467
431- def axvline (self , x = 0 , layer = 0 , row : int | None = None , col : int | None = None , ** kwargs ):
468+ def axvline (
469+ self , x = 0 , layer = 0 , row : int | None = None , col : int | None = None , ** kwargs
470+ ):
432471 """Add a full-height vertical reference line to a subplot."""
433472 self ._get_or_create_subplot (row , col ).axvline (x = x , layer = layer , ** kwargs )
434473
435- def hlines (self , y , xmin , xmax , layer = 0 , row : int | None = None , col : int | None = None , ** kwargs ):
474+ def hlines (
475+ self ,
476+ y ,
477+ xmin ,
478+ xmax ,
479+ layer = 0 ,
480+ row : int | None = None ,
481+ col : int | None = None ,
482+ ** kwargs ,
483+ ):
436484 """Add horizontal lines at specified y positions to a subplot."""
437- self ._get_or_create_subplot (row , col ).hlines (y , xmin , xmax , layer = layer , ** kwargs )
485+ self ._get_or_create_subplot (row , col ).hlines (
486+ y , xmin , xmax , layer = layer , ** kwargs
487+ )
438488
439- def vlines (self , x , ymin , ymax , layer = 0 , row : int | None = None , col : int | None = None , ** kwargs ):
489+ def vlines (
490+ self ,
491+ x ,
492+ ymin ,
493+ ymax ,
494+ layer = 0 ,
495+ row : int | None = None ,
496+ col : int | None = None ,
497+ ** kwargs ,
498+ ):
440499 """Add vertical lines at specified x positions to a subplot."""
441- self ._get_or_create_subplot (row , col ).vlines (x , ymin , ymax , layer = layer , ** kwargs )
500+ self ._get_or_create_subplot (row , col ).vlines (
501+ x , ymin , ymax , layer = layer , ** kwargs
502+ )
442503
443- def annotate (self , text , xy , xytext = None , layer = 0 , row : int | None = None , col : int | None = None , ** kwargs ):
504+ def annotate (
505+ self ,
506+ text ,
507+ xy ,
508+ xytext = None ,
509+ layer = 0 ,
510+ row : int | None = None ,
511+ col : int | None = None ,
512+ ** kwargs ,
513+ ):
444514 """Add an annotation (with optional arrow) to a subplot."""
445- self ._get_or_create_subplot (row , col ).annotate (text , xy , xytext = xytext , layer = layer , ** kwargs )
515+ self ._get_or_create_subplot (row , col ).annotate (
516+ text , xy , xytext = xytext , layer = layer , ** kwargs
517+ )
446518
447- def text (self , x , y , s , layer = 0 , row : int | None = None , col : int | None = None , ** kwargs ):
519+ def text (
520+ self , x , y , s , layer = 0 , row : int | None = None , col : int | None = None , ** kwargs
521+ ):
448522 """Add a text label at (x, y) on a subplot."""
449523 self ._get_or_create_subplot (row , col ).text (x , y , s , layer = layer , ** kwargs )
450524
0 commit comments