

{"id":108453,"date":"2022-07-13T11:00:22","date_gmt":"2022-07-13T05:30:22","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=108453"},"modified":"2026-06-01T12:53:38","modified_gmt":"2026-06-01T07:23:38","slug":"python-graph-creator-project","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/python-graph-creator-project\/","title":{"rendered":"Create Graph using Python &#8211; Graph Plotting in Python"},"content":{"rendered":"<p>We would have come across situations when we have to plot graphs and find the nature of the curve, especially in school and college. Even if you are the one dealing with a lot of math, you tend to use plots. In this project, we will build a Graph Creator using Python that saves not only your time but also eases your work. Let\u2019s start by discussing the application and its features.<\/p>\n<h3>What is Graph Creator?<\/h3>\n<p>Graph Creator is an application that plots the graphs from the values of the two coordinates given by the user. However, it has the following options to give the points:<\/p>\n<p>1. Enter manually<\/p>\n<p>2. Uploading from a file,<\/p>\n<p>In addition, the points on the plot can be moved to modify the graph and also reset to the original shape.<\/p>\n<p><strong>Features of the graph creator:<\/strong><\/p>\n<ul>\n<li><strong>Data visualization:<\/strong> Any dataset or number can be turned into a visual representation instantly.<\/li>\n<li><strong>Customization:<\/strong> Users can change font size, chart type, color, and layout as per their requirements.<\/li>\n<li><strong>Data import and export:<\/strong> It allows you to transfer data from Excel and Google Sheets, and also allows finished images from (JPG\/PNG).<\/li>\n<li><strong>Specialised:<\/strong> It allows you to use specialized tools for creating difficult diagrams.<\/li>\n<\/ul>\n<h3>Graph Creator in Python<\/h3>\n<p>We will be building this project using the Python modules Tkinter, Matplotlib, NumPy, SciPy, path, and os. We use the Tkinter module to build the GUI to interact with the user and the Matplotlib to build the interactive plots. The NumPy and SciPy modules are used to get a range of values to plot a smooth curve from the given points. And finally, we use the path and os modules for uploading the file with the points of the plot.<\/p>\n<h3>Download the Source Code for Graph Creator<\/h3>\n<p>Please download the source code for the graph creator using the link: <a href=\"https:\/\/drive.google.com\/file\/d\/1YBMrdFLSJ1_3rp-M4JBTBNRQeRSiEjCs\/view?usp=drive_link\" target=\"_blank\" rel=\"noopener\"><strong>Graph Creator Project<\/strong><\/a><\/p>\n<h3>Prerequisites<\/h3>\n<p>This project requires the developer to have a basic understanding of Python, Tkinter, Matplotlib, Numpy, and SciPy modules. The above-mentioned modules can be installed using the following commands:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">pip install tk<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">pip install matplotlib<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">pip install numpy<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">pip install scipy<\/pre>\n<p>Path and os modules are available in the Python standard library.<\/p>\n<h3>Steps to Build the Graph Creator Project in Python<\/h3>\n<p>We will be following the steps below to build the graph creator:<\/p>\n<p>1. First, import the required modules<\/p>\n<p>2. Then, we create the Tkinter window<\/p>\n<p>3. We add the required components to the window<\/p>\n<p>4. After this, we write the following functions<\/p>\n<p>a. a function to add the points manually<\/p>\n<p>b. function to clear the values<\/p>\n<p>c. function to upload the values from an Excel file<\/p>\n<p>d. function to generate an interactive graph<\/p>\n<h4>1. Importing the required modules<\/h4>\n<p>The first step is to import all the required modules. Hence, we import all the modules we discussed above and the required functions and components.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#Importing the modules\r\nimport tkinter as tk\r\nfrom tkinter import *\r\nfrom tkinter import filedialog\r\nfrom path import Path\r\nimport os\r\nimport pandas as pd\r\n\r\nimport matplotlib.animation as animation\r\nfrom matplotlib.widgets import Slider, Button\r\nimport matplotlib as mpl\r\nfrom matplotlib import pyplot as plt\r\nimport scipy.interpolate as inter\r\nimport numpy as np\r\n<\/pre>\n<h4>2. Creating the Tkinter window<\/h4>\n<p>Now we create a new GUI and set its properties. Here we use<\/p>\n<p>a. title() to set the main title of the window<\/p>\n<p>b. configure() to set the background color<\/p>\n<p>c. minsize() and geometry() to manage the size of the window<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#Creating the window\r\nwn = Tk()\r\nwn.title(\"DataFlair Graph Creator\")\r\nwn.configure(bg='mint cream')\r\nwn.minsize(width=500,height=500)\r\nwn.geometry(\"700x600\")\r\n<\/pre>\n<h4>3. Adding the required components to the window<\/h4>\n<p><strong>Now we create the global variables:<\/strong><\/p>\n<p>A. To store the coordinates<\/p>\n<p>B. To create a variable to show the coordinates added to the label<\/p>\n<p>C. To create a variable that stores the index of the point the mouse clicked on while trying to drag<\/p>\n<p>Then we add canvas and heading, followed by entries to take the coordinates. And then a label to show these points. After this, we have 4 buttons for:<\/p>\n<p>A. To add the values of the points given as input and display them on screen<\/p>\n<p>B. To clear the added values<\/p>\n<p>C. To upload the input coordinates from a file in the device<\/p>\n<p>D. To generate the plot from the given values<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#Creating the global variables\r\nxVals=[] #Stores x coordinate values\r\nyVals=[] #Stores y coordinate values\r\npoints=StringVar() #Variable to update the points displayed\r\nptInd = None #active point to know the mouse action point\r\n\r\n#Creating the canvas and adding heading\r\nCanvas1 = Canvas(wn)\r\nCanvas1.config(bg=\"mint cream\")\r\nCanvas1.pack(expand=True,fill=BOTH)\r\n\r\nheadingFrame1 = Frame(wn,bg=\"snow3\",bd=5)\r\nheadingFrame1.place(relx=0.25,rely=0.1,relwidth=0.5,relheight=0.13)\r\n\r\nheadingLabel = Label(headingFrame1, text=\"DataFlair Graph Creator\", fg='black', font = ('Courier',15,'bold'))\r\nheadingLabel.place(relx=0,rely=0, relwidth=1, relheight=1)\r\n\r\n# Instruction to add coordinates\r\nLabel(wn, text=\"Enter the two coordinates and click on Add\",fg='black',bg=\"mint cream\",font = ('Calibre',12)).place(relx=0.05,rely=0.3)\r\nlable = Label(wn,text=\"X Value: \", bg=\"mint cream\",fg='black',font = ('Calibre',10))\r\nlable.place(relx=0.05,rely=0.35)\r\n\r\n#Takes x and y values of a point\r\nxCord = Entry(wn,font = ('Calibre',10))\r\nxCord.place(relx=0.3,rely=0.35, relwidth=0.62)\r\n\r\n# Title\r\nlable2 = Label(wn,text=\"Y Value: \",bg=\"mint cream\", fg='black',font = ('Calibre',10))\r\nlable2.place(relx=0.05,rely=0.4)\r\n\r\nyCord = Entry(wn,font = ('Calibre',10))\r\nyCord.place(relx=0.3,rely=0.4, relwidth=0.62)\r\n\r\nlabelFrame = Frame(wn,bg=\"white\")\r\nlabelFrame.place(relx=0.1,rely=0.45,relwidth=0.8,relheight=0.25)  \r\n\r\n#Displays the added points\r\nmy_label = Label(labelFrame,textvariable=points,font = ('Courier',10),bg=\"white\")\r\nmy_label.place(relx=0.07,rely=0.05)\r\n\r\n#Add Button\r\nAdd = tk.Button(wn,text=\"Add\",bg='#d1ccc0', fg='black',command=add)\r\nAdd.place(relx=0.1,rely=0.9, relwidth=0.18,relheight=0.08)\r\n\r\n#Upload Button\r\nUpload = tk.Button(wn,text=\"Upload\",bg='#f7f1e3', fg='black', command=uploadValues)\r\nUpload.place(relx=0.3,rely=0.9, relwidth=0.18,relheight=0.08)\r\n\r\n#Clear button\r\nClear = tk.Button(wn,text=\"Clear\",bg='#f7f1e3', fg='black', command=clearValues)\r\nClear.place(relx=0.5,rely=0.9, relwidth=0.18,relheight=0.08)\r\n\r\n#Generate button\r\nGenerate = tk.Button(wn,text=\"Generate\",bg='#f7f1e3', fg='black', command=generateGraph)\r\nGenerate.place(relx=0.7,rely=0.9, relwidth=0.18,relheight=0.08)\r\n\r\n#Runs till the window is closed by the user\r\nwn.mainloop()\r\n<\/pre>\n<h4>4. Creating the function to add the points manually<\/h4>\n<p>In this function add_values_screen(), we<\/p>\n<p>a. Run the for loop to add all the x and y values into a string form<\/p>\n<p>b. Store this string in the points variable<\/p>\n<p>c. Displaying the points on the label<\/p>\n<p>d. Clearing the entries<\/p>\n<p>In the function add(), we<\/p>\n<p>a. Get the x and y values<\/p>\n<p>b. Add to the lists xVals and yVals, respectively<\/p>\n<p>c. Run the function add_values_screen()<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#Function to display the values on the screen\r\ndef add_values_screen():\r\n    global labelFrame, points,xVals,yVals,xCord,yCord\r\n\r\n    vals=''\r\n    for i in range(len(xVals)):\r\n        vals+='('\r\n        vals+=str(xVals[i])\r\n        vals+=','\r\n        vals+=str(yVals[i])\r\n        vals+=')'\r\n        vals+=', '\r\n    print(vals)\r\n    points.set(vals)\r\n    xCord.delete(0, END)\r\n    yCord.delete(0, END)\r\n    my_label.config(textvariable=points)\r\n\r\n#Function to add the lists storing the coordinates given as input and display them\r\ndef add():\r\n    global wn,xCord,yCord,xVals,yVals,labelFrame, points\r\n   \r\n    x=int(xCord.get())\r\n    y=int(yCord.get())\r\n    xVals.append(x)\r\n    yVals.append(y)\r\n    #print(x,y)\r\n    add_values_screen()\r\n<\/pre>\n<h4>5. Creating the function to clear the values<\/h4>\n<p>In this function, we clear the lists storing the values and the widgets. We use the clear() function to delete elements of the list. Furthermore, we use the set() function to clear the variable \u2018points\u2019. And delete() function to clear the entries.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#Function to delete the values given as coordinates\r\ndef clearValues():\r\n    global wn,xCord,yCord,xVals,yVals,labelFrame\r\n    xVals.clear()\r\n    yVals.clear()\r\n    points.set('')\r\n    xCord.delete(0, END)\r\n    yCord.delete(0, END)\r\n    my_label.config(text='')\r\n<\/pre>\n<h4>6. Creating the function to upload the values from an Excel file<\/h4>\n<p>In this function,<\/p>\n<p>a. Clear the values<\/p>\n<p>b. Give a pop-up window for the user to select the file from which values should be taken<\/p>\n<p>c. Then read the values by converting them to a dataframe and store them in the lists<\/p>\n<p>d. And then run the function add_values_screen()<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#Function to upload the excel file and extract the x and y coordinate values  \r\ndef uploadValues():\r\n    clearValues()\r\n    global xVals,yVals\r\n    path = filedialog.askopenfilename() #Get the path of the PDF based on the user's location selection\r\n    df = pd.read_excel(path) # can also index sheet by name or fetch all sheets\r\n    clmns=list(df.columns)\r\n    xVals = df[clmns[0]].tolist()\r\n    yVals = df[clmns[1]].tolist()\r\n\r\n    add_values_screen()\r\n<\/pre>\n<h4>7. Creating the function to generate an interactive graph<\/h4>\n<p>This is the function to generate the graph that also helps to click and drag the points on the plot.<\/p>\n<p>In this,<\/p>\n<p>a. We first set the limits for the plot based on the values given as input<\/p>\n<p>b. Then make a copy of the values to use for future use while resetting<\/p>\n<p>c. Then we get a smooth curve fitting the points using the function InterpolatedUnivariateSpline()<\/p>\n<p>d. Then we create the subplot<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#Function to generate the graph based on the input values\r\ndef generateGraph():\r\n    global xVals,yVals\r\n\r\n    #Setting the limits of the plot\r\n    N=len(xVals)\r\n    xmin = min(xVals)-5\r\n    xmax = max(xVals)+5\r\n    ymin = min(yVals)-5\r\n    ymax = max(yVals)+5\r\n\r\n    #making the copy of the x and y points to not lose the original ones\r\n    x=xVals.copy()\r\n    yvals=yVals.copy()\r\n\r\n    #getting a smooth curve for the given points\r\n    mySpline = inter.InterpolatedUnivariateSpline (x, yvals)\r\n\r\n    #setting the rcParams\r\n    mpl.rcParams['figure.subplot.right'] = 0.8\r\n\r\n    #setting up a plot\r\n    fig,axes = plt.subplots(1,1,figsize=(9.0,9.0),sharex=True)\r\n    ax1 = axes\r\n\r\n    epsilon = 5 #max pixel distance for the mouse click\r\n<\/pre>\n<p>This is a function to update the curve when the slider is changed. Here, we get the y values from the slider and create a new updated smooth curve. And then update the plot with this curve.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#This function updates the curve when the slider is moved\r\n def update(val):\r\n     for i in np.arange(N):\r\n         yvals[i] = sliders[i].val\r\n     print(yvals)\r\n     l.set_ydata(yvals)\r\n     mySpline = inter.InterpolatedUnivariateSpline (x, yvals)\r\n     m.set_ydata(mySpline(X))\r\n     # redraw canvas while idle\r\n     fig.canvas.draw_idle()\r\n<\/pre>\n<p>In this function, we get the original curve by taking the values from the global variable yVals. Then create the smooth curve, plot the curve, and also update the slider.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#This function resets the values to the original ones\r\n   def reset(event):\r\n       global yVals\r\n       X = np.arange(0,xmax+1,0.1)\r\n       print(yVals)\r\n       for i in np.arange(N):\r\n           sliders[i].reset()\r\n       mySpline = inter.InterpolatedUnivariateSpline (x, yVals)\r\n       l.set_ydata(yVals)\r\n       m.set_ydata(mySpline(X))\r\n       for i in np.arange(N):\r\n           sliders[i].set_val(yvals[i])\r\n       # redraw canvas while idle\r\n       fig.canvas.draw_idle()\r\n<\/pre>\n<p>This function gets the index of the point on which the mouse is pressed. Although it is hard to click on the exact location of the points. So, epsilon is used to set the boundary around the points. And if the mouse is clicked within this boundary, then the index of that point is returned.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#This function get the index of the vertex under point if within tolerance of epsilon\r\ndef get_ind_under_point(event):\r\n   \r\n    trans = ax1.transData.inverted()\r\n    tinv = ax1.transData\r\n    xy = trans.transform([event.x,event.y])\r\n    x_reshape = np.reshape(x,(np.shape(x)[0],1))\r\n    y_reshape= np.reshape(yvals,(np.shape(yvals)[0],1))\r\n    xy_vals = np.append(x_reshape,y_reshape,1)\r\n    xytrans = tinv.transform(xy_vals)\r\n    xtrans, ytrans = xytrans[:, 0], xytrans[:, 1]\r\n    d = np.hypot(xtrans - event.x, ytrans - event.y)\r\n    indseq, = np.nonzero(d == d.min())\r\n    ind = indseq[0]\r\n    if d[ind] &gt;= epsilon:\r\n        ind = None\r\n   \r\n    return ind\r\n<\/pre>\n<p>The function button_press_callback() runs when the mouse button is pressed. However, if the button is pressed on one of the x-values of the curve, then get the index of that point.<\/p>\n<p>The function button_release_callback() runs when the button is released, and this removes the index value to None.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#This function run where there is a mouse click\r\n   def button_press_callback(event):\r\n       global ptInd\r\n       print(\"press\")\r\n       if event.inaxes is None:\r\n           return\r\n       if event.button != 1:\r\n           return\r\n       ptInd = get_ind_under_point(event)    \r\n       print(ptInd)\r\n      \r\n\r\n   #This function runs when the mouse click is released\r\n   def button_release_callback(event):\r\n       global ptInd\r\n       print(\"Release\")\r\n       if event.button != 1:\r\n           return\r\n       print(\"Re:\",ptInd)\r\n<\/pre>\n<p>This is a function that runs when the mouse is moved. In this, if the movement is around the point, with the mouse clicked previously. Therefore, it means the user is trying to drag the point. Then, we get the y coordinate of the new location of the mouse and change the curve accordingly, along with the slider.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#This function runs when there is any movement in the mouse\r\n    def action_notify_callback(event):\r\n        global ptInd\r\n        print(\"Move\",ptInd)\r\n        if ptInd is None:\r\n            return\r\n        if event.inaxes is None:\r\n            return\r\n        if event.button != 1:\r\n            return\r\n        print(\"Move\")\r\n        yvals[ptInd] = event.ydata\r\n\r\n        # update curve via sliders and draw\r\n        sliders[ptInd].set_val(yvals[ptInd])\r\n        fig.canvas.draw_idle()\r\n<\/pre>\n<p>Here, we<\/p>\n<p>a. Set the properties of the aces and plot the points and the smooth curve<\/p>\n<p>b. Then we create the slider and set the y values<\/p>\n<p>c. And we run the update() function when the slider is moved<\/p>\n<p>d. And write the commands to track the mouse movements and actions<\/p>\n<p>e. FThen show the plot<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#Setting the plot properties\r\n   X = np.arange(0,xmax+1,0.1)\r\n   ax1.set_yscale('linear')\r\n   ax1.set_xlim(xmin, xmax)\r\n   ax1.set_ylim(ymin,ymax)\r\n   ax1.set_title('DataFlair Graphs')\r\n   ax1.set_xlabel('x---&gt;')\r\n   ax1.set_ylabel('y---&gt;')\r\n   ax1.grid(True)\r\n   ax1.yaxis.grid(True,which='minor',linestyle='--')\r\n   ax1.legend(loc=2,prop={'size':20})\r\n   #Drawing the plot\r\n   l, = ax1.plot (x,yvals,color='k',linestyle='none',marker='o',markersize=8)\r\n   m, = ax1.plot (X, mySpline(X), 'g-', label='Your Graph')\r\n\r\n   #Creating the sliders for all values\r\n   sliders = []\r\n   for i in np.arange(N):\r\n\r\n       axamp = plt.axes([0.84, 0.8-(i*0.05), 0.12, 0.02])\r\n       # Slider\r\n       s = Slider(axamp, 'p{0}'.format(i), ymin, ymax, valinit=yvals[i])\r\n       sliders.append(s)\r\n   #Updating the graph when slider is changed\r\n   for i in np.arange(N):\r\n       sliders[i].on_changed(update)\r\n   axres = plt.axes([0.84, 0.8-((N)*0.05), 0.12, 0.02])\r\n   #Button to get back the original plot\r\n   btn = Button(axres, 'Reset')\r\n   btn.on_clicked(reset)\r\n\r\n   #Checking the motion and action of the mouse and running corresponding function\r\n   fig.canvas.mpl_connect('button_press_event', button_press_callback)\r\n   fig.canvas.mpl_connect('button_release_event', button_release_callback)\r\n   fig.canvas.mpl_connect('motion_notify_event', action_notify_callback)\r\n\r\n   #Showing the plot\r\n   plt.show()\r\n<\/pre>\n<h3>Output of Python Graph Creator Project<\/h3>\n<p>GUI image of the Graph Creator project<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/05\/python-graph-creator-output.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110366\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/05\/python-graph-creator-output.webp\" alt=\"python graph creator output\" width=\"1121\" height=\"913\" \/><\/a><\/p>\n<h3>Summary<\/h3>\n<p>Congratulations, you have successfully built the graph creator project using Python. Hope you have enjoyed building it.<span hidden class=\"__iawmlf-post-loop-links\" data-iawmlf-links=\"[{&quot;id&quot;:2564,&quot;href&quot;:&quot;https:\\\/\\\/drive.google.com\\\/file\\\/d\\\/1YBMrdFLSJ1_3rp-M4JBTBNRQeRSiEjCs\\\/view?usp=drive_link&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20260601072320\\\/https:\\\/\\\/drive.google.com\\\/file\\\/d\\\/1YBMrdFLSJ1_3rp-M4JBTBNRQeRSiEjCs\\\/view?usp=drive_link&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-06-01 08:01:55&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-05 13:51:18&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-17 16:24:44&quot;,&quot;http_code&quot;:200}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-17 16:24:44&quot;,&quot;http_code&quot;:200},&quot;process&quot;:&quot;done&quot;}]\"><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We would have come across situations when we have to plot graphs and find the nature of the curve, especially in school and college. Even if you are the one dealing with a lot&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":110367,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46],"tags":[26334,27049,26712,26713,21082,22734],"class_list":["post-108453","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-basic-python-project","tag-python-create-graph","tag-python-graph-creator","tag-python-graph-creator-project-source-code","tag-python-project","tag-python-project-for-beginners"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Create Graph using Python - Graph Plotting in Python - DataFlair<\/title>\n<meta name=\"description\" content=\"Graph Creator is application that plots graphs from the values of the two coordinates given by the user. Create Graph Creator using Python.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/python-graph-creator-project\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Create Graph using Python - Graph Plotting in Python - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Graph Creator is application that plots graphs from the values of the two coordinates given by the user. Create Graph Creator using Python.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/python-graph-creator-project\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-07-13T05:30:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-06-01T07:23:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/05\/create-graph-using-python.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Create Graph using Python - Graph Plotting in Python - DataFlair","description":"Graph Creator is application that plots graphs from the values of the two coordinates given by the user. Create Graph Creator using Python.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/python-graph-creator-project\/","og_locale":"en_US","og_type":"article","og_title":"Create Graph using Python - Graph Plotting in Python - DataFlair","og_description":"Graph Creator is application that plots graphs from the values of the two coordinates given by the user. Create Graph Creator using Python.","og_url":"https:\/\/data-flair.training\/blogs\/python-graph-creator-project\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2022-07-13T05:30:22+00:00","article_modified_time":"2026-06-01T07:23:38+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/05\/create-graph-using-python.webp","type":"image\/webp"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/python-graph-creator-project\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/python-graph-creator-project\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/b49855299264df5e27e3ec6c2cd9fde9"},"headline":"Create Graph using Python &#8211; Graph Plotting in Python","datePublished":"2022-07-13T05:30:22+00:00","dateModified":"2026-06-01T07:23:38+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/python-graph-creator-project\/"},"wordCount":1222,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/python-graph-creator-project\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/05\/create-graph-using-python.webp","keywords":["basic python project","python create graph","Python graph creator","Python graph creator project source code","Python project","python project for beginners"],"articleSection":["Python Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/python-graph-creator-project\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/python-graph-creator-project\/","url":"https:\/\/data-flair.training\/blogs\/python-graph-creator-project\/","name":"Create Graph using Python - Graph Plotting in Python - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/python-graph-creator-project\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/python-graph-creator-project\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/05\/create-graph-using-python.webp","datePublished":"2022-07-13T05:30:22+00:00","dateModified":"2026-06-01T07:23:38+00:00","description":"Graph Creator is application that plots graphs from the values of the two coordinates given by the user. Create Graph Creator using Python.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/python-graph-creator-project\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/python-graph-creator-project\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/python-graph-creator-project\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/05\/create-graph-using-python.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/05\/create-graph-using-python.webp","width":1200,"height":628},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/python-graph-creator-project\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Python Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/python\/"},{"@type":"ListItem","position":3,"name":"Create Graph using Python &#8211; Graph Plotting in Python"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/b49855299264df5e27e3ec6c2cd9fde9","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team is a group of passionate educators and industry experts dedicated to providing high-quality online learning resources on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. With years of experience in the field, the team aims to simplify complex topics and help learners advance their careers. At DataFlair, we believe in empowering students and professionals with the knowledge and skills needed to thrive in today\u2019s fast-paced tech industry. Follow us for Free courses, expert insights, tutorials, and practical tips to boost your learning journey.","url":"https:\/\/data-flair.training\/blogs\/author\/datafbdad\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/108453","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=108453"}],"version-history":[{"count":7,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/108453\/revisions"}],"predecessor-version":[{"id":148643,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/108453\/revisions\/148643"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/110367"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=108453"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=108453"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=108453"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}