Ask Your Question

show all view with same x size of Hanoi's Towers

asked 2019-01-17 20:19:37 +0200

ortollj gravatar image

updated 2019-08-29 16:04:38 +0200

FrédéricC gravatar image


I did this little program to visualize all Hanoi's Towers steps in Jupyter Notebook sagemath 8.4 ,W10. why my x-axis is not always the same width size in each view? figsize=[figSizeXmax,figSizeYmax] does not seem to work. how can I manage to get the same x length for each graph ?

Code On

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2019-01-17 21:04:21 +0200

rburing gravatar image

The figures are all the same size, as you specified with figsize. But what you actually want is to also specify xmin, xmax, ymin and ymax, so that the pictures are also drawn at the same scale.

edit flag offensive delete link more



thank you rburing, it is ok now ! ;-)

ortollj gravatar imageortollj ( 2019-01-17 21:19:52 +0200 )edit

what is also important in this post, is also to emphasize the problem of the copies in Python:

from copy import deepcopy

it took me several hours to understand the malfunctions of my Python program. Because of the fact that I did not understand the problems of copy of list, when these lists include sublists !! I wondered even if I did not lose my head so I did not understand what was happening ;-). But after searching the web, the deepcopy() function has saved me a lot of headaches!

ortollj gravatar imageortollj ( 2019-01-31 09:24:31 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2019-01-17 20:19:37 +0200

Seen: 270 times

Last updated: Jan 17 '19