tool creation

24 views
Skip to first unread message

nled...@gmail.com

unread,
Sep 16, 2014, 10:35:15 AM9/16/14
to ie...@googlegroups.com
Hello, 

I am new to Python and IEP but am very excited about the capabilities I see here. I would like to create a tool where I can quickly plot a variable against its index. I don't know how to write the code to make it a tool but my idea for the plot is shown below. Where I plot 'ans' a variable in my workspace. 

Thank you, 

Noah


fig = plt.figure()

ax1 = fig.add_subplot(111)

ax1.plot(range(0,len(ans)),ans)

plt.show()

plt.close()

Almar Klein

unread,
Sep 17, 2014, 6:04:14 AM9/17/14
to ie...@googlegroups.com
Hi Noah,

What kind of tool are you thinking of? This does not seem like
functionality that makes a lot of sense as an IEP-tool.

Your example can be made smaller:

plt.figure()
plt.plot(range(0,len(ans)),ans)
plt.show()

And that last show would probably not be necessary if you configure
matplotlib to be interactive (plt.ion()).

If you really want this easier, you could write a module that you import
and defines a convenience function. Something like:

import mymodule
mymodule.simpleplot(ans)

Regards,
Almar
> --
> You received this message because you are subscribed to the Google
> Groups "Interactive Editor for Python" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to iep_+uns...@googlegroups.com
> <mailto:iep_+uns...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages