I have a pandas dataframe named ‘target’, with the following structure:
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 200000 entries, 0 to 199999
Data columns (total 1 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 0 200000 non-null float64
dtypes: float64(1)
I want to create a boxplot of the data in this dataframe and save it to file. My code looks like this:
boxplot = target.boxplot()
boxplot.plot()
plt.savefig('Boxplot.png')
plt.clf()
The resulting png is completely blank – no data, no axis, no title, just a blank white rectangle.
If I use plt.show() instead to try and see what’s being plotted, nothing happens; no popup is generated, not even a blank one.
Does anyone know what might be causing this problem please?