Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 20 additions & 18 deletions 38 examples/pylab_examples/logo.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
#!/usr/bin/env python
# This file generates the matplotlib web page logo
# This file generates an old version of the matplotlib logo

from __future__ import print_function
from pylab import *
# Above import not necessary for Python 3 onwards. Recommend taking this
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can't take this line out if we are going to have a print() in this script.

# out in examples in the future, since we should all move to Python 3.
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.cbook as cbook

# convert data to mV
datafile = cbook.get_sample_data('membrane.dat', asfileobj=False)
print('loading', datafile)

x = 1000*0.1*fromstring(open(datafile, 'rb').read(), float32)
x = 1000 * 0.1 * np.fromstring(open(datafile, 'rb').read(), np.float32)
# 0.0005 is the sample interval
t = 0.0005*arange(len(x))
figure(1, figsize=(7, 1), dpi=100)
ax = subplot(111, axisbg='y')
plot(t, x)
text(0.5, 0.5, 'matplotlib', color='r',
fontsize=40, fontname=['Courier', 'Bitstream Vera Sans Mono'],
horizontalalignment='center',
verticalalignment='center',
transform=ax.transAxes,
)
axis([1, 1.72, -60, 10])
setp(gca(), 'xticklabels', [])
setp(gca(), 'yticklabels', [])
t = 0.0005 * np.arange(len(x))
plt.figure(1, figsize=(7, 1), dpi=100)
ax = plt.subplot(111, axisbg='y')
plt.plot(t, x)
plt.text(0.5, 0.5, 'matplotlib', color='r',
fontsize=40, fontname=['Courier', 'Bitstream Vera Sans Mono'],
horizontalalignment='center',
verticalalignment='center',
transform=ax.transAxes,
)
plt.axis([1, 1.72, -60, 10])
plt.gca().set_xticklabels([])
plt.gca().set_yticklabels([])

show()
plt.show()
Morty Proxy This is a proxified and sanitized view of the page, visit original site.