# Pic not downloaded

**URL:** <https://discuss.python.org/t/pic-not-downloaded/49919>\
**Category:** Python Help\
**Tags:** help\
**Created:** [March 31, 2024, 12:58am UTC](https://discuss.python.org/t/pic-not-downloaded/49919 "2024-03-31T00:58:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pratima6730](https://avatars.discourse-cdn.com/v4/letter/p/838e76/32.png) [@Pratima6730](https://discuss.python.org/u/Pratima6730)\
**Post date:** [March 31, 2024, 12:58am UTC](https://discuss.python.org/t/pic-not-downloaded/49919/1 "2024-03-31T00:58:25Z")

</div>

I want to download the visualization I made in Jupyter Notebook. The picture got downloaded, but it’s a white blank page. Please help me. The following codes were used:  
plt.show()  
plt.savefig(‘C:\Pathname\top\_5\_countries\_cases.png’, dpi=200, bbox\_inches=‘tight’)

---

<div class="post-metadata">

**Author:** ![FelixLeg](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/felixleg/32/18439_2.png) [@FelixLeg](https://discuss.python.org/u/FelixLeg)\
**Post date:** [March 31, 2024, 10:33am UTC](https://discuss.python.org/t/pic-not-downloaded/49919/2 "2024-03-31T10:33:10Z")

</div>

On Windows you have to give paths using raw strings, e.g. prefix them with `r`.  
Like that:

```python
plt.savefig(r'C:\Pathname\top_5_countries_cases.png', dpi=200, bbox_inches=‘tight’)

```

It is necessary because `\` used in Windows paths is also an _escape character_. Such a character makes Python interpret the character next to `\` in a special way. And you have a bad luck, because `"\t"` means Tab character _not_ slash and ‘t’.

---

<div class="post-metadata">

**Author:** ![Pratima6730](https://avatars.discourse-cdn.com/v4/letter/p/838e76/32.png) [@Pratima6730](https://discuss.python.org/u/Pratima6730)\
**Post date:** [March 31, 2024, 2:44pm UTC](https://discuss.python.org/t/pic-not-downloaded/49919/4 "2024-03-31T14:44:59Z")

</div>

Hi there, thank you for the reply. However, it’s still not working. Could you please take a look at my whole code? I wanted to draw horizontal bar graph.

top\_5\_countries = cases.groupby(‘Country’)[‘Count\_median’].sum().nlargest(5)  
colors = [‘skyblue’, ‘lightgreen’, ‘salmon’, ‘orange’, ‘lightblue’]  
plt.figure(figsize=(10, 6))  
bars = top\_5\_countries.plot(kind=‘barh’, color=colors)  
plt.xlabel(‘Total Number of Cases’)  
plt.ylabel(‘Country’)  
plt.title(‘Top 5 Countries with the Highest Number of Cases’)  
plt.gca().invert\_yaxis()  
for bar, count in zip(bars.patches, top\_5\_countries.values):  
plt.text(bar.get\_width() + 0.1, bar.get\_y() + bar.get\_height()/2 - 0.1, f’{count:,}', va=‘center’)  
plt.show()

Then in next line i did this,  
plt.savefig(r’C:\Pathname\top\_5\_countries\_cases.png’, dpi=200, bbox\_inches=‘tight’)

Result is \<Figure size 640x480 with 0 Axes\>. But it shows again a white black page…

---

<div class="post-metadata">

**Author:** ![FelixLeg](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/felixleg/32/18439_2.png) [@FelixLeg](https://discuss.python.org/u/FelixLeg)\
**Post date:** [March 31, 2024, 3:19pm UTC](https://discuss.python.org/t/pic-not-downloaded/49919/5 "2024-03-31T15:19:10Z")

</div>

Please paste again your code, but this time fenced between ``` just like [the pined thread](https://discuss.python.org/t/about-the-python-help-category/42) says. You don’t have to make new post, just _edit_ your last post. I’m writing that because your code was mangled by the forum software.

Remember that if some of us wish to help you, then he/she has to be able to _copy your code and try run it_.
