Ask Your Question

Federico's profile - activity

2020-07-19 15:42:30 +0100 received badge  Famous Question (source)
2020-03-30 18:52:27 +0100 received badge  Notable Question (source)
2019-07-09 14:32:20 +0100 received badge  Popular Question (source)
2017-11-30 08:12:14 +0100 received badge  Supporter (source)
2017-11-30 08:11:42 +0100 received badge  Scholar (source)
2017-11-28 20:07:39 +0100 asked a question Name of this project: Sage or Sagemath?

Wikipedia writes

SageMath (previously Sage or SAGE, "System for Algebra and Geometry Experimentation"[2]) is a mathematical software with features covering many aspects of mathematics...

However, I see that the names "Sage" and "Sagemath" are both used in the documentation files, without an apparent logic. Moreover, a few Google searches fail to return information on this name change.

Should I call this software "Sage" or "Sagemath"? Is one of the two names deprecated? Should we correct it when we see it used on the internet or on the documentation, or are both acceptable? Is there official information from the development team about this renaming?

2016-08-23 09:55:08 +0100 received badge  Student (source)
2016-08-23 02:41:51 +0100 asked a question Using matplotlib inside Sage

I have difficulties in using matplotlib commands inside Sage.

I took a demo from matplotlib's website:

"""
Simple demo of a horizontal bar chart.
"""
import matplotlib.pyplot as plt
plt.rcdefaults()
import numpy as np
import matplotlib.pyplot as plt


# Example data
people = ('Tom', 'Dick', 'Harry', 'Slim', 'Jim')
y_pos = np.arange(len(people))
performance = 3 + 10 * np.random.rand(len(people))
error = np.random.rand(len(people))

plt.barh(y_pos, performance, xerr=error, align='center', alpha=0.4)
plt.yticks(y_pos, people)
plt.xlabel('Performance')
plt.title('How fast do you want to go today?')

plt.show()

If I run it as python code (e.g. %run namefile.py inside ipython) it works and shows a bar chart on the screen; if I run it inside sage or sage -python namefile.py, then I see no result. I presume that Sage does some wrapping of matplotlib's output that interacts with the plotting?

How can I properly use matplotlib inside Sage code?