Graph Decoration in python

Share:

Graph Decoration in python💀

Some graphs properties that you can use to make any graph :

marker

 

It can change the line into points

For example:

marker=’>’   or marker=’*’

ms

marker size

for example:

ms=’20’    or ms=’10’

mec

It can change marker edge color

For example:

mec=’red’   or    mec=’k’

mfc

It can change marker face color

For example:

mfc=’blue,  or   mfc=’ #4CAF50’

ls

It can change line style 

For example:

Ls=’:’

color

It can change the color of line

For example:

color=’black’

linewidth

It can change line width of the graph

For example:

mfc=’10’

 kind

 it can representthe kind of graph 

for example:

kind="scatter"

 here is some programs:

Program 1:

import matplotlib.pyplot as plt

import numpy as np

xpoints = np.array([1, 5])

ypoints= np.array([5,10])

plt.plot(xpoints, ypoints ,'o',color='red')

plt.show()

output:


Program 2:

import matplotlib.pyplot as plt

import numpy as np

ypoints= np.array([3, 8, 1, 10, 5, 7])

plt.plot(ypoints, '^:r', ms = 12 ,mec = "g",mfc = "k", linewidth=10)

plt.show()

output: