Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
73 views
ubuntu2204
Kernel: Python 3 (system-wide)

The code below was generated by GPT-4 using this prompt:

Create a plot with 10 random walks

!conda install -y matplotlib numpy
Channels: - conda-forge Platform: linux-64 Collecting package metadata (repodata.json): done Solving environment: done ==> WARNING: A newer version of conda exists. <== current version: 23.11.0 latest version: 24.5.0 Please update conda by running $ conda update -n base -c conda-forge conda ## Package Plan ## environment location: /conda added / updated specs: - matplotlib - numpy The following packages will be downloaded: package | build ---------------------------|----------------- alsa-lib-1.2.11 | hd590300_1 542 KB conda-forge attr-2.5.1 | h166bdaf_1 69 KB conda-forge brotli-1.1.0 | hd590300_1 19 KB conda-forge brotli-bin-1.1.0 | hd590300_1 19 KB conda-forge cairo-1.18.0 | h3faef2a_0 959 KB conda-forge contourpy-1.2.1 | py310hd41b1e2_0 236 KB conda-forge cycler-0.12.1 | pyhd8ed1ab_0 13 KB conda-forge dbus-1.13.6 | h5008d03_3 604 KB conda-forge expat-2.6.2 | h59595ed_0 134 KB conda-forge font-ttf-dejavu-sans-mono-2.37| hab24e00_0 388 KB conda-forge font-ttf-inconsolata-3.000 | h77eed37_0 94 KB conda-forge font-ttf-source-code-pro-2.038| h77eed37_0 684 KB conda-forge font-ttf-ubuntu-0.83 | h77eed37_2 1.5 MB conda-forge fontconfig-2.14.2 | h14ed4e7_0 266 KB conda-forge fonts-conda-ecosystem-1 | 0 4 KB conda-forge fonts-conda-forge-1 | 0 4 KB conda-forge fonttools-4.51.0 | py310h2372a71_0 2.2 MB conda-forge freetype-2.12.1 | h267a509_2 620 KB conda-forge gettext-0.22.5 | h59595ed_2 464 KB conda-forge gettext-tools-0.22.5 | h59595ed_2 2.6 MB conda-forge glib-2.80.2 | hf974151_0 586 KB conda-forge glib-tools-2.80.2 | hb6ce0ca_0 112 KB conda-forge graphite2-1.3.13 | h59595ed_1003 95 KB conda-forge gst-plugins-base-1.22.9 | hfa15dee_1 2.6 MB conda-forge gstreamer-1.22.9 | h98fc4e7_1 1.9 MB conda-forge harfbuzz-8.4.0 | h3d44ed6_0 1.5 MB conda-forge kiwisolver-1.4.5 | py310hd41b1e2_1 71 KB conda-forge lame-3.100 | h166bdaf_1003 496 KB conda-forge lcms2-2.16 | hb7c19ff_0 239 KB conda-forge lerc-4.0.0 | h27087fc_0 275 KB conda-forge libasprintf-0.22.5 | h661eb56_2 42 KB conda-forge libasprintf-devel-0.22.5 | h661eb56_2 33 KB conda-forge libblas-3.9.0 |22_linux64_openblas 14 KB conda-forge libbrotlicommon-1.1.0 | hd590300_1 68 KB conda-forge libbrotlidec-1.1.0 | hd590300_1 32 KB conda-forge libbrotlienc-1.1.0 | hd590300_1 276 KB conda-forge libcap-2.69 | h0f662aa_0 98 KB conda-forge libcblas-3.9.0 |22_linux64_openblas 14 KB conda-forge libclang-15.0.7 |default_h127d8a8_5 130 KB conda-forge libclang13-15.0.7 |default_h5d6823c_5 9.1 MB conda-forge libcups-2.3.3 | h4637d8d_4 4.3 MB conda-forge libdeflate-1.20 | hd590300_0 70 KB conda-forge libevent-2.1.12 | hf998b51_1 417 KB conda-forge libexpat-2.6.2 | h59595ed_0 72 KB conda-forge libflac-1.4.3 | h59595ed_0 385 KB conda-forge libgcrypt-1.10.3 | hd590300_0 620 KB conda-forge libgettextpo-0.22.5 | h59595ed_2 167 KB conda-forge libgettextpo-devel-0.22.5 | h59595ed_2 36 KB conda-forge libgfortran-ng-13.2.0 | h69a702a_7 24 KB conda-forge libgfortran5-13.2.0 | hca663fb_7 1.4 MB conda-forge libglib-2.80.2 | hf974151_0 3.7 MB conda-forge libgpg-error-1.49 | h4f305b6_0 257 KB conda-forge libjpeg-turbo-3.0.0 | hd590300_1 604 KB conda-forge liblapack-3.9.0 |22_linux64_openblas 14 KB conda-forge libllvm15-15.0.7 | hb3ce162_4 31.8 MB conda-forge libogg-1.3.4 | h7f98852_1 206 KB conda-forge libopenblas-0.3.27 |pthreads_h413a1c8_0 5.3 MB conda-forge libopus-1.3.1 | h7f98852_1 255 KB conda-forge libpng-1.6.43 | h2797004_0 281 KB conda-forge libpq-16.3 | ha72fbe1_0 2.4 MB conda-forge libsndfile-1.2.2 | hc60ed4a_1 346 KB conda-forge libsystemd0-255 | h3516f8a_1 393 KB conda-forge libtiff-4.6.0 | h1dd3fc0_3 276 KB conda-forge libvorbis-1.3.7 | h9c3ff4c_0 280 KB conda-forge libwebp-base-1.4.0 | hd590300_0 429 KB conda-forge libxcb-1.15 | h0b41bf4_0 375 KB conda-forge libxkbcommon-1.6.0 | hd429924_1 561 KB conda-forge matplotlib-3.8.4 | py310hff52083_0 8 KB conda-forge matplotlib-base-3.8.4 | py310h62c0568_0 6.7 MB conda-forge mpg123-1.32.6 | h59595ed_0 480 KB conda-forge munkres-1.1.4 | pyh9f0ad1d_0 12 KB conda-forge mysql-common-8.0.33 | hf1915f5_6 736 KB conda-forge mysql-libs-8.0.33 | hca2cd23_6 1.5 MB conda-forge nspr-4.35 | h27087fc_0 222 KB conda-forge nss-3.97 | h1d7d5a4_0 1.9 MB conda-forge numpy-1.26.4 | py310hb13e2d6_0 6.7 MB conda-forge openjpeg-2.5.2 | h488ebb8_0 334 KB conda-forge openssl-3.3.0 | hd590300_0 2.8 MB conda-forge pcre2-10.43 | hcad00b1_0 929 KB conda-forge pillow-10.3.0 | py310hf73ecf8_0 39.8 MB conda-forge pixman-0.43.2 | h59595ed_0 378 KB conda-forge ply-3.11 | pyhd8ed1ab_2 48 KB conda-forge pthread-stubs-0.4 | h36c2ea0_1001 5 KB conda-forge pulseaudio-client-16.1 | hb77b528_5 737 KB conda-forge pyparsing-3.1.2 | pyhd8ed1ab_0 87 KB conda-forge pyqt-5.15.9 | py310h04931ad_5 5.0 MB conda-forge pyqt5-sip-12.12.2 | py310hc6cd4ac_5 83 KB conda-forge qt-main-5.15.8 | h450f30e_18 58.4 MB conda-forge sip-6.7.12 | py310hc6cd4ac_0 483 KB conda-forge toml-0.10.2 | pyhd8ed1ab_0 18 KB conda-forge unicodedata2-15.1.0 | py310h2372a71_0 365 KB conda-forge xcb-util-0.4.0 | hd590300_1 19 KB conda-forge xcb-util-image-0.4.0 | h8ee46fc_1 24 KB conda-forge xcb-util-keysyms-0.4.0 | h8ee46fc_1 14 KB conda-forge xcb-util-renderutil-0.3.9 | hd590300_1 17 KB conda-forge xcb-util-wm-0.4.1 | h8ee46fc_1 51 KB conda-forge xkeyboard-config-2.41 | hd590300_0 877 KB conda-forge xorg-kbproto-1.0.7 | h7f98852_1002 27 KB conda-forge xorg-libice-1.1.1 | hd590300_0 57 KB conda-forge xorg-libsm-1.2.4 | h7391055_0 27 KB conda-forge xorg-libx11-1.8.9 | h8ee46fc_0 809 KB conda-forge xorg-libxau-1.0.11 | hd590300_0 14 KB conda-forge xorg-libxdmcp-1.1.3 | h7f98852_0 19 KB conda-forge xorg-libxext-1.3.4 | h0b41bf4_2 49 KB conda-forge xorg-libxrender-0.9.11 | hd590300_0 37 KB conda-forge xorg-renderproto-0.11.1 | h7f98852_1002 9 KB conda-forge xorg-xextproto-7.3.0 | h0b41bf4_1003 30 KB conda-forge xorg-xf86vidmodeproto-2.3.1| h7f98852_1002 23 KB conda-forge xorg-xproto-7.0.31 | h7f98852_1007 73 KB conda-forge zlib-1.2.13 | hd590300_5 91 KB conda-forge ------------------------------------------------------------ Total: 213.7 MB The following NEW packages will be INSTALLED: alsa-lib conda-forge/linux-64::alsa-lib-1.2.11-hd590300_1 attr conda-forge/linux-64::attr-2.5.1-h166bdaf_1 brotli conda-forge/linux-64::brotli-1.1.0-hd590300_1 brotli-bin conda-forge/linux-64::brotli-bin-1.1.0-hd590300_1 cairo conda-forge/linux-64::cairo-1.18.0-h3faef2a_0 contourpy conda-forge/linux-64::contourpy-1.2.1-py310hd41b1e2_0 cycler conda-forge/noarch::cycler-0.12.1-pyhd8ed1ab_0 dbus conda-forge/linux-64::dbus-1.13.6-h5008d03_3 expat conda-forge/linux-64::expat-2.6.2-h59595ed_0 font-ttf-dejavu-s~ conda-forge/noarch::font-ttf-dejavu-sans-mono-2.37-hab24e00_0 font-ttf-inconsol~ conda-forge/noarch::font-ttf-inconsolata-3.000-h77eed37_0 font-ttf-source-c~ conda-forge/noarch::font-ttf-source-code-pro-2.038-h77eed37_0 font-ttf-ubuntu conda-forge/noarch::font-ttf-ubuntu-0.83-h77eed37_2 fontconfig conda-forge/linux-64::fontconfig-2.14.2-h14ed4e7_0 fonts-conda-ecosy~ conda-forge/noarch::fonts-conda-ecosystem-1-0 fonts-conda-forge conda-forge/noarch::fonts-conda-forge-1-0 fonttools conda-forge/linux-64::fonttools-4.51.0-py310h2372a71_0 freetype conda-forge/linux-64::freetype-2.12.1-h267a509_2 gettext conda-forge/linux-64::gettext-0.22.5-h59595ed_2 gettext-tools conda-forge/linux-64::gettext-tools-0.22.5-h59595ed_2 glib conda-forge/linux-64::glib-2.80.2-hf974151_0 glib-tools conda-forge/linux-64::glib-tools-2.80.2-hb6ce0ca_0 graphite2 conda-forge/linux-64::graphite2-1.3.13-h59595ed_1003 gst-plugins-base conda-forge/linux-64::gst-plugins-base-1.22.9-hfa15dee_1 gstreamer conda-forge/linux-64::gstreamer-1.22.9-h98fc4e7_1 harfbuzz conda-forge/linux-64::harfbuzz-8.4.0-h3d44ed6_0 kiwisolver conda-forge/linux-64::kiwisolver-1.4.5-py310hd41b1e2_1 lame conda-forge/linux-64::lame-3.100-h166bdaf_1003 lcms2 conda-forge/linux-64::lcms2-2.16-hb7c19ff_0 lerc conda-forge/linux-64::lerc-4.0.0-h27087fc_0 libasprintf conda-forge/linux-64::libasprintf-0.22.5-h661eb56_2 libasprintf-devel conda-forge/linux-64::libasprintf-devel-0.22.5-h661eb56_2 libblas conda-forge/linux-64::libblas-3.9.0-22_linux64_openblas libbrotlicommon conda-forge/linux-64::libbrotlicommon-1.1.0-hd590300_1 libbrotlidec conda-forge/linux-64::libbrotlidec-1.1.0-hd590300_1 libbrotlienc conda-forge/linux-64::libbrotlienc-1.1.0-hd590300_1 libcap conda-forge/linux-64::libcap-2.69-h0f662aa_0 libcblas conda-forge/linux-64::libcblas-3.9.0-22_linux64_openblas libclang conda-forge/linux-64::libclang-15.0.7-default_h127d8a8_5 libclang13 conda-forge/linux-64::libclang13-15.0.7-default_h5d6823c_5 libcups conda-forge/linux-64::libcups-2.3.3-h4637d8d_4 libdeflate conda-forge/linux-64::libdeflate-1.20-hd590300_0 libevent conda-forge/linux-64::libevent-2.1.12-hf998b51_1 libexpat conda-forge/linux-64::libexpat-2.6.2-h59595ed_0 libflac conda-forge/linux-64::libflac-1.4.3-h59595ed_0 libgcrypt conda-forge/linux-64::libgcrypt-1.10.3-hd590300_0 libgettextpo conda-forge/linux-64::libgettextpo-0.22.5-h59595ed_2 libgettextpo-devel conda-forge/linux-64::libgettextpo-devel-0.22.5-h59595ed_2 libgfortran-ng conda-forge/linux-64::libgfortran-ng-13.2.0-h69a702a_7 libgfortran5 conda-forge/linux-64::libgfortran5-13.2.0-hca663fb_7 libglib conda-forge/linux-64::libglib-2.80.2-hf974151_0 libgpg-error conda-forge/linux-64::libgpg-error-1.49-h4f305b6_0 libjpeg-turbo conda-forge/linux-64::libjpeg-turbo-3.0.0-hd590300_1 liblapack conda-forge/linux-64::liblapack-3.9.0-22_linux64_openblas libllvm15 conda-forge/linux-64::libllvm15-15.0.7-hb3ce162_4 libogg conda-forge/linux-64::libogg-1.3.4-h7f98852_1 libopenblas conda-forge/linux-64::libopenblas-0.3.27-pthreads_h413a1c8_0 libopus conda-forge/linux-64::libopus-1.3.1-h7f98852_1 libpng conda-forge/linux-64::libpng-1.6.43-h2797004_0 libpq conda-forge/linux-64::libpq-16.3-ha72fbe1_0 libsndfile conda-forge/linux-64::libsndfile-1.2.2-hc60ed4a_1 libsystemd0 conda-forge/linux-64::libsystemd0-255-h3516f8a_1 libtiff conda-forge/linux-64::libtiff-4.6.0-h1dd3fc0_3 libvorbis conda-forge/linux-64::libvorbis-1.3.7-h9c3ff4c_0 libwebp-base conda-forge/linux-64::libwebp-base-1.4.0-hd590300_0 libxcb conda-forge/linux-64::libxcb-1.15-h0b41bf4_0 libxkbcommon conda-forge/linux-64::libxkbcommon-1.6.0-hd429924_1 matplotlib conda-forge/linux-64::matplotlib-3.8.4-py310hff52083_0 matplotlib-base conda-forge/linux-64::matplotlib-base-3.8.4-py310h62c0568_0 mpg123 conda-forge/linux-64::mpg123-1.32.6-h59595ed_0 munkres conda-forge/noarch::munkres-1.1.4-pyh9f0ad1d_0 mysql-common conda-forge/linux-64::mysql-common-8.0.33-hf1915f5_6 mysql-libs conda-forge/linux-64::mysql-libs-8.0.33-hca2cd23_6 nspr conda-forge/linux-64::nspr-4.35-h27087fc_0 nss conda-forge/linux-64::nss-3.97-h1d7d5a4_0 numpy conda-forge/linux-64::numpy-1.26.4-py310hb13e2d6_0 openjpeg conda-forge/linux-64::openjpeg-2.5.2-h488ebb8_0 pcre2 conda-forge/linux-64::pcre2-10.43-hcad00b1_0 pillow conda-forge/linux-64::pillow-10.3.0-py310hf73ecf8_0 pixman conda-forge/linux-64::pixman-0.43.2-h59595ed_0 ply conda-forge/noarch::ply-3.11-pyhd8ed1ab_2 pthread-stubs conda-forge/linux-64::pthread-stubs-0.4-h36c2ea0_1001 pulseaudio-client conda-forge/linux-64::pulseaudio-client-16.1-hb77b528_5 pyparsing conda-forge/noarch::pyparsing-3.1.2-pyhd8ed1ab_0 pyqt conda-forge/linux-64::pyqt-5.15.9-py310h04931ad_5 pyqt5-sip conda-forge/linux-64::pyqt5-sip-12.12.2-py310hc6cd4ac_5 qt-main conda-forge/linux-64::qt-main-5.15.8-h450f30e_18 sip conda-forge/linux-64::sip-6.7.12-py310hc6cd4ac_0 toml conda-forge/noarch::toml-0.10.2-pyhd8ed1ab_0 unicodedata2 conda-forge/linux-64::unicodedata2-15.1.0-py310h2372a71_0 xcb-util conda-forge/linux-64::xcb-util-0.4.0-hd590300_1 xcb-util-image conda-forge/linux-64::xcb-util-image-0.4.0-h8ee46fc_1 xcb-util-keysyms conda-forge/linux-64::xcb-util-keysyms-0.4.0-h8ee46fc_1 xcb-util-renderut~ conda-forge/linux-64::xcb-util-renderutil-0.3.9-hd590300_1 xcb-util-wm conda-forge/linux-64::xcb-util-wm-0.4.1-h8ee46fc_1 xkeyboard-config conda-forge/linux-64::xkeyboard-config-2.41-hd590300_0 xorg-kbproto conda-forge/linux-64::xorg-kbproto-1.0.7-h7f98852_1002 xorg-libice conda-forge/linux-64::xorg-libice-1.1.1-hd590300_0 xorg-libsm conda-forge/linux-64::xorg-libsm-1.2.4-h7391055_0 xorg-libx11 conda-forge/linux-64::xorg-libx11-1.8.9-h8ee46fc_0 xorg-libxau conda-forge/linux-64::xorg-libxau-1.0.11-hd590300_0 xorg-libxdmcp conda-forge/linux-64::xorg-libxdmcp-1.1.3-h7f98852_0 xorg-libxext conda-forge/linux-64::xorg-libxext-1.3.4-h0b41bf4_2 xorg-libxrender conda-forge/linux-64::xorg-libxrender-0.9.11-hd590300_0 xorg-renderproto conda-forge/linux-64::xorg-renderproto-0.11.1-h7f98852_1002 xorg-xextproto conda-forge/linux-64::xorg-xextproto-7.3.0-h0b41bf4_1003 xorg-xf86vidmodep~ conda-forge/linux-64::xorg-xf86vidmodeproto-2.3.1-h7f98852_1002 xorg-xproto conda-forge/linux-64::xorg-xproto-7.0.31-h7f98852_1007 zlib conda-forge/linux-64::zlib-1.2.13-hd590300_5 The following packages will be UPDATED: openssl 3.2.1-hd590300_0 --> 3.3.0-hd590300_0 Downloading and Extracting Packages: qt-main-5.15.8 | 58.4 MB | | 0% pillow-10.3.0 | 39.8 MB | | 0% libllvm15-15.0.7 | 31.8 MB | | 0% libclang13-15.0.7 | 9.1 MB | | 0% numpy-1.26.4 | 6.7 MB | | 0% matplotlib-base-3.8. | 6.7 MB | | 0% libopenblas-0.3.27 | 5.3 MB | | 0% pyqt-5.15.9 | 5.0 MB | | 0% libcups-2.3.3 | 4.3 MB | | 0% libglib-2.80.2 | 3.7 MB | | 0% openssl-3.3.0 | 2.8 MB | | 0% gettext-tools-0.22.5 | 2.6 MB | | 0% gst-plugins-base-1.2 | 2.6 MB | | 0% libpq-16.3 | 2.4 MB | | 0% fonttools-4.51.0 | 2.2 MB | | 0% nss-3.97 | 1.9 MB | | 0% gstreamer-1.22.9 | 1.9 MB | | 0% font-ttf-ubuntu-0.83 | 1.5 MB | | 0% harfbuzz-8.4.0 | 1.5 MB | | 0% mysql-libs-8.0.33 | 1.5 MB | | 0% libgfortran5-13.2.0 | 1.4 MB | | 0% cairo-1.18.0 | 959 KB | | 0% pcre2-10.43 | 929 KB | | 0% ... (more hidden) ... libllvm15-15.0.7 | 31.8 MB | | 0% pillow-10.3.0 | 39.8 MB | | 0% qt-main-5.15.8 | 58.4 MB | | 0% libclang13-15.0.7 | 9.1 MB | | 0% libllvm15-15.0.7 | 31.8 MB | ####5 | 12% pillow-10.3.0 | 39.8 MB | #3 | 4% qt-main-5.15.8 | 58.4 MB | 6 | 2% libclang13-15.0.7 | 9.1 MB | #####2 | 14% libllvm15-15.0.7 | 31.8 MB | #######2 | 20% numpy-1.26.4 | 6.7 MB | #########################6 | 69% qt-main-5.15.8 | 58.4 MB | #9 | 5% libclang13-15.0.7 | 9.1 MB | ###############2 | 41% libllvm15-15.0.7 | 31.8 MB | ##########1 | 28% qt-main-5.15.8 | 58.4 MB | ###8 | 10% libclang13-15.0.7 | 9.1 MB | ########################### | 73% qt-main-5.15.8 | 58.4 MB | #####9 | 16% pillow-10.3.0 | 39.8 MB | ########6 | 23% matplotlib-base-3.8. | 6.7 MB | | 0% qt-main-5.15.8 | 58.4 MB | #######4 | 20% pillow-10.3.0 | 39.8 MB | ##########9 | 30% qt-main-5.15.8 | 58.4 MB | #########4 | 25% pillow-10.3.0 | 39.8 MB | ############# | 35% libllvm15-15.0.7 | 31.8 MB | ##################1 | 49% libopenblas-0.3.27 | 5.3 MB | 1 | 0% matplotlib-base-3.8. | 6.7 MB | ###########################3 | 74% libllvm15-15.0.7 | 31.8 MB | ####################7 | 56% pillow-10.3.0 | 39.8 MB | ###############1 | 41% qt-main-5.15.8 | 58.4 MB | ########### | 30% pillow-10.3.0 | 39.8 MB | #################6 | 48% qt-main-5.15.8 | 58.4 MB | ############# | 35% pillow-10.3.0 | 39.8 MB | ###################9 | 54% pyqt-5.15.9 | 5.0 MB | 1 | 0% qt-main-5.15.8 | 58.4 MB | ##############7 | 40% libcups-2.3.3 | 4.3 MB | 1 | 0% pyqt-5.15.9 | 5.0 MB | #############1 | 36% pillow-10.3.0 | 39.8 MB | ######################1 | 60% libllvm15-15.0.7 | 31.8 MB | ############################ | 76% qt-main-5.15.8 | 58.4 MB | ################2 | 44% pyqt-5.15.9 | 5.0 MB | ##########################8 | 73% pillow-10.3.0 | 39.8 MB | ########################8 | 67% libllvm15-15.0.7 | 31.8 MB | ##############################9 | 84% qt-main-5.15.8 | 58.4 MB | #################6 | 48% libllvm15-15.0.7 | 31.8 MB | #################################3 | 90% qt-main-5.15.8 | 58.4 MB | ################### | 51% libglib-2.80.2 | 3.7 MB | 1 | 0% libllvm15-15.0.7 | 31.8 MB | #################################### | 98% openssl-3.3.0 | 2.8 MB | 2 | 1% qt-main-5.15.8 | 58.4 MB | ####################7 | 56% libglib-2.80.2 | 3.7 MB | ###############################1 | 84% qt-main-5.15.8 | 58.4 MB | ######################2 | 60% gettext-tools-0.22.5 | 2.6 MB | 2 | 1% pillow-10.3.0 | 39.8 MB | ###################################9 | 97% qt-main-5.15.8 | 58.4 MB | #######################6 | 64% qt-main-5.15.8 | 58.4 MB | #########################3 | 68% qt-main-5.15.8 | 58.4 MB | ###########################5 | 74% qt-main-5.15.8 | 58.4 MB | #############################2 | 79% gstreamer-1.22.9 | 1.9 MB | 3 | 1% font-ttf-ubuntu-0.83 | 1.5 MB | 3 | 1% qt-main-5.15.8 | 58.4 MB | ##############################8 | 83% libclang13-15.0.7 | 9.1 MB | ##################################### | 100% libclang13-15.0.7 | 9.1 MB | ##################################### | 100% mysql-libs-8.0.33 | 1.5 MB | 3 | 1% libgfortran5-13.2.0 | 1.4 MB | 4 | 1% qt-main-5.15.8 | 58.4 MB | ################################4 | 88% pcre2-10.43 | 929 KB | 6 | 2% qt-main-5.15.8 | 58.4 MB | ###################################6 | 96% [A libopenblas-0.3.27 | 5.3 MB | ##################################### | 100% matplotlib-base-3.8. | 6.7 MB | ##################################### | 100% libcups-2.3.3 | 4.3 MB | ##################################### | 100% openssl-3.3.0 | 2.8 MB | ##################################### | 100% openssl-3.3.0 | 2.8 MB | ##################################### | 100% pyqt-5.15.9 | 5.0 MB | ##################################### | 100% numpy-1.26.4 | 6.7 MB | ##################################### | 100% numpy-1.26.4 | 6.7 MB | ##################################### | 100% gettext-tools-0.22.5 | 2.6 MB | ##################################### | 100% gettext-tools-0.22.5 | 2.6 MB | ##################################### | 100% libglib-2.80.2 | 3.7 MB | ##################################### | 100% gst-plugins-base-1.2 | 2.6 MB | ##################################### | 100% gst-plugins-base-1.2 | 2.6 MB | ##################################### | 100% nss-3.97 | 1.9 MB | ##################################### | 100% nss-3.97 | 1.9 MB | ##################################### | 100% fonttools-4.51.0 | 2.2 MB | ##################################### | 100% fonttools-4.51.0 | 2.2 MB | ##################################### | 100% libpq-16.3 | 2.4 MB | ##################################### | 100% libpq-16.3 | 2.4 MB | ##################################### | 100% gstreamer-1.22.9 | 1.9 MB | ##################################### | 100% gstreamer-1.22.9 | 1.9 MB | ##################################### | 100% harfbuzz-8.4.0 | 1.5 MB | ##################################### | 100% harfbuzz-8.4.0 | 1.5 MB | ##################################### | 100% font-ttf-ubuntu-0.83 | 1.5 MB | ##################################### | 100% font-ttf-ubuntu-0.83 | 1.5 MB | ##################################### | 100% cairo-1.18.0 | 959 KB | ##################################### | 100% cairo-1.18.0 | 959 KB | ##################################### | 100% libgfortran5-13.2.0 | 1.4 MB | ##################################### | 100% libgfortran5-13.2.0 | 1.4 MB | ##################################### | 100% mysql-libs-8.0.33 | 1.5 MB | ##################################### | 100% mysql-libs-8.0.33 | 1.5 MB | ##################################### | 100% pcre2-10.43 | 929 KB | ##################################### | 100% pcre2-10.43 | 929 KB | ##################################### | 100% libllvm15-15.0.7 | 31.8 MB | ##################################### | 100% ... (more hidden) ... ... (more hidden) ... qt-main-5.15.8 | 58.4 MB | ##################################### | 100% Preparing transaction: done Verifying transaction: done Executing transaction: done
import matplotlib.pyplot as plt import numpy as np # Set the random seed to keep results reproducible np.random.seed(0) k = 1000 # Initialize the starting point of walks start = np.zeros(k) # Generate random steps for each walk steps = np.random.choice([-1, 1], size=(1000,k)) # Broadcast the start position and add up the steps for each walk walks = np.broadcast_to(start, (1000, k)) + np.cumsum(steps, axis=0) # Plot each walk for i in range(k): plt.plot(walks[:, i]) plt.title('%s Random Walks'%k) plt.xlabel('Steps') plt.ylabel('Position') plt.sow()
--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) /tmp/ipykernel_5051/478691763.py in <cell line: 25>() 23 plt.xlabel('Steps') 24 plt.ylabel('Position') ---> 25 plt.sow() AttributeError: module 'matplotlib.pyplot' has no attribute 'sow'
Image in a Jupyter notebook
import numpy as np import matplotlib.pyplot as plt from scipy.sparse import diags from scipy.linalg import solve # Constants alpha = 0.01 # Diffusion coefficient L = 1 # Length of domain T = 3 # Time to solve until Nx = 50 # Number of spatial points in grid Nt = 300 # Number of time steps dx = L / (Nx - 1) # Spatial discretization size dt = T / (Nt - 1) # Time discretization size # Ensure the method is stable if alpha*dt/dx**2 > 0.5: raise ValueError("Solution will be unstable") # Initialize grid grid = np.zeros(shape=(Nt, Nx)) # Initial condition grid[0, :] = np.sin(np.pi*np.linspace(0, L, Nx)) grid[0, -1] = 0 # Finite differences matrix k = alpha * dt / dx**2 elements = np.array([-k, 1+2*k, -k]) diagonals = [-1, 0, 1] M = diags(elements, diagonals, shape=(Nx-2, Nx-2)).toarray() # Time-stepping loop for t in range(Nt - 1): b = grid[t, 1:-1].copy() b[0] += k*grid[t, 0] b[-1] += k*grid[t, -1] grid[t+1, 1:-1] = solve(M, b) # Plot solution for t in range(Nt): if t % 30 == 0: # Only plot every 30th time step plt.plot(np.linspace(0, L, Nx), grid[t, :], lw=2) plt.xlabel('x') plt.ylabel('u') plt.show()
Image in a Jupyter notebook
import numpy as np import matplotlib.pyplot as plt # Set the parameters c = 1.0 # wave speed L = 10.0 # size of domain T = 2.0 # time interval Nx = 100 # number of spatial steps Nt = 100 # number of time steps # Set up the grid x = np.linspace(0, L, Nx+1) # space t = np.linspace(0, T, Nt+1) # time # Initialize the function u = np.zeros((Nt+1, Nx+1)) # Set up the initial condition: Gaussian pulse in the center u[0, :] = np.exp(-0.5*((x-L/2)**2)) # Solve the 2D wave equation with finite differences for n in range(0, Nt): for i in range(1, Nx): u[n+1, i] = 2*u[n,i] - u[n-1,i] + c**2*(t[n+1]-t[n])**2/(x[i+1]-x[i])**2 *\ (u[n,i+1] - 2*u[n,i] + u[n,i-1]) # Enforce boundary conditions u[n+1, 0] = u[n+1, Nx] = 0 # Plotting plt.imshow(u, extent=(0,L,T,0), aspect='auto') plt.colorbar(label='Amplitude') plt.xlabel('Position') plt.ylabel('Time') plt.title('2D-wave equation') plt.sow()
--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) /tmp/ipykernel_14593/1143129947.py in <cell line: 35>() 33 plt.ylabel('Time') 34 plt.title('2D-wave equation') ---> 35 plt.sow() AttributeError: module 'matplotlib.pyplot' has no attribute 'sow'
Image in a Jupyter notebook