Inline plots - low resolution in interactive mode (IPython)

Nov 22, 2013 at 8:30 PM
Hi All,

First of all, let me congratulate you guys on a fantastic plugin for VS. Out of all the Python IDE's I have looked at, this by far the best. Now on to my question...

I have PTVS 2.0 installed in VS 2013 and everything works perfectly fine. However, when I display a plot inline via the interactive window they always seem to come out pixelated/low res.

If I switch the interactive mode to "IPython w/o Pylab" the image pops up in an external window and look perfect.

Does anyone else experience this? Is there anyway to fix these pixelated plots inline? Is it possible to make them look like the plots in the external window? Although increasing the figsize() improves the image, it's not prefect and I would still have to find the correct size using trial and error for each plot separately.

btw I'm totally new to python; been playing around with it for a day or so.

Thanks for your help,

H
Coordinator
Nov 22, 2013 at 10:24 PM
thx hailorium!

please check this response on S.O. to see if it works for you. pls let us know & we'll update the docs as well:

http://stackoverflow.com/questions/17230797/how-to-set-the-matplotlib-figure-default-size-in-ipython-notebook

cheers.
Nov 23, 2013 at 5:41 PM
Hi Ptools,

Thanks for the link. I found that I didn't have a file called ipython_notebook.py. I created a default profile in the interactive window by typing "!ipython profile create". However, any changes that I make to the ipython_notebook_config.py file doesn't seem to take affect in VS when I press shift+alt+F5. I find this quite odd considering the changes do take effect when I use ipython via the browser (ipython notebook --pylab=inline). Using the link that you posted, I managed to improve the image by adding the following line in the editor window at the top:

pylab.rcParams['savefig.dpi'] = 300

Although this improves the plot, the quality is still not as good as IPython in the browser. It also means that I have to include this line every time. I've noticed that the inline images are in png format, which I suspect is the problem. Is it possible to change the format to svg?

Cheers

H
Coordinator
Nov 25, 2013 at 4:06 PM
You may want to make the change in ipython_config.py. The interactive window is not the notebook, and so it won't be loading the notebook's configuration file.

It's not currently possible to change the format to SVG, mostly because we don't have support for rendering it. While it isn't impossible for us to do, it also isn't our highest priority right now. I've created a feature request for this that you can vote on.
Nov 26, 2013 at 10:20 PM
Thank you Zooba, those changes worked.

Although I understand including this feature wouldn't be the highest priority at the moment, I appreciate you creating a feature request for it.

Cheers

H