Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow visualize.plot_results to return matplotlib axis if desired #866

Open
bw4sz opened this issue Jan 2, 2025 · 2 comments · May be fixed by #880
Open

Allow visualize.plot_results to return matplotlib axis if desired #866

bw4sz opened this issue Jan 2, 2025 · 2 comments · May be fixed by #880
Labels
good first issue Good for newcomers

Comments

@bw4sz
Copy link
Collaborator

bw4sz commented Jan 2, 2025

Issue Title

Request: visualize.plot_results should return matplotlib axis

Summary

Currently, the visualize.plot_results function in the DeepForest package generates plots but does not return the matplotlib axis object. If a user wants to wrap them into a subplot, its cumbersome.

Something like

# Create subplots
fig, axes = plt.subplots(1, 2, figsize=(10, 5))

# Plot zero_shot results into the first axis
axes[0] = visualize.plot_results(zero_shot, ax=ax1)

# Plot fine_tuned results into the second axis
axes[1] = visualize.plot_results(fine_tuned, ax=ax2)

# Display the subplots
plt.show()

Feature Request

I propose that visualize.plot_results be modified to return the matplotlib axis object. This change would allow users to more easily incorporate the plots into subplots for comparing multiple models.

This should be done with a 'axes=True' argument.

Benefits

Returning the axis object will provide users with greater flexibility in customizing their plots and integrating them into larger figures, thereby enhancing the usability of the DeepForest package for comparative analysis.

Labels

  • good first issue
  • enhancement

You can submit this as a new issue here.


written with copilot

@bw4sz bw4sz added the good first issue Good for newcomers label Jan 2, 2025
@gadhvirushiraj
Copy link

gadhvirushiraj commented Jan 9, 2025

Hello, I would like to contribute to this issue

@bw4sz
Copy link
Collaborator Author

bw4sz commented Jan 9, 2025

Sounds great. Check out the contribution guidelines. For this issue we want to maintain current behavior, but add an argument to allow axes to be returned to be used within a matplotlib subplots loop.

@gadhvirushiraj gadhvirushiraj linked a pull request Jan 10, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants