Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to graph with python

# importing the required module
import matplotlib.pyplot as plt
 
# x axis values
x = [1,2,3]
# corresponding y axis values
y = [2,4,1]
 
# plotting the points
plt.plot(x, y)
 
# naming the x axis
plt.xlabel('x - axis')
# naming the y axis
plt.ylabel('y - axis')
 
# giving a title to my graph
plt.title('My first graph!')
 
# function to show the plot
plt.show()
Comment

python graph

from graphlib import TopologicalSorter

graph = {"Diane": {"Bob", "Cindy"}, "Cindy": {"Alice"}, "Bob": {"Alice"}}
# Alice → Bob → Diane
#     ↳ Cindy ↗

sorter = TopologicalSorter(graph)
list(sorter.static_order())
# ['Alice', 'Cindy', 'Bob', 'Diane']
Comment

PREVIOUS NEXT
Code Example
Python :: python launch file 
Python :: python endswith list 
Python :: django message framework 
Python :: tqdm gui 
Python :: django genericforeignkey null 
Python :: django run queryset in terminal 
Python :: positive lookahead regex python 
Python :: streamlit dropdown 
Python :: how to convert a list to a string by newline python 
Python :: barabasi albert graph networkx 
Python :: django form datepicker 
Python :: discord.py owner only commands 
Python :: networkx create graph from dataframe 
Python :: scientific notation to decimal python 
Python :: how to make python open a link 
Python :: how to set gui position tkinter python 
Python :: transparancy argument pyplot 
Python :: python get exception message 
Python :: python read column from csv 
Python :: matplotlib set number of decimal places 
Python :: mongodb check if substring in string 
Python :: How to normalize the data to get to the same range in python pandas 
Python :: matplotlib create histogram edge color 
Python :: make column nullable django 
Python :: docker pyinstaller windowa 
Python :: registering static files in jango 
Python :: force two decimal places python 
Python :: python draw polygon 
Python :: bs4 table examples python 
Python :: values of unique from dataframe with count 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =