Skip to content

Tag: matplotlib

Stop showing plots in spyder

I have scripts that make lots of plots. I save them directly with plt.savefig() rather than plt.show() so I don’t have to close all the windows. In spyder, they all show up in the console if I use inline (meaning I have to scroll way back to see other output), and they all show up in separate windows if…

Add toolbar button icon matplotlib

I want to add an icon to a custom button in a matplotlib figure toolbar. How can I do that? So far, I have the following code: For now, the only thing that it does is adding a new button (which do what I want) but the icon is only the tool’s name i.e.: “newtool”. How can I change this

format/round numerical legend label in GeoPandas

I’m looking for a way to format/round the numerical legend labels in those maps produced by .plot() function in GeoPandas. For example: This gives me a legend with many decimal places: I want the legend label to be integers. Answer As I recently encountered the same issue, and a solution does not appear…