diff --git a/README.md b/README.md index ef9ab041b1973eef4e17ff36675778d975d835bf..f983a18fec3cbf381b10b54e98e220a158d53b87 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ description is loaded, the noise budget can be calculated and plotted: >>> ifo = gwinc.load_ifo('aLIGO') >>> ifo = gwinc.precompIFO(freq, ifo) >>> noises = gwinc.noise_calc(freq, ifo) ->>> gwinc.plot_noise(ifo, noises) +>>> gwinc.plot_noise(noises) ``` Or the `gwinc` convenience function can be used to handle it all: ``` diff --git a/gwinc/__main__.py b/gwinc/__main__.py index 80a029a46f63562b809987bbc06b85ca202f0293..0005c5a72f9d4390fec4af9071408284b33ba24e 100644 --- a/gwinc/__main__.py +++ b/gwinc/__main__.py @@ -64,8 +64,6 @@ parser.add_argument('--title', '-t', help="plot title") parser.add_argument('--fom', help="calculate inspiral range for resultant spectrum ('func[:param=val,param=val]')") -parser.add_argument('--no-displacement', '-nd', action='store_false', dest='displacement', - help="suppress displacement sensitivity axis") group = parser.add_mutually_exclusive_group() group.add_argument('--interactive', '-i', action='store_true', help="interactive plot with interactive shell") @@ -214,7 +212,7 @@ You may interact with plot using "plt." methods, e.g.: >>> plt.savefig("foo.pdf") ''') ipshell.enable_pylab() - ipshell.run_code("plot_noise(ifo, noises)") + ipshell.run_code("plot_noise(noises)") ipshell.run_code("plt.title('{}')".format(title)) ipshell() @@ -224,10 +222,8 @@ You may interact with plot using "plt." methods, e.g.: fig = plt.figure() ax = fig.add_subplot(1, 1, 1) plot_noise( - ifo, noises, ax=ax, - displacement=args.displacement, ) ax.set_title(title) fig.tight_layout() diff --git a/gwinc/plot.py b/gwinc/plot.py index 576d13442ee4979c4b4f1858069427e7594cc6b6..16f6da5ef67300e5685ce7aa02cb098bb5a59a17 100644 --- a/gwinc/plot.py +++ b/gwinc/plot.py @@ -74,16 +74,12 @@ STYLE_MAP = { def plot_noise( - ifo, noises, ax=None, - displacement=True, ): """Plot a GWINC noise budget from calculated noises If an axis handle is provided it will be used for the plot. - `displacement` may be set to False to supress the right had - displacement axis. Returns the figure handle used. @@ -141,11 +137,4 @@ def plot_noise( ax.set_xlim([min(f), max(f)]) ax.set_ylim([3e-25, 1e-21]) - if displacement: - ax_d = ax.twinx() - ax_d.set_yscale('log') - y1, y2 = ax.get_ylim() - ax_d.set_ylim(y1*ifo.Infrastructure.Length, y2*ifo.Infrastructure.Length) - ax_d.set_ylabel(u"Displacement [m/\u221AHz]") - return fig