move legend in plot

This commit is contained in:
theano
2015-11-21 12:09:12 -08:00
committed by Bastian Bloessl
parent 246c394658
commit 81ff17ccd5
5 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -7,8 +7,8 @@ endif
trials := 10
packets := 50
min_snr := -5
max_snr := 15
min_snr := -2
max_snr := 25
snr_steps := 1
interval := 100
+1 -1
View File
@@ -72,7 +72,7 @@ for enc in sorted(table.keys()): # sort so legend labels are in order
plt.ylabel("PDR")
plt.xlabel("SNR")
plt.title("Delivery rate vs. SNR for different encoding schemes")
plt.legend()
plt.legend(loc="upper left")
plt.savefig(os.path.join(path,"plot.png"))
plt.show()
Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

+1 -1
View File
@@ -167,7 +167,7 @@
</param>
<param>
<key>const</key>
<value>(10**(snr/10.0))**.5</value>
<value>((10**(snr/10.0))**0.5)/(2**0.5)</value>
</param>
<param>
<key>affinity</key>
+3 -3
View File
@@ -3,7 +3,7 @@
##################################################
# GNU Radio Python Flow Graph
# Title: Wifi Loopback Nogui
# Generated: Sun Nov 15 22:48:19 2015
# Generated: Sat Nov 21 10:57:29 2015
##################################################
import os
@@ -67,7 +67,7 @@ class wifi_loopback_noGUI(gr.top_block):
block_tags=False
)
self.blocks_null_sink_0 = blocks.null_sink(gr.sizeof_gr_complex*1)
self.blocks_multiply_const_vxx_0 = blocks.multiply_const_vcc(((10**(snr/10.0))**.5, ))
self.blocks_multiply_const_vxx_0 = blocks.multiply_const_vcc((((10**(snr/10.0))**0.5)/(2**0.5), ))
self.blocks_file_sink_0_0 = blocks.file_sink(gr.sizeof_char*1, "" + resultdir + "/ofdm_" + str(ntrials) + "_" + str(nmessages) + "_" + str(snr) + "_" + str(encoding) + "_" + str(interval) + ".pcap", False)
self.blocks_file_sink_0_0.set_unbuffered(True)
@@ -140,8 +140,8 @@ class wifi_loopback_noGUI(gr.top_block):
def set_snr(self, snr):
self.snr = snr
self.blocks_multiply_const_vxx_0.set_k(((10**(self.snr/10.0))**.5, ))
self.blocks_file_sink_0_0.open("" + self.resultdir + "/ofdm_" + str(self.ntrials) + "_" + str(self.nmessages) + "_" + str(self.snr) + "_" + str(self.encoding) + "_" + str(self.interval) + ".pcap")
self.blocks_multiply_const_vxx_0.set_k((((10**(self.snr/10.0))**0.5)/(2**0.5), ))
def get_out_buf_size(self):
return self.out_buf_size