Today I ran into an interesting runtime error using ``matplotlib.pyplot``. This is going to get a bit technical. So if that is not your cup of tea just scroll down to the cute cat pic that deserves upvotes :D So ``matplotlib.pyplot`` is commonly used in python to generate any type of plot: bar-charts, histograms, scatter-plots etc. For some applications you might only want to save the figure somewhere in a directory using ``.savefig()`` (and not actually show it using ``.show()``). The weird thing is that if you end your figure generation with ``.savefig()`` the figure is still there even if the program you create saves a new figure. Generally, this won't be a big problem if you have a couple of figures but you might run into memory problems if you have hundreds of them. So it is good practice to close figures and you can do this with ``.close()``. [Here](https://matplotlib.org/2.1.0/api/_as_gen/matplotlib.pyplot.close.html) is the background info on ``.close``. If you want to ``.show()`` and then ``.close()`` does that work? Well, ``.show()`` blocks ``.close()`` for some reason. So you need to unblock it using ``plt.show(block=False)`` and then you can ``.close()`` it. Here is a [stack-exchange](https://stackoverflow.com/questions/40395659/view-and-then-close-the-figure-automatically-in-matplotlib) answer with a bit more background. And now it is time for my cute cat! <center>  </center>
author | mathowl |
---|---|
permlink | a-note-on-closing-figures-in-python-and-a-cute-cat-pic |
category | hive-196387 |
json_metadata | "{"app":"peakd/2020.04.5","format":"markdown","description":"About a snake and a cute cat.","tags":["stem","hivecats","python","coding","technical","stemsocial","cat","kitty","cute"],"links":["https://matplotlib.org/2.1.0/api/_as_gen/matplotlib.pyplot.close.html","https://stackoverflow.com/questions/40395659/view-and-then-close-the-figure-automatically-in-matplotlib"],"image":["https://files.peakd.com/file/peakd-hive/mathowl/5n5KSW6q-image.png"]}" |
created | 2020-05-05 13:42:09 |
last_update | 2020-05-05 13:42:09 |
depth | 0 |
children | 7 |
last_payout | 2020-05-12 13:42:09 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 1.250 HBD |
curator_payout_value | 1.209 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1,498 |
author_reputation | 44,993,635,814,620 |
root_title | "A note on closing figures in python and a cute cat pic" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 97,200,204 |
net_rshares | 5,208,095,504,205 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
chitty | 0 | 285,981,429,790 | 75% | ||
anwenbaumeister | 0 | 5,419,281 | 1.3% | ||
roelandp | 0 | 71,734,979,201 | 5% | ||
arcange | 0 | 56,074,236,539 | 3% | ||
raphaelle | 0 | 1,741,998,154 | 3% | ||
lemouth | 0 | 64,650,921,706 | 7.5% | ||
jacobtothe | 0 | 354,114,754,195 | 100% | ||
curie | 0 | 58,630,579,336 | 1.3% | ||
hendrikdegrote | 0 | 7,163,265,832 | 1.3% | ||
vact | 0 | 17,939,828 | 1.3% | ||
steemstem | 0 | 527,366,233,334 | 10% | ||
zorg67 | 0 | 229,782,787 | 100% | ||
anthonyadavisii | 0 | 182,787,631,419 | 97% | ||
dna-replication | 0 | 1,408,430,696 | 10% | ||
privex | 0 | 448,752,797 | 1.3% | ||
trumpman | 0 | 1,099,266,864,515 | 30% | ||
locikll | 0 | 202,926,119 | 2.6% | ||
ruth-girl | 0 | 363,340,326,391 | 100% | ||
bucipuci | 0 | 13,061,660,148 | 20% | ||
trump3t | 0 | 5,808,367,339 | 92% | ||
ifartrainbows | 0 | 7,675,036,830 | 100% | ||
cryptonik | 0 | 1,279,274,377 | 67% | ||
stempede | 0 | 78,758,846,246 | 100% | ||
gentleshaid | 0 | 105,768,392,856 | 100% | ||
abitcoinskeptic | 0 | 54,138,469,994 | 15% | ||
steemflagrewards | 0 | 411,654,761,763 | 86% | ||
dexterdev | 0 | 11,041,108,095 | 100% | ||
payroll | 0 | 663,363,654,475 | 2% | ||
saboin | 0 | 19,079,701,943 | 2.31% | ||
agmoore | 0 | 115,847,488,075 | 100% | ||
flagawhale | 0 | 7,215,337,611 | 67% | ||
enforcer48 | 0 | 96,704,507,546 | 15% | ||
neutralizer | 0 | 2,197,396,474 | 57% | ||
randohealer | 0 | 1,239,034,862 | 79% | ||
insaneworks | 0 | 38,500,136,549 | 50% | ||
sbi5 | 0 | 74,169,414,463 | 27.95% | ||
smartmeme | 0 | 2,346,306,206 | 59% | ||
jd4e | 0 | 7,480,796,334 | 100% | ||
kingabesh1 | 0 | 666,757,769 | 100% | ||
astrophoto.kevin | 0 | 127,820,809,187 | 100% | ||
dalz | 0 | 126,162,548,925 | 53% | ||
ceruleanblue | 0 | 575,952,868 | 100% | ||
chops.support | 0 | 18,796,813,314 | 30% | ||
chappertron | 0 | 13,443,583,349 | 100% | ||
admiralbot | 0 | 3,198,888,575 | 60% | ||
steemhistorian | 0 | 109,743,403 | 57% | ||
new-steemit | 0 | 1,367,634,773 | 2% | ||
incinboost | 0 | 3,207,246,650 | 4.7% | ||
mechanicalowl | 0 | 1,351,488,859 | 100% | ||
regularowl | 0 | 6,190,178,471 | 100% | ||
bluerobo | 0 | 79,289,731,782 | 100% | ||
sfr-mod-fund | 0 | 4,972,342,050 | 87% | ||
hanke | 0 | 1,794,307,981 | 100% | ||
limka | 0 | 16,775,473 | 100% | ||
yoyo-jp | 0 | 1,095,628,433 | 100% | ||
dtrade | 0 | 3,047,966,081 | 25% | ||
sfr-treasury | 0 | 3,070,822,587 | 98% | ||
ticketyboo | 0 | 1,787,076,874 | 15.77% | ||
ticketywoof | 0 | 1,786,780,968 | 15.77% | ||
borbina | 0 | 1,802,715,915 | 15.77% | ||
stemd | 0 | 333,714,324 | 100% | ||
steemstem-trig | 0 | 367,868,398 | 10% | ||
yggdrasil.laguna | 0 | 357,288,326 | 70% | ||
hive-187635 | 0 | 103,241,979 | 15.42% | ||
caturday.curator | 0 | 8,855,932,462 | 15.42% | ||
blue-witness | 0 | 4,025,500,323 | 100% |
I will have forgotten about this post when it happens to me :(
author | bluerobo |
---|---|
permlink | re-mathowl-q9vl8e |
category | hive-196387 |
json_metadata | {"tags":["hive-196387"],"app":"peakd/2020.04.5"} |
created | 2020-05-05 20:36:21 |
last_update | 2020-05-05 20:36:21 |
depth | 1 |
children | 1 |
last_payout | 2020-05-12 20:36:21 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.016 HBD |
curator_payout_value | 0.016 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 62 |
author_reputation | 100,998,068,707,412 |
root_title | "A note on closing figures in python and a cute cat pic" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 97,207,365 |
net_rshares | 96,498,765,031 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
mathowl | 0 | 96,498,765,031 | 100% |
:(
author | mathowl |
---|---|
permlink | qa0q9y |
category | hive-196387 |
json_metadata | {"app":"hiveblog/0.1"} |
created | 2020-05-08 15:13:12 |
last_update | 2020-05-08 15:13:12 |
depth | 2 |
children | 0 |
last_payout | 2020-05-15 15:13:12 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 2 |
author_reputation | 44,993,635,814,620 |
root_title | "A note on closing figures in python and a cute cat pic" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 97,260,140 |
net_rshares | 0 |
I have picked your post for my daily hive voting initiative, Keep it up and Hive On!!
author | chitty |
---|---|
permlink | re-a-note-on-closing-figures-in-python-and-a-cute-cat-pic-20200509t000522 |
category | hive-196387 |
json_metadata | "" |
created | 2020-05-09 00:05:24 |
last_update | 2020-05-09 00:05:24 |
depth | 1 |
children | 1 |
last_payout | 2020-05-16 00:05:24 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 86 |
author_reputation | 86,901,300,608,582 |
root_title | "A note on closing figures in python and a cute cat pic" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 97,267,828 |
net_rshares | 1,352,533,215 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
victoria-bella | 0 | 1,352,533,215 | 100% |
Thank you kind sir. I will get back on track with daily posting.
author | mathowl |
---|---|
permlink | qa9dih |
category | hive-196387 |
json_metadata | {"app":"hiveblog/0.1"} |
created | 2020-05-13 07:16:00 |
last_update | 2020-05-13 07:16:00 |
depth | 2 |
children | 0 |
last_payout | 2020-05-20 07:16:00 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 64 |
author_reputation | 44,993,635,814,620 |
root_title | "A note on closing figures in python and a cute cat pic" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 97,343,733 |
net_rshares | 0 |
Upvoted for the cat. I don't understand Python.
author | jacobtothe |
---|---|
permlink | re-mathowl-q9v9v2 |
category | hive-196387 |
json_metadata | {"tags":["hive-196387"],"app":"peakd/2020.04.5"} |
created | 2020-05-05 16:30:39 |
last_update | 2020-05-05 16:30:39 |
depth | 1 |
children | 1 |
last_payout | 2020-05-12 16:30:39 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 47 |
author_reputation | 565,015,996,830,258 |
root_title | "A note on closing figures in python and a cute cat pic" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 97,203,166 |
net_rshares | -1,452,863,151,775 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
mathowl | 0 | 99,354,086,572 | 100% | ||
agmoore | 0 | 62,449,109,639 | 55% | ||
crystalliu | 0 | -1,614,666,347,986 | -100% |
:)
author | agmoore |
---|---|
permlink | re-jacobtothe-q9y1c5 |
category | hive-196387 |
json_metadata | {"tags":["hive-196387"],"app":"peakd/2020.04.5"} |
created | 2020-05-07 04:03:06 |
last_update | 2020-05-07 04:03:06 |
depth | 2 |
children | 0 |
last_payout | 2020-05-14 04:03:06 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 2 |
author_reputation | 426,712,624,604,558 |
root_title | "A note on closing figures in python and a cute cat pic" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 97,232,084 |
net_rshares | 0 |
<div class='text-justify'> <div class='pull-left'> <img src='https://stem.openhive.network/images/stemsocialsupport7.png'> </div> Thanks for your contribution to the STEMsocial community. Feel free to join us on discord to get to know the rest of us! Please consider <a href="https://hivesigner.com/sign/update-proposal-votes?proposal_ids=%5B91%5D&approve=true">supporting our funding proposal</a>, <a href="https://hivesigner.com/sign/account_witness_vote?approve=1&witness=stem.witness">approving our witness</a> (@stem.witness) or delegating to the @steemstem account (for some ROI). Please consider using the <a href='https://stem.openhive.network'>STEMsocial app</a> app and including @stemsocial as a beneficiary to get a stronger support. <br /> <br />
author | steemstem |
---|---|
permlink | re-mathowl-a-note-on-closing-figures-in-python-and-a-cute-cat-pic-20200512t074737867z |
category | hive-196387 |
json_metadata | {"app":"stemsocial"} |
created | 2020-05-12 07:47:39 |
last_update | 2020-05-12 07:47:39 |
depth | 1 |
children | 0 |
last_payout | 2020-05-19 07:47:39 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 777 |
author_reputation | 262,017,435,115,313 |
root_title | "A note on closing figures in python and a cute cat pic" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 97,325,238 |
net_rshares | 0 |