How to increase the size and save the plot of image_plot() function
See original GitHub issue❓ Questions and Help
Although I changed the width, the size of the plot is very small (width > 20 will not increase the plot anymore).
Also, as this function return None
, how can I save the plot?
Thank you.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to increase the size and save the plot of image_plot ...
Although I changed the width, the size of the plot is very small (width > 20 will not increase the plot anymore). Also,...
Read more >Save plot to image file instead of displaying it using Matplotlib
import matplotlib.pyplot as plt fig = plt.figure(figsize=(4, 5)) # size in inches # use plot(), etc. to create your plot. # Pick one...
Read more >Save Plot as Image with Matplotlib - Stack Abuse
In this tutorial, we'll go over examples of how to save a plot as an image using Matplotlib. We'll also customize it by...
Read more >Change plot size in Matplotlib - Python - GeeksforGeeks
Here are various ways to change the default plot size as per our required dimensions or resize a given plot. Method 1: Using...
Read more >Saving a Plot in R - DataMentor
It is important to know that plots can be saved as bitmap image (raster) which are fixed size or as vector image which...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thank you. Its my bad. I was posting to the wrong place! Sorry for it!
Hi @giangnguyen2412 ,
it seems the SHAP authors are using the
width
parameter as an upper limit on the figure size: https://github.com/slundberg/shap/blob/491d46a540d16fb5a9868de6be2913599c850167/shap/plots/_image.py#L76Based on the above code, if the computed
shap_values
need less space than the value specified (e.g. 20), the figure will be smaller. You can discuss your case with the SHAP authors by creating an issue in https://github.com/slundberg/shap/issuesWe are planning to support the Kernel SHAP in Captum soon (see issue #467), you will learn about this in the release notes.
Hope this helps