Matplotlib Charts With Tkinter – Python Tkinter GUI Tutorial #27




[ad_1]

Using Matplotlib charts and graphs in Tkinter is SUPER easy to do! I’ll show you how, using numpy, matplotlib, python, and tkinter in this video!

To use numpy and matplotlib in tKinter, all we have to do is import each of those libraries and then start using them!

To generate a chart, we basically just call it in our python code.

Source


[ad_2]

Comment List

  • Codemy.com
    November 15, 2020

    How do you add the graph with values entered from the entry widget?

  • Codemy.com
    November 15, 2020

    Hello I love the tutorials, currently i am having problems using the "pip install matplotlib". i get an error code in the cmd window, i tried to download premade wheel houses for matplotlib but they error code out too. hope this isnt to long to post here but here is the error code. any help from anyone would be much appreciated. thanks!

    ERROR: Command errored out with exit status 1:

    command: 'c:userscoreyappdatalocalprogramspythonpython39python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\corey\AppData\Local\Temp\pip-install-7r9cch6n\kiwisolver\setup.py'"'"'; __file__='"'"'C:\Users\corey\AppData\Local\Temp\pip-install-7r9cch6n\kiwisolver\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info –egg-base 'C:UserscoreyAppDataLocalTemppip-pip-egg-info-3ys23u0z'

    cwd: C:UserscoreyAppDataLocalTemppip-install-7r9cch6nkiwisolver

    Complete output (44 lines):

    WARNING: The wheel package is not available.

    ERROR: Command errored out with exit status 1:

    command: 'c:userscoreyappdatalocalprogramspythonpython39python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\corey\AppData\Local\Temp\pip-wheel-2nzokl_n\cppy\setup.py'"'"'; __file__='"'"'C:\Users\corey\AppData\Local\Temp\pip-wheel-2nzokl_n\cppy\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:UserscoreyAppDataLocalTemppip-wheel-r_o557n2'

    cwd: C:UserscoreyAppDataLocalTemppip-wheel-2nzokl_ncppy

    Complete output (6 lines):

    usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] …]

    or: setup.py –help [cmd1 cmd2 …]

    or: setup.py –help-commands

    or: setup.py cmd –help

    error: invalid command 'bdist_wheel'

    —————————————-

    ERROR: Failed building wheel for cppy

    ERROR: Failed to build one or more wheels

    Traceback (most recent call last):

    File "c:userscoreyappdatalocalprogramspythonpython39libsite-packagessetuptoolsinstaller.py", line 128, in fetch_build_egg

    subprocess.check_call(cmd)

    File "c:userscoreyappdatalocalprogramspythonpython39libsubprocess.py", line 373, in check_call

    raise CalledProcessError(retcode, cmd)

    subprocess.CalledProcessError: Command '['c:\users\corey\appdata\local\programs\python\python39\python.exe', '-m', 'pip', '–disable-pip-version-check', 'wheel', '–no-deps', '-w', 'C:\Users\corey\AppData\Local\Temp\tmphgn97sci', '–quiet', 'cppy>=1.1.0']' returned non-zero exit status 1.

    The above exception was the direct cause of the following exception:

    Traceback (most recent call last):

    File "<string>", line 1, in <module>

    File "C:UserscoreyAppDataLocalTemppip-install-7r9cch6nkiwisolversetup.py", line 59, in <module>

    setup(

    File "c:userscoreyappdatalocalprogramspythonpython39libsite-packagessetuptools__init__.py", line 164, in setup

    _install_setup_requires(attrs)

    File "c:userscoreyappdatalocalprogramspythonpython39libsite-packagessetuptools__init__.py", line 159, in _install_setup_requires

    dist.fetch_build_eggs(dist.setup_requires)

    File "c:userscoreyappdatalocalprogramspythonpython39libsite-packagessetuptoolsdist.py", line 699, in fetch_build_eggs

    resolved_dists = pkg_resources.working_set.resolve(

    File "c:userscoreyappdatalocalprogramspythonpython39libsite-packagespkg_resources__init__.py", line 779, in resolve

    dist = best[req.key] = env.best_match(

    File "c:userscoreyappdatalocalprogramspythonpython39libsite-packagespkg_resources__init__.py", line 1064, in best_match

    return self.obtain(req, installer)

    File "c:userscoreyappdatalocalprogramspythonpython39libsite-packagespkg_resources__init__.py", line 1076, in obtain

    return installer(requirement)

    File "c:userscoreyappdatalocalprogramspythonpython39libsite-packagessetuptoolsdist.py", line 758, in fetch_build_egg

    return fetch_build_egg(self, req)

    File "c:userscoreyappdatalocalprogramspythonpython39libsite-packagessetuptoolsinstaller.py", line 130, in fetch_build_egg

    raise DistutilsError(str(e)) from e

    distutils.errors.DistutilsError: Command '['c:\users\corey\appdata\local\programs\python\python39\python.exe', '-m', 'pip', '–disable-pip-version-check', 'wheel', '–no-deps', '-w', 'C:\Users\corey\AppData\Local\Temp\tmphgn97sci', '–quiet', 'cppy>=1.1.0']' returned non-zero exit status 1.

    —————————————-

    ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

  • Codemy.com
    November 15, 2020

    I love the hole series so far! thank you greatly! I was looking around codemy, but didn't find anything more specific to matplotlib and numpy… Are you willing to teach some more about these 2 topics, maybe in the member area of codemy.com?

  • Codemy.com
    November 15, 2020

    i am using python 2.7.3 , the main problem is that it doesn't contain pip. So how could i download modules.

  • Codemy.com
    November 15, 2020

    Too much time spent on what you should already know. How about how to add multiple graphs!?

  • Codemy.com
    November 15, 2020

    Hi, I'm doing this on Jupyter Notebook with Python 3, but when I click the 'Graph it' button, the graph actually appears inside the Jupyter Notebook instead of in the new window.

  • Codemy.com
    November 15, 2020

    hi,best teaching way, really helpful to me.thanks alot.
    i have a little question for you that can we make an interface having 3 images on it and it changes those images by clicking button in a same window interface,plz

  • Codemy.com
    November 15, 2020

    Plz,Make videos on Numpy and Matplotlib…

  • Codemy.com
    November 15, 2020

    I like you way of explainning things I really want you to do some cources on data analysis (matplotlab, numpy…)

  • Codemy.com
    November 15, 2020

    Excellent video. deleting already drawn lines in the liveupdate chart is quite difficult in matplotlib. is it possible to delete in tkinter.. The len(ax.lines) count keep increasing while chart get update. Any suggestion please…

  • Codemy.com
    November 15, 2020

    Yeah plz make more videos on it

  • Codemy.com
    November 15, 2020

    Nice video demonstration👍👍👍

  • Codemy.com
    November 15, 2020

    Heisenberg teaches us how to cook…………..plots xD

  • Codemy.com
    November 15, 2020

    Are the functionalities to zoom in , zoom out, save and more , in – built to Sublime? Loved the video.

  • Codemy.com
    November 15, 2020

    i have seen most of your tkinter tutorial as they were great!!!!!!!!!! and practiced with it in vs code , i got most of exact results .But this particular as wrote exact code also m not getting the results as button is displaying well its not calling func of graph , as results graph is not coming ..

    please do respond…

  • Codemy.com
    November 15, 2020

    Brilliant Playlist. Love it!!
    Would definitely love a series on analytics(Pandas,numpy,matplotlib) with tkinter

  • Codemy.com
    November 15, 2020

    Great tutorial . Try adding OpenCV with Tkinter

  • Codemy.com
    November 15, 2020

    I am using Spyder for coding. In that the separate window for the plot is not generated, only a image of the plot is visible at the kernel without much functionalities. Can you help me to generate it in the spyder as well?

  • Codemy.com
    November 15, 2020

    if you run it, it shrinks the size of your main window behind? what can be done about this? it messes it up even on this video you can see it.

  • Codemy.com
    November 15, 2020

    Expected to have the plot inside the tkinter root! But anyway cool video!

  • Codemy.com
    November 15, 2020

    That was an awesome video. Is it possible to place those charts on Tkinter form inside a canvas, if possible, please make a short video. Thank you in advance.

  • Codemy.com
    November 15, 2020

    You know why don't pop up that extrawindow in My code?

  • Codemy.com
    November 15, 2020

    Hello , I try to print a value from entry field as integer , but I have the message always : ValueError: invalid literal for int() with base 10: '' . please heelp

  • Codemy.com
    November 15, 2020

    Plz make a video on plotting parabola

  • Codemy.com
    November 15, 2020

    Good evening.
    MT name is Luis Tavares, I'm from São Paulo-SP (Brazil), I congratulate you on your work. I always watch videos about Python.
    I am working on the development of my own data science, almost everthing is ready, but I have a lot of difficulty on how tô creste the tables (Organize the data in a tablet), because after organizing the data, I want to plot graphs and generate a study.
    It is a tip to post a video on the construction of tables.

    PS: I'm Sorry for any spelling or gramatical errors.
    As you know, in Brazil the official linguagem is Portuguese.

Write a comment