Issue 30 in scitools: plot does not work

62 views
Skip to first unread message

scit...@googlecode.com

unread,
Nov 19, 2013, 7:36:10 AM11/19/13
to scitoo...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 30 by arefnamm...@gmail.com: plot does not work
http://code.google.com/p/scitools/issues/detail?id=30

What steps will reproduce the problem?
1.import numpy as np
import matplotlib.pyplot as plt
from numpy import *
from scitools.std import *
from matplotlib.pylab import *

def f(t):
return t**2*exp(-t**2)

t = linspace(0,3,31)
y = f(t)

plot(t, y)
show()

2.
3.

What is the expected output? What do you see instead?
Expect to see a plot of t^2 exp(-t^2) instead get a blank screen.
What version of the product are you using? On what operating system?
sctools version 0.9.0 running on Ubuntu LTS 12.04 64bit

Please provide any additional information below.
removing scitools.std import and running the script works fine.



--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

scit...@googlecode.com

unread,
Nov 19, 2013, 7:52:14 AM11/19/13
to scitoo...@googlegroups.com

Comment #1 on issue 30 by arefnamm...@gmail.com: plot does not work
http://code.google.com/p/scitools/issues/detail?id=30

Just tried removing all imports except for scitools.std and this time the
script ran OK but the plot disappears very quickly.

scit...@googlecode.com

unread,
Nov 19, 2013, 7:59:57 AM11/19/13
to scitoo...@googlegroups.com

Comment #2 on issue 30 by arefnamm...@gmail.com: plot does not work
http://code.google.com/p/scitools/issues/detail?id=30

further testing indicated that importing matplotlib.pylab causes the
behavior first noted i.e. no plot being displayed.

scit...@googlecode.com

unread,
Nov 19, 2013, 8:02:47 AM11/19/13
to scitoo...@googlegroups.com

Comment #3 on issue 30 by johannes...@gmail.com: plot does not work
http://code.google.com/p/scitools/issues/detail?id=30

I cannot reproduce this. Can you try to leave out most of the import
statments and only import scitools? Like in the following script:

from scitools.std import *

def f(t):
return t**2*exp(-t**2)

t = linspace(0,3,31)
y = f(t)

plot(t, y)
show()

# This will keep the plot from disappearing
raw_input('press enter')

scit...@googlecode.com

unread,
Nov 19, 2013, 8:04:47 AM11/19/13
to scitoo...@googlegroups.com

Comment #4 on issue 30 by johannes...@gmail.com: plot does not work
http://code.google.com/p/scitools/issues/detail?id=30

When you do

from matplotlib.pylab import *

after

from scitools.std import *

you will end up with the plot command from matplotlib, not the one from
scitools.

scit...@googlecode.com

unread,
Nov 19, 2013, 8:54:59 AM11/19/13
to scitoo...@googlegroups.com

Comment #5 on issue 30 by arefnamm...@gmail.com: plot does not work
http://code.google.com/p/scitools/issues/detail?id=30

Thanks johannes. Yes keeping only scitools.std import * works but the plot
does not stay even with show(). The raw_input() does not work in the
script--I get EOF error, however, it works in the IDE.
If I remove the scitools.std import * statement and keep matplotlib the
plot stays with show() as expected.
Thanks for taking the time to respond.

scit...@googlecode.com

unread,
Nov 19, 2013, 11:25:03 AM11/19/13
to scitoo...@googlegroups.com

Comment #6 on issue 30 by arefnamm...@gmail.com: plot does not work
http://code.google.com/p/scitools/issues/detail?id=30

OK this is getting interesting. Running the code with show() from the
command line or using IDLE works fine. Using other editors such as Ninja or
SciTE the show() does not seem to work and raw_input() does not
work--returns EOF error. I suppose there is a compatibility issue with some
editors.

scit...@googlecode.com

unread,
Nov 20, 2013, 5:43:03 AM11/20/13
to scitoo...@googlegroups.com
Updates:
Status: Invalid

Comment #7 on issue 30 by johannes...@gmail.com: plot does not work
http://code.google.com/p/scitools/issues/detail?id=30

The show() command in scitools is not the same as the show() command in
matplotlib. It doesn't make the plot stay as in matplotlib, it just redraws
the current figure. You can use raw_input() or time.sleep() to make the
plot stay. If raw_input() doesn't work with your editor, then that is an
issue with the editor.

If you would like to use the matplotlib backend, then see "Controlling the
Backend" in the Easyviz documentation:

https://code.google.com/p/scitools/wiki/EasyvizDocumentation

I don't see that this is an issue with scitools, so I will mark this as
invalid.
Reply all
Reply to author
Forward
0 new messages