plotting ln(x) graph on sagemath

304 views
Skip to first unread message

Anoz

unread,
Sep 17, 2016, 5:13:05 PM9/17/16
to sage-support
I'm trying to plot the graph ln(1+x/1-x) how do I do this on sagemath , I just need the correct syntax.

William Stein

unread,
Sep 17, 2016, 6:27:52 PM9/17/16
to sage-support
On Sat, Sep 17, 2016 at 1:59 PM, Anoz <zona....@gmail.com> wrote:
I'm trying to plot the graph ln(1+x/1-x) how do I do this on sagemath , I just need the correct syntax.

jack

unread,
Sep 18, 2016, 4:50:19 PM9/18/16
to sage-support


On Saturday, 17 September 2016 17:13:05 UTC-4, Anoz wrote:
I'm trying to plot the graph ln(1+x/1-x) how do I do this on sagemath , I just need the correct syntax.

I have just tried this on my newly installed sage7.3 on my new computer with Ubuntu16.04. 
P=plot(log((1+x)/(1-x)), (x, -1,1))
print(P)
gives 
Graphics object consisting of 1 graphics primitive
show(P)
gives a lengthy error message which ends with
ImportError: cannot import name scimath

I installed sage at /home/jack/Tools

One clue might be the initial message I get on initiating sage in a terminal. It reads:

****************************************
sys:1: RuntimeWarning: not adding directory '' to sys.path since everybody can write to it.
Untrusted users could put files in this directory which might then be imported by your Python code. As a general precaution from similar exploits, you should not execute Python code from this directory
*****************************************
Since I am the only user of this desktop computer I am not too concerned :-)

Best regards to the sage community,
                                                          Jack Fearnley


Jori Mäntysalo

unread,
Sep 19, 2016, 3:37:10 AM9/19/16
to sage-support
On Sun, 18 Sep 2016, jack wrote:

> Ubuntu16.04. 

> P=plot(log((1+x)/(1-x)), (x, -1,1))
> show(P)
> gives a lengthy error message which ends with
> ImportError: cannot import name scimath
>
> I installed sage at /home/jack/Tools
>
> One clue might be the initial message I get on initiating sage in a
> terminal. It reads:
>
> ****************************************
> sys:1: RuntimeWarning: not adding directory '' to sys.path since everybody
> can write to it.

I have no real clue, but I would start with

strace -e file ./sage 2> log-f

then write

plot(sin)

or something similar and then quit Sage. After that

fgrep tmp_ log-f

shows

open(".../.sage/temp/j-op7010/12072/tmp_n3Sn3X.png", ...) = 11

etc. and

fgrep EACCESS log-f

finds nothing.

--
Jori Mäntysalo

HG

unread,
Sep 20, 2016, 6:56:52 AM9/20/16
to sage-support
Maybe fist write %matplotlib inline
Sometimes I got the same problem
I do it first with python2 kernel and after I do it with sagemath again

HG

unread,
Sep 20, 2016, 6:58:56 AM9/20/16
to sage-support
On mine sage 7.3 it does it straight


Le samedi 17 septembre 2016 23:13:05 UTC+2, Anoz a écrit :

HG

unread,
Sep 20, 2016, 7:42:22 AM9/20/16
to sage-support
syntax should be show(P)

or P

but not print P which gives you your result


Le samedi 17 septembre 2016 23:13:05 UTC+2, Anoz a écrit :
Reply all
Reply to author
Forward
0 new messages