-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2 small issues I noticed (inverted lines of code in book + pcolor graph doesn't show) #61
Comments
I will look into these as soon as I can. Thanks!
Allen
On Tue, Dec 25, 2018, at 8:01 AM, nickk wrote:
On page 42, the following 2 lines of code should be inverted (i.e.
config before plot):> spectrum.plot_power(linewidth=1, alpha=0.5)
thinkplot.config(xscale='log', yscale='log')> In thinkplot.py, I had to add the following 2 lines at the end of def
Pcolor(...:> if pcolor: plt.pcolormesh(X, Y, Z, **options) plt.show() #ADDED THIS
OTHERWISE NOTHING SHOWS UP if contour: cs = plt.contour(X, Y, Z,
**options) plt.clabel(cs, inline=1, fontsize=10) plt.show() # DITTO> Excellent book though, I'm learning a lot!
— You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub[1], or mute the
thread[2].
|
EDIT: small typo on page 94: "Convolution it is such a common operation that..." Hi, this may be frivolous, but if I follow the code in the book, I never get nice (read: containing multiple lines) graphs like you have pictured in the book. E.g. the following code makes the 2nd graph (ys2) pop up only after the first is closed. Plus the labels don't seem to show up.
In order to make a nice graph, I resorted to the following:
It's possible I'm missing something obvious since I'm only a "casual" programmer, but I thought I might as well flag this. |
What development environment are you working in?
On Wed, Dec 26, 2018, at 3:34 AM, nickk wrote:
Hi, this may be frivolous, but if I follow the code in the book, I
never get nice (read: containing multiple lines) graphs like you have
pictured in the book. E.g. the following code makes the 2nd graph
(ys2) pop up only after the first is closed. Plus the labels don't
seem to show up.> thinkplot.config(xlabel='Xs', ylabel='Ys')
thinkplot.plot(ts, ys, label='double')
thinkplot.plot(ts, ys2, label='squared')
In order to make a nice graph, I resorted to the following:
fig, ax = pyplot.subplots()
line1 = ax.plot(ts, ys, label='double')
line2 = ax.plot(ts, ys2, label='squared')
ax.legend()
pyplot.xlabel('Xs')
pyplot.ylabel('Ys')
pyplot.show()
It's possible I'm missing something obvious since I'm only a "casual"
programmer, but I thought I might as well flag this.> — You are receiving this because you commented. Reply to this email
directly, view it on GitHub[1], or mute the thread[2].
|
I can't find this:
|
On page 42, the following 2 lines of code should be inverted (i.e. config before plot):
spectrum.plot_power(linewidth=1, alpha=0.5)
thinkplot.config(xscale='log', yscale='log')
In thinkplot.py, I had to add the following 2 lines at the end of def Pcolor(...:
if pcolor:
plt.pcolormesh(X, Y, Z, **options)
plt.show() #ADDED THIS OTHERWISE NOTHING SHOWS UP
if contour:
cs = plt.contour(X, Y, Z, **options)
plt.clabel(cs, inline=1, fontsize=10)
plt.show() # DITTO
Excellent book though, I'm learning a lot!
The text was updated successfully, but these errors were encountered: