Plots Frame (including axes) blackened in Qtconsole - matplotlib

When I launch qtconsole with the --colors=linux option and plot something the frame of the plot is blackened so I cannot see the axes because the qtconsole background is also black.
I used to launch this before without problem but have this problem after a recent update of pandas. I am not sure about what changed but I thought there might be a setting I can change to fix this anyway without worrying about what the update modified that broke this.

It looks like the axes are set to transparent by default (this was not happening before).
The following plots as desired, showing the white axes on black background:
import pandas as pd
import matplotlib.pylab as plt
fig = plt.figure()
fig.patch.set_alpha(1)
temp = pd.Series(range(100))
temp.plot()
I would also like to set this behavior as the default one. I have not been able to do that yet. This seemed like a good lead,
http://matplotlib.org/users/customizing.html
but I could not find an option for exactly that yet.
Any suggestion is welcome. Thank you.

Related

OpenCV is not graying an image with cv2.cvtColor when displayed with matplotlib

I tried to gray an image but it does not work properly like it should. It just applied a kind of filter as you can see by using cv2.COLOR_BGR2GRAY function. Kindly someone help me to get over with this issue.
Your issue is that you're using matplotlib to show your grayscale image. Matplotlib applies a colormap. By default that's a colorful one.
Add cmap="gray" in your imshow call: plt.imshow(img_gray, cmap="gray")

Fix for pyqtgraph bug when ignoring dpi display setting and using 96 dpi

I have the same issue as described in link below, where the axes of my plot aren't rendered correctly if I set the Qt.AA_Use96Dpi attribute of my QApplication to make my application invariant across different display settings.
How to stop display resolution from affecting axes in pyqtgraph plots
The solutions proposed solve the issue of broken axes if Qt.AA_Use96Dpi is not used, but wondering if there is fix that works with it enabled.

Jupyter not showing proper matplotlib plots and seaborn plots

I tried to do a box plot with salary and loan. However its not showing even though the code is correct. And I tried with matplotlib plots, it doesnt work as well.
Here is the code

Removing background on a 3d plot Julia

I am having some real trouble trying to plot nice things with Julia.
I first used PyPlot which I was happy with but I had to be able to change the angle on a 3D plots (in that case using surface) so I now use Plots directly with the camera speficication. I would like to remove the background on a 3D plot.
using PyPlot, the following command :
ax=gca(); ax:set_axis_off
works fine.
When using Plots, I tried the following :
using Plots; pyplot(grid=false)
and then my code for the surface, and it does not change the output.
I also tried the first example on this page :https://github.com/JuliaPlots/Plots.jl/pull/695 and grid specification does not work (grids are the same on every area of the layout).
I tried after updating every package and it still does not work.
Does anyone have an idea about what would the problem be please?
Thank you in advance !

Use seaborn and matplotlib defaults in same ipython notebook

I am trying to use both seaborn and matplotlib defaults to create plots in an ipython notebook, each plot with it's own default mpl or sns style. I have followed the instructions outlined in this question, and this one, however they don't quite do what I need.
%matplotlib inline
import matplotlib.pyplot as plt
plt.plot([1,2,3,4], [1,4,9,16])
import seaborn as sns
plt.plot([1,2,3,4], [1,4,9,16])
sns.reset_orig()
plt.plot([1,2,3,4], [1,4,9,16])
The last plot saves without the grey border, however the size is still different than the original. And the inline display is not the same as the original. Ideally I would like to be able to set the style on a per plot basis. Does anyone have any suggestions on how to achieve this?