Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

How to print specific figure in python

# load matplotlib modules
import matplotlib
import matplotlib.pyplot as plt
import numpy as np

# data to plot
y = [2,4,6,8,10,12,14,16,18,20]
x = np.arange(10)

# create plot
fig = plt.figure()
ax = plt.subplot(111)
ax.plot(x, y, label='$y = numbers')
plt.title('Legend inside')
ax.legend()

# save plot to file
fig.savefig('plot.png')
Comment

PREVIOUS NEXT
Code Example
Python :: calculating expressions with sqrt signs 
Python :: why do we need to preprocess data 
Python :: generate natural numbers python 
Python :: twitter python 
Python :: Python - Common Conditional Statements 
Python :: django check if related object is None 
Python :: python list chunks using yield 
Python :: Find Resolution of JPEG Image 
Python :: how to use kite python 
Python :: python array to text 
Python :: india states django choices 
Python :: when i press tab it shows ipynb_checkpoints/ in jupyter notebook 
Python :: django multi column index 
Python :: in np array how to make element as 1 if it exceeds the threshold 
Python :: odoo site map for employees hierarchy 
Python :: corresponding angles 
Python :: How many handshakes for all the people in your class? python code 
Python :: How to send data to scrapy pipeline to mongodb 
Python :: how to place an id to every element in list in python 
Python :: python convert unicode escape sequence 
Python :: Syntax Closing a File in python 
Python :: Python Module Search Path 
Python :: Python Getting back to Decorators 
Python :: rich content field django ckeditor not showing bullets 
Python :: disable kivy button in kv 
Python :: rom requests_html import HTML 
Python :: dynamic id python 
Python :: python list example 
Python :: fecthone 
Python :: docker python no module named 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =