I am plotting some graphs, but the plot becomes cluttered because of
the long labels. The labels are result of a conversion from a Real
number to a string. The problem here is that Sage is not consistent
with Python, as shown in the example below.
Python:
multiplier = [1.0e0, 1.0e1, 1.0e2]
Hi João,
If you want precise control on the output, you might use the python
formatting (see
https://docs.python.org/2/library/string.html#formatstrings)
sage: x = RR(pi)
sage: print x
3.14159265358979
sage: print {:.3}.format(x)
3.1
sage: print {:.5}.format(x)
3.141
But perhaps it is not an
João Alberto Ferreira wrote:
I am plotting some graphs, but the plot becomes cluttered because of
the long labels. The labels are result of a conversion from a Real
number to a string. The problem here is that Sage is not consistent
with Python, as shown in the example below.
Python:
On 2014-10-06 18:03, João Alberto wrote:
Is this a correct behavior of Sage?
It's a feature, not a bug. The reason is that the number of digits gives
an idea about the precision of the number. Compare
sage: RealField(20)(1)
1.
sage: RealField(100)(1)
1.
If
Installed pre-compiled Sage-6.3.app on Mac OS X 10.9.5
At startup of Terminal Session, there is this
~$ /Applications/Sage-6.3.app/Contents/Resources/sage/sage; exit
sys:1: RuntimeWarning: not adding directory '' to sys.path since everybody
can write to it.
Untrusted users could put files in
Hello,
What do you mean by fix? This is not a bug. I see at least two possibilities:
- how to manage the rights on your computer: this is done with the
chmod command. See for example http://en.wikipedia.org/wiki/Chmod
- force ipython to add the current directory to sys.path: you can do
that
Thank you, Samuel. The conversion to RDF worked because it coerces the
other types to RDF (I think). If I convert the multiplier values to RR, RLF
or float, the conversion does not help anymore.
On Monday, October 6, 2014 1:30:03 PM UTC-3, slelievre wrote:
João Alberto Ferreira wrote:
I am
Yes, I know Vincent, thank you, but this would complicate my code
unnecessarily.
I used Samuel idea. But I still think that the extra trailing zeros have no
reason to exist.
On Monday, October 6, 2014 1:08:23 PM UTC-3, vdelecroix wrote:
Hi João,
If you want precise control on the output,
Yes Vincent, that sounds much better,
Cheers,
Nishan
On Saturday, 4 October 2014 05:21:15 UTC-4, vdelecroix wrote:
Hello,
Is it better worded as follows?
The issue: plot(h(x), 0, 4) plots the line y=x−2, not the multi-line
function defined by h. The reason? In the command plot(h(x), 0,
Ok, I had to make a huge effort to accept this, but it's more clear now.
One last question: Why RDF does not incorporate this feature? because it
comes from the GSL library, that is an independent project? or because its
precision is known a priori, like the float type in Python?
On Monday,
Dear Nishan,
I created a ticket for that, you can have a look at:
http://trac.sagemath.org/ticket/17107
Hopefully, this will be corrected in the next release of Sage.
Thanks for the report!
Vincent
2014-10-06 20:53 UTC+02:00, NahsiN nishan.singh.m...@gmail.com:
Yes Vincent, that sounds much
11 matches
Mail list logo