tool creation

24 weergaven
Naar het eerste ongelezen bericht

nled...@gmail.com

ongelezen,
16 sep 2014, 10:35:1516-09-2014
aan 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

ongelezen,
17 sep 2014, 06:04:1417-09-2014
aan 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.
Allen beantwoorden
Auteur beantwoorden
Doorsturen
0 nieuwe berichten