2

I don't understand why if I uncomment line 3 of the following code

from matplotlib import pyplot

pyplot.clf()
#pyplot.figure(figsize=(400, 200))
pyplot.plot(range(0,len(x)),x,label="x")
pyplot.legend(loc='best', fancybox=True, shadow=True)
pyplot.savefig("/home/user/ooo.png", dpi=600)

I get a Segmentation fault (core dumped) error. Does anyone know how to fix this?

1
  • figsize is in inches! I can imagine that matploblib runs out of memory for a 400x200 inch figure at 600 dpi.. Does it work with a more normal figure size, lets say 10x10 inch? Commented May 27, 2016 at 9:17

1 Answer 1

2

400 inches by 200 inches is too big, so you may want to reduce the figure size.

If you need to scale your image, I recommend to save it in a vector format (see matplotlib: generating vector plot).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.