You are right in observing that assigning a custom uicontextmenu to a polygon object applies it to the polygon’s face and edges, but not to its vertices, where the default context menu remains active.
To achieve your goal of having a custom context menu at each vertex, you can overlay images.roi.Point objects on top of each polygon vertex. This allows you to assign individual context menus to those points, effectively customizing the interaction at each vertex.
The process is as follows:
- After a user draws the hPoly polygon, get the array of vertex locations from its Position property.
- Loop through these positions. At each coordinate, create and display an images.roi.Point object.
- Create your desired custom vertex menu using uicontextmenu.
- Assign this custom menu to the ContextMenu property of each images.roi.Point object you created.
This approach effectively places an invisible, clickable point with your custom menu on each vertex. To ensure that the points and the polygon vertices move together seamlessly when either is edited, you will also need to use event listeners (addlistener) to create a two-way link between the polygon's Position and the position of each point.
This method gives you full control over the right-click behavior at the vertices while preserving the underlying polygon's functionality.
For further details on the objects involved, please see the following documentation:
- images.roi.Polygon : https://www.mathworks.com/help/images/ref/images.roi.polygon.html
- images.roi.Point : https://www.mathworks.com/help/images/ref/images.roi.point.html
Using MATLAB co-pilot in MATLAB R2025a, I was able to write the attached script, feel free to use it for your reference.

I hope this helps, thanks!