out_i['dir'] = 'Low $[S^{**}]$' out = pandas.concat([out, out_i[out.columns]]) for i in range(len(sim_res_rev)): out_i = pandas.DataFrame(sim_res_rev[i], columns=out.columns[3:]) out_i['time'] = t out_i['signal'] = numpy.flip(C3_scan)[i] out_i['dir'] = 'High $[S^{**}]$' out = pandas.concat([out, out_i[out.columns]]) out.to_csv("./num_cont_nuts_model/sim2.txt", sep="\t", index=False) ###################### plotting ################################## g = ( ggplot(out, aes('time', response, group='signal', color='signal')) + geom_line(size=0.5) # + ylim(0, 202) + labs(x="time", y="$[S^{**}]$") + scale_color_distiller( palette='RdYlBu', type="diverging", name="$B_{tot}$") + facet_wrap('~dir') + theme_bw()) g.save(filename="./num_cont_nuts_model/sim_fwd_rev2.png", format="png", width=8, height=4, units='in', verbose=False) eq = out[out.time == max(out.time)] # with pandas.option_context('display.max_rows', None, 'display.max_columns', None): # more options can be specified also # print(eq) g = (ggplot(eq) + aes(x='signal', y=response, color='dir') + labs(x="$B_{tot}$", y="$[S^{**}]$", color="") +
out_i['time'] = t out_i['signal'] = C3_scan[i] out_i['dir'] = 'Low $[S^{**}]$' out = pandas.concat([out, out_i[out.columns]]) for i in range(len(sim_res_rev)): out_i = pandas.DataFrame(sim_res_rev[i], columns=out.columns[3:]) out_i['time'] = t out_i['signal'] = numpy.flip(C3_scan)[i] out_i['dir'] = 'High $[S^{**}]$' out = pandas.concat([out, out_i[out.columns]]) out.to_csv("./num_cont_graphs/sim2.txt", sep="\t", index=False) ###################### plotting ################################## g = (ggplot(out, aes('time', response, group='signal', color='signal')) + geom_line(size=0.5) + ylim(0, 202) + labs(x="time", y="$[S^{**}]$") + scale_color_distiller( palette='RdYlBu', type="diverging", name="$B_{tot}$") + facet_wrap('~dir') + theme_bw()) g.save(filename="./num_cont_graphs/sim_fwd_rev2.png", format="png", width=8, height=4, units='in', verbose=False) eq = out[out.time == max(out.time)] g = (ggplot(eq) + aes(x='signal', y=response, color='dir') + labs(x="$B_{tot}$", y="$[S^{**}]$", color="") + geom_path(size=2, alpha=0.5) + geom_point(color="black") + theme_bw() + geom_point(color="black") + annotate("point", x=plot_specifications[2][0][0],
out_i['time'] = t out_i['signal'] = C3_scan[i] out_i['dir'] = 'fwd' out = pandas.concat([out, out_i[out.columns]]) for i in range(len(sim_res_rev)): out_i = pandas.DataFrame(sim_res_rev[i], columns=out.columns[3:]) out_i['time'] = t out_i['signal'] = numpy.flip(C3_scan)[i] out_i['dir'] = 'rev' out = pandas.concat([out, out_i[out.columns]]) out.to_csv("sim.txt", sep="\t", index=False) ###################### plotting ################################## g = (ggplot(out, aes('time', 's2', group='signal', color='signal')) + geom_line(size=0.5) + ylim(0, 20000) + scale_color_distiller(palette='RdYlBu', type="diverging") + facet_wrap('~dir') + theme_bw()) g.save(filename="./num_cont_graphs/sim_fwd_rev.png", format="png", width=8, height=4, units='in', verbose=False) eq = out[out.time == max(out.time)] g = (ggplot(eq) + aes(x='signal', y='s2', color='dir') + geom_path(size=2, alpha=0.5) + geom_point(color="black") + theme_bw()) g.save(filename="./num_cont_graphs/sim_bif_diag.png", format="png", width=8, height=4,