It is helpful to save the output of the Render Diagram function to a file instead of the ipnyb output block since the image is too big to comfortably view in the otuput window (pan, zoom, etc.. is not very user friendly). Saving to file (.svg) makes it easier so the user can view in any viewer.
from pydrake.systems.framework import System
import pydot
def SaveDiagramToFile(system: System, file_path: str, max_depth: int | None = None):
"""Save the GraphViz diagram of the given system to a file.
Args:
system (System): The Drake system (or diagram) to render.
file_path (str): The file path where the diagram will be saved.
max_depth (int, optional): Sets a limit to the depth of nested diagrams
to visualize. Use zero to render a diagram as a single system
block. Defaults to 1.
"""
graph = pydot.graph_from_dot_data(system.GetGraphvizString(max_depth=max_depth))[0]
graph.write_svg(file_path)