I LOVE PYTHON HEART matplotlib

24 views
Skip to first unread message

Jessica Grover

unread,
Nov 25, 2014, 12:41:19 AM11/25/14
to psychology-programming

Here's the code I did in class for the "I love python" heart :)


Inline image 1


import pylab
import scipy
x = scipy.linspace(-2,2,1000)
y1 = scipy.sqrt(1-(abs(x)-1)**2)
y2 = -3*scipy.sqrt(1-(abs(x)/2)**0.5)
pylab.fill_between(x, y1, color='red')
pylab.fill_between(x, y2, color='red')
pylab.xlim([-2.5, 2.5])
pylab.text(0, -0.4, 'I love python', fontsize=24, fontweight='bold',
           color='white', horizontalalignment='center')
pylab.savefig('heart.png')


ax = pylab.gca()
ax.yaxis.set_visible(False)
ax.xaxis.set_visible(False)
ax.text(1.5, -2.5, 'By: Jessica')
pylab.show()

Jibo He

unread,
Dec 9, 2014, 4:28:56 PM12/9/14
to psychology-programming, Ackerman, Paul
Dear colleagues, friends, and students,

I taught how to use python for psychology research purpose this semester at Wichita State University. The course covers using python to do
1. automated one-click data analysis
2. experiment implementation: replacing ePrime and FREE
3. draw publication quality graphs
4. file processing, read text and excel files
5. develop website.

My students are very happy to learn this class. The link below is my slides and code. I hope this may be interesting to you and be useful for you.

--
This is the mail list for Dr He's Python programming class.
http://psychology-courses.appspot.com/
---
You received this message because you are subscribed to the Google Groups "Python Programming" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psychology-progra...@googlegroups.com.
Visit this group at http://groups.google.com/group/psychology-programming.
To view this discussion on the web visit https://groups.google.com/d/msgid/psychology-programming/CAHX_8wtGxNRKsdCRyMknWJaDi0wym_wGLVpKk04hFzLOLuakxQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

2014 Fall - PSY 568 Python for Behavioral Scientist(1)__xid-1029940_1.pdf
Reply all
Reply to author
Forward
0 new messages