Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

matplotlib plot two y axes

# create figure and axis objects with subplots()
fig,ax = plt.subplots()
# make a plot
ax.plot(gapminder_us.year,
        gapminder_us.lifeExp,
        color="red", 
        marker="o")
# set x-axis label
ax.set_xlabel("year", fontsize = 14)
# set y-axis label
ax.set_ylabel("lifeExp",
              color="red",
              fontsize=14)
Comment

multiple plot in one figure python

import matplotlib.pyplot as plt

plt.plot(<X AXIS VALUES HERE>, <Y AXIS VALUES HERE>, 'line type', label='label here')
plt.plot(<X AXIS VALUES HERE>, <Y AXIS VALUES HERE>, 'line type', label='label here')
plt.legend(loc='best')
plt.show()
Comment

PREVIOUS NEXT
Code Example
Python :: how to check current version of library in python 
Python :: delete tuple from list python 
Python :: discord py import commands 
Python :: get dataframe column names 
Python :: abc python 
Python :: python update 
Python :: kill python process with bash 
Python :: what does int do in python 
Python :: how to generate random numbers in python 
Python :: python save dictionary 
Python :: replace key of dictionary python 
Python :: check how many times a substring appears in a string 
Python :: hot to check tkinter verionin python 
Python :: data structures and algorithms in python 
Python :: how to remove an element in a list by index python 
Python :: good python ide 
Python :: qtablewidget clear python 
Python :: python typing effect 
Python :: install play sound python terminal 
Python :: while loop python 
Python :: sqlite3 python 
Python :: python count items in list 
Python :: groupby and sort python 
Python :: python binary string to int 
Python :: run python.py file 
Python :: two dimensional array python 
Python :: stack queue in python 
Python :: how to get int input in python 
Python :: get ip address py 
Python :: python pil 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =