Open
Description
Describe the workflow you want to enable
Hello,
I would like to suggest the following improvements:
- (1) Add x and y axis limit: [0, 1], in sklearn axes currently start at ~-0.1 (ENH fix x- and y-axis limits and ratio in ROC and PR displays #26366)
- (2) Modify the plotting frame: either remove the top and right lines to see the curve better when values are close to 1, or plot the frame with a dotted line (ENH
despine
keyword for ROC and PR curves #26367) - (3). Fix aspect ratio to squared, since the two axes are the same scale. (ENH fix x- and y-axis limits and ratio in ROC and PR displays #26366)
- (4). Add title (not planned)
Describe your proposed solution
Hello,
While working on ROC and precision-recall plots, I came up with the following suggestions:
- Add x and y axis limit: [0, 1], in sklearn axes currently start at ~-0.1
- Modify the plotting frame: either remove the top and right lines to see the curve better when values are close to 1, or plot the frame with a dotted line
- Fix aspect ratio to squared, since the two axes are the same scale.
- Add title
ax.set_xlim((-0.01, 1.01))
ax.set_ylim((-0.01, 1.01))
for s in ['right', 'left', 'top', 'bottom']:
ax.spines[s].set_visible(False)
ax.axvline(1, color='black', linewidth=0.5, ls='dotted')
ax.axhline(1, color='black', linewidth=0.5, ls='dotted')
ax.axvline(0, color='black', linewidth=0.5, ls='dotted')
ax.axhline(0, color='black', linewidth=0.5, ls='dotted')
ax.set_aspect(1)
ax.set_title(f'Precision-Recall Curve')
Example 1 Edge case
PR
ROC
Example 2 - Edge case
PR
ROC
Describe alternatives you've considered, if relevant
No response
Additional context
No response
Metadata
Metadata
Assignees
Type
Projects
Status
Todo