In [8]:
import sys,os,os.path
sys.path.append("D:\DRIVE\MS CS UCU\Algorithms and Data Structures\project\ucu-adc-coursework\graphs\negative-cycle")

import matplotlib.pyplot as plt
import numpy as np
%load utils.py
import utils as u
%matplotlib inline

plt.style.use('ggplot')

bf_01_r = u.read_test_result("results/bellman-ford-0.10.txt")
fw_01_r = u.read_test_result("results/floyd-warshall-0.10.txt")

# Two subplots, the axes array is 1-d
f, axarr = plt.subplots(2, sharex=True)
axarr[0].plot(bf_01_r[0], bf_01_r[1], color="blue")
axarr[0].plot(fw_01_r[0], fw_01_r[1], color="green")
axarr[0].set_title('Sharing X axis')
axarr[1].plot(bf_01_r[0], bf_01_r[2], color="blue")
axarr[1].plot(fw_01_r[0], fw_01_r[2], color="green")

plt.show()



ValueErrorTraceback (most recent call last)
<ipython-input-8-e8b639d8c482> in <module>()
      4 import matplotlib.pyplot as plt
      5 import numpy as np
----> 6 get_ipython().magic(u'load utils.py')
      7 import utils as u
      8 get_ipython().magic(u'matplotlib inline')

C:\Users\Anatoliy\Anaconda2\lib\site-packages\IPython\core\interactiveshell.pyc in magic(self, arg_s)
   2161         magic_name, _, magic_arg_s = arg_s.partition(' ')
   2162         magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
-> 2163         return self.run_line_magic(magic_name, magic_arg_s)
   2164 
   2165     #-------------------------------------------------------------------------

C:\Users\Anatoliy\Anaconda2\lib\site-packages\IPython\core\interactiveshell.pyc in run_line_magic(self, magic_name, line)
   2082                 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
   2083             with self.builtin_trap:
-> 2084                 result = fn(*args,**kwargs)
   2085             return result
   2086 

<decorator-gen-46> in load(self, arg_s)

C:\Users\Anatoliy\Anaconda2\lib\site-packages\IPython\core\magic.pyc in <lambda>(f, *a, **k)
    191     # but it's overkill for just that one bit of state.
    192     def magic_deco(arg):
--> 193         call = lambda f, *a, **k: f(*a, **k)
    194 
    195         if callable(arg):

C:\Users\Anatoliy\Anaconda2\lib\site-packages\IPython\core\magics\code.pyc in load(self, arg_s)
    316         search_ns = 'n' in opts
    317 
--> 318         contents = self.shell.find_user_code(args, search_ns=search_ns)
    319 
    320         if 's' in opts:

C:\Users\Anatoliy\Anaconda2\lib\site-packages\IPython\core\interactiveshell.pyc in find_user_code(self, target, raw, py_only, skip_encoding_cookie, search_ns)
   3184         except Exception:
   3185             raise ValueError(("'%s' was not found in history, as a file, url, "
-> 3186                                 "nor in the user namespace.") % target)
   3187 
   3188         if isinstance(codeobj, string_types):

ValueError: 'utils.py' was not found in history, as a file, url, nor in the user namespace.

In [ ]:
bf_025_r = u.read_test_result("results/bellman-ford-0.25.txt")
fw_025_r = u.read_test_result("results/floyd-warshall-0.25.txt")

# Two subplots, the axes array is 1-d
f, axarr = plt.subplots(2, sharex=True)
axarr[0].plot(bf_025_r[0], bf_025_r[1], color="blue")
axarr[0].plot(fw_025_r[0], fw_025_r[1], color="green")
axarr[0].set_title('Sharing X axis')
axarr[1].plot(bf_025_r[0], bf_025_r[2], color="blue")
axarr[1].plot(fw_025_r[0], fw_025_r[2], color="green")

plt.show()