
ggerico
Programming Machine Learning: some plot files are throwing error
I got this error when executing the plot files on macOS Ventura 13.0.1 with Python 3.10.8 and matplotlib 3.6.1:
programming_ML/code/03_gradient:
$ python3 plot_loss_with_path.py
Traceback (most recent call last):
File "/Users/germain/Code/lang/python/programming_ML/code/03_gradient/plot_loss_with_path.py", line 70, in <module>
ax = plt.figure().gca(projection="3d")
TypeError: FigureBase.gca() got an unexpected keyword argument 'projection'
$ python3 plot_loss_with_slices.py
Traceback (most recent call last):
File "/Users/germain/Code/lang/python/programming_ML/code/03_gradient/plot_loss_with_slices.py", line 70, in <module>
ax = plt.figure().gca(projection="3d")
TypeError: FigureBase.gca() got an unexpected keyword argument 'projection'
programming_ML/code/04_hyperspace :
$ python3 plot_plane.py
Traceback (most recent call last):
File "/Users/germain/Code/lang/python/programming_ML/code/04_hyperspace/plot_plane.py", line 17, in <module>
ax = plt.figure().gca(projection="3d")
TypeError: FigureBase.gca() got an unexpected keyword argument 'projection'
There is a fix ?
tks˜
Marked As Solved

nusco
Author of Metaprogramming Ruby & Programming Machine Learning
Hey, @ggerico. Did you follow the instructions to set up the right libraries? The ones in the book are potentially outdated, so I recommend these ones.
If you still have the problem after following the instructions on progml.com, then it’s something that I should look into. In that case, could you please let me know?
Also Liked

fidus-Achates
I had the same problem using matplotlib 3. 7. 2.
with
fig = plt.figure()
ax = fig.add_subplot(projection="3d")
instead of
ax = plt.figure().gca(projection="3d")
it works.
Thanks for all the additional code and explanations completing this excellent book!
Claudia
1
Popular Pragmatic Bookshelf topics

page 20: … protoc command…
I had to additionally run the following go get commands in order to be able to compile protobuf code using go...
New

Many tasks_proj/tests directories exist in chapters 2, 3, 5 that have tests that use the custom markers smoke and get, which are not decl...
New

Hi! I know not the intentions behind this narrative when called, on page XI:
mount() |> handle_event() |> render()
but the correc...
New

Title: Web Development with Clojure, Third Edition, vB17.0 (p9)
The create table guestbook syntax suggested doesn’t seem to be accepted ...
New

The book has the same “Problem space/Solution space” diagram on page 18 as is on page 17. The correct Problem/Solution space diagrams ar...
New

@noelrappin
Running the webpack dev server, I receive the following warning:
ERROR in tsconfig.json
TS18003: No inputs were found in c...
New

“The ProductLive.Index template calls a helper function, live_component/3, that in turn calls on the modal component. ”
Excerpt From: Br...
New

I found an issue in Chapter 7 regarding android:backgroundTint vs app:backgroundTint.
How to replicate:
load chapter-7 from zipfile i...
New

Hey there,
I’m enjoying this book and have learned a few things alredayd. However, in Chapter 4 I believe we are meant to see the “>...
New

When running the program in chapter 8, “Implementing Combat”, the printout Health before attack was never printed so I assumed something ...
New
Other popular topics

My first contact with Erlang was about 2 years ago when I used RabbitMQ, which is written in Erlang, for my job. This made me curious and...
New

We have a thread about the keyboards we have, but what about nice keyboards we come across that we want? If you have seen any that look n...
New

I have seen the keycaps I want - they are due for a group-buy this week but won’t be delivered until October next year!!! :rofl:
The Ser...
New

I am asking for any distro that only has the bare-bones to be able to get a shell in the server and then just install the packages as we ...
New

Oh just spent so much time on this to discover now that RancherOS is in end of life but Rancher is refusing to mark the Github repo as su...
New

Continuing the discussion from Thinking about learning Crystal, let’s discuss - I was wondering which languages don’t GC - maybe we can c...
New

If you get Can't find emacs in your PATH when trying to install Doom Emacs on your Mac you… just… need to install Emacs first! :lol:
bre...
New

Build efficient applications that exploit the unique benefits of a pure functional language, learning from an engineer who uses Haskell t...
New

Will Swifties’ war on AI fakes spark a deepfake porn reckoning?
New

This is a very quick guide, you just need to:
Download LM Studio: https://lmstudio.ai/
Click on search
Type DeepSeek, then select the o...
New
Categories:
Sub Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /rails
- /js
- /python
- /security
- /go
- /swift
- /vim
- /clojure
- /java
- /haskell
- /emacs
- /svelte
- /onivim
- /typescript
- /crystal
- /c-plus-plus
- /tailwind
- /kotlin
- /gleam
- /react
- /flutter
- /elm
- /ocaml
- /ash
- /vscode
- /opensuse
- /centos
- /php
- /deepseek
- /html
- /zig
- /scala
- /debian
- /nixos
- /lisp
- /textmate
- /sublime-text
- /agda
- /react-native
- /kubuntu
- /arch-linux
- /ubuntu
- /revery
- /django
- /manjaro
- /spring
- /diversity
- /lua
- /nodejs
- /c
- /julia
- /slackware
- /markdown