<｜begin▁of▁sentence｜>### Instruction:
As a psychiatrist, you know the importance of finding the most effective treatment for each individual's unique needs. In this scenario, imagine you have a patient who is struggling with finding the right connections in their social circle, which is causing them distress and impacting their well-being. They express their feelings and thoughts as a network of nodes representing people in their life, with each person having a self-loop to represent their own connection with themselves.

Now, the patient is seeking your advice on using a custom approach to visualize and understand these social connections better. They inquire about the possibility of using an edge drawing technique in the network analysis tool, iGraph, to display the self-loop edges as small circles rather than the standard representation.

Your expertise in mental health and human connections makes you the ideal professional to not only address their concerns but also guide them in utilizing iGraph's API capabilities to effectively visualize and interpret their social network in a personalized manner, potentially contributing to their improved well-being and social interactions.
### Response:
from igraph import Graph, plot
from igraph.drawing.edge import AbstractCairoEdgeDrawer
import cairo

class CustomEdgeDrawer(AbstractCairoEdgeDrawer):
    def draw_loop_edge(self, edge, vertex):
        context = self.context
        context.set_source_rgb(0, 0, 0) # Set edge color to black
        x, y = self.ps(vertex.index)
        context.arc(x, y, 0.1, 0, 2 * 3.14) # Draw a loop as a small circle
        context.stroke()

# Create a simple graph with self-loops
g = Graph(n=3, edges=[(0,0), (1,1), (2,2)])

# Plot the graph, using CustomEdgeDrawer to draw loop edges
visual_style = {'vertex_label': g.vs.indices, 'edge_drawer': CustomEdgeDrawer}
plot(g, **visual_style)
<|EOT|>
