plotting XGBoost in Python, zoom and export imagine

Viewed 231

I'm trying to plot xgboost tree by using treeplot package:

xgb_plot = treeplot.xgboost(xgb)

However, the result is way too small and I have this warning

dot: graph is too large for cairo-renderer bitmaps. Scaling by 0.3542 to fit

I tried to export the graph by using the code below, but the result is still too small. I zoomed in, but it's unclear image.

plt.savefig('xgb.jpg', dpi=300, quality=80, optimize=True, progressive=True)  

the image is bellow and very unclear graph result

How to fix this?

1 Answers

I increased dpi to 1200 and it worked for me. I did not use the quality option.

Related