Skip to content

Commit

Permalink
Updating graphing to include labels and improve the graphs a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
Immudzen committed Oct 11, 2019
1 parent 81ad0ef commit 02993f8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CADETMatch/CADETMatch.pyproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<IsWindowsApplication>False</IsWindowsApplication>
<InterpreterId>CondaEnv|CondaEnv|CADETMatch</InterpreterId>
<LaunchProvider>Standard Python launcher</LaunchProvider>
<CommandLineArguments>"F:\temp\cadet_tutorial\lesson_7\bypass\example_bypass.json" 2</CommandLineArguments>
<CommandLineArguments>"F:\temp\cadet_tutorial\lesson_7\bypass\fit_mcmc\mcmc_refine\example_bypass.json" 2</CommandLineArguments>
<EnableNativeCodeDebugging>False</EnableNativeCodeDebugging>
<InterpreterArguments>-m scoop -n 6</InterpreterArguments>
</PropertyGroup>
Expand Down
4 changes: 3 additions & 1 deletion CADETMatch/kde_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,14 @@ def get_bandwidth(scores, cache):
store = numpy.array(store)

mcmcDir = Path(cache.settings['resultsDirMCMC'])
plt.scatter(numpy.log10(store[:,0]), store[:,1])
plt.figure(figsize=[10,10])
plt.scatter(numpy.log10(store[:,0]), numpy.log10(store[:,1]))
plt.xlabel('bandwidth')
plt.ylabel('cross_val_score')
plt.savefig(str(mcmcDir / "log_bandwidth.png" ), bbox_inches='tight')
plt.close()

plt.figure(figsize=[10,10])
plt.scatter(store[:,0], store[:,1])
plt.xlabel('bandwidth')
plt.ylabel('cross_val_score')
Expand Down
24 changes: 17 additions & 7 deletions CADETMatch/mcmc_plot_tube.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,20 +224,30 @@ def plot_mcmc(output_mcmc, value, expName, name, expTime, expValue):
minValues = value["min"]
maxValues = value["max"]

plt.plot(times, mean)
plt.figure(figsize=[10,10])
plt.plot(times, mean, label='mean')
plt.fill_between(times, mean - std, mean + std,
color='green', alpha=0.2)
color='green', alpha=0.2, label='high prob')
plt.fill_between(times, minValues, maxValues,
color='red', alpha=0.2)
plt.plot(expTime, expValue, 'r')
color='red', alpha=0.2, label='low prob')
plt.plot(expTime, expValue, 'r', label='exp')
plt.xlabel('time(s)')
plt.ylabel('conc(mM)')
plt.legend()
plt.savefig(str(output_mcmc / ("%s_%s.png" % (expName, name) ) ))
plt.close()

row, col = data.shape
alpha = 0.005
alpha = 0.01
plt.figure(figsize=[10,10])
plt.plot(times, data[0,:], 'g', alpha=0.5, label='prob')
plt.plot(times, data.transpose(), 'g', alpha=alpha)
plt.plot(times, mean, 'k')
plt.plot(expTime, expValue, 'r')
plt.plot(times, mean, 'k', label='mean')
plt.plot(expTime, expValue, 'r', label='exp')
plt.xlabel('time(s)')
plt.ylabel('conc(mM)')
plt.legend()

plt.savefig(str(output_mcmc / ("%s_%s_lines.png" % (expName, name) ) ))
plt.close()

Expand Down

0 comments on commit 02993f8

Please sign in to comment.