@@ -430,6 +430,30 @@ def bar(
430430 sp = self ._get_or_create_subplot (row , col )
431431 sp .bar (x , height , layer = layer , ** kwargs )
432432
433+ def gantt (
434+ self ,
435+ tasks ,
436+ start_times ,
437+ durations ,
438+ layer = 0 ,
439+ row : int | None = None ,
440+ col : int | None = None ,
441+ ** kwargs ,
442+ ):
443+ """
444+ Add a Gantt chart to the canvas (matplotlib-style convenience method).
445+
446+ Parameters:
447+ tasks (array-like): Task names or labels (y-axis).
448+ start_times (array-like): Start times for each task (x-axis).
449+ durations (array-like): Duration of each task.
450+ layer (int): Layer index (default 0).
451+ row, col (int): Subplot position (default top-left).
452+ **kwargs: Forwarded to the backend (e.g., color, alpha, edgecolor, label).
453+ """
454+ sp = self ._get_or_create_subplot (row , col )
455+ sp .gantt (tasks , start_times , durations , layer = layer , ** kwargs )
456+
433457 def set_xlabel (self , label : str , row : int | None = None , col : int | None = None ):
434458 """Set the x-axis label for a subplot (default top-left)."""
435459 self ._get_or_create_subplot (row , col ).set_xlabel (label )
@@ -840,6 +864,15 @@ def savefig(
840864 self ._save_plotly (fig , full_filepath )
841865 if verbose :
842866 print (f"Saved { full_filepath } " )
867+ elif backend == "tikzfigure" :
868+ if layers is not None :
869+ raise NotImplementedError (
870+ "Layer-by-layer rendering is not supported for tikzfigure backend"
871+ )
872+ fig = self .plot (backend = "tikzfigure" , savefig = False )
873+ fig .savefig (filename )
874+ if verbose :
875+ print (f"Saved { filename } " )
843876
844877 def plot (
845878 self ,
0 commit comments