Everything is in the title. My graph is displayed properly when I do not set this option at the beginning of my python script, otherwise it opens the window for the graph but closes it straightback and end the run.
I am using pandas 0.14.0 and matplotlib 1.3.0.
Anyone already saw this ? You can see my code below if needed.
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
#pd.options.display.mpl_style = 'default'
df = pd.DataFrame(np.random.randn(1000, 4), index=pd.date_range('1/1/2000',periods=1000), columns=list('ABCD'))
df = df.cumsum()
df.plot(legend=False)
plt.show()
As described above, get_option() and set_option() are available from the pandas namespace. To change an option, call set_option('option regex', new_value) .
Call pandas. set_option("display. max_rows", max_rows, "display. max_columns", max_cols) with both max_rows and max_cols as None to set the maximum number of rows and columns to display to unlimited, allowing the full DataFrame to be displayed when printed.
The default value of max_rows is 10. If set to 'None' then it means all rows of the data frame. Set value of display. max_rows to None and pass it to set_option and this will display all rows from the data frame.
display. max_rows and display. max_columns sets the maximum number of rows and columns displayed when a frame is pretty-printed.
I was experiencing a similar error with Matplotlib v1.4. The solution I found is to use
matplotlib.style.use('ggplot')
rather than
pd.options.display.mpl_style = 'default'
See - https://pandas-docs.github.io/pandas-docs-travis/visualization.html
Use the following:
plt.show(block=True)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With