Import:
In [1]:
%matplotlib inline
from graph_extract import Graph
Define properties of your graph:
In [2]:
path = 'graph_1.png'
x = (1500, 900)
y = (75, -100)
Make the graph object:
In [3]:
g = Graph('graph_1.png', xlim=x, ylim=y)
The image name is used as the name:
In [4]:
g.name
Out[4]:
Can visualize the image:
In [5]:
g.show_img()
Out[5]:
The fit is obtained as a series from the data
property of the Graph
object:
In [6]:
g.data.head()
Out[6]:
This can be visualized:
In [7]:
g.show_data()
Out[7]:
This can be superimposed over the original image:
In [8]:
plt.figure(figsize=(10,8))
plt.axis('off')
g.show_fit()
We can save out the data using pandas' to_csv method:
In [9]:
g.data.to_csv('graph_1.csv')