obstacle circles not consistent when increasing figure size
Describe the bug
in many scripts e.g. PathPlanning/RRTDubins/rrt_dubins.py
the black circles change size when making the figure full screen. This is caused by the fact that the obstacle is drawn with plt.plot(ox, oy, "ok", ms=30 * size), that does not scale the circle properly when the figure changes size.
probably something like
ax = plt.gca()
ax.add_patch(plt.Circle((ox, oy), size, color="k", fill=True))
would work
It looks like the issue arises from the use of plt.plot(ox, oy, "ok", ms=30 * size), which doesn't account for figure scaling. Switching to ax.add_patch(plt.Circle((ox, oy), size, color="k", fill=True)) could indeed fix this, but we should also consider how size is defined. Is size currently based on screen dimensions or a fixed value? This could impact how we adjust the scaling for different figure sizes.
In addition to what others have suggested, consider implementing a function that adjusts the obstacle circle size based on the current axes limits in rrt_dubins.py. This could involve recalculating the size using ax.get_xlim() and ax.get_ylim() to maintain proportionality as the figure resizes.
Instead of using plt.plot(ox, oy, "ok", ms=30 * size), consider implementing a method to dynamically calculate the radius based on the axis limits and figure dimensions within rrt_dubins.py. This will ensure that the circles maintain a consistent appearance relative to the overall figure size, addressing the inconsistency issue mentioned.
as I said this fixes it
ax = plt.gca()
ax.add_patch(plt.Circle((ox, oy), size, color="k", fill=True))
Consider implementing a method to dynamically adjust the size of the circles in rrt_dubins.py based on the current axes limits. For example, you could calculate the size as a fraction of the figure's dimensions and update the circle size in the drawing loop accordingly.