Commits

James Morrison  committed a56b92f

specify dpi=300 on savefig command

set defauly xy specific legend position in windrose

  • Participants
  • Parent commits e9bbafe

Comments (0)

Files changed (2)

         return ax, fig
         
     def set_legend(self, ax, y_label):
-        l = ax.legend(axespad=-0.10, title=y_label, loc = 'lower right')
+        l = ax.legend(axespad=-0.10, title=y_label)
         l.title = 'Hm0 in metres'
         plt.setp(l.get_texts(), fontsize=8)
         
         #windrose like a stacked histogram with normed (displayed in percent) results
         ax, fig = self.new_axes()
         ax.bar(wd, sig_wave_height, normed=True, opening=1, edgecolor='white', bins=self.bin_values, nsector=32)
-        ax.set_title( title + "\n Radial values indicate percentage of occurences")
-        self.set_legend(ax, y_label)
+        ax.set_title( title + "\n Radial values indicate percentage of occurences") 
         tick_range = range(0,self.ylim,self.interval)
         ax.yaxis.set_ticks(tick_range)
         ax.yaxis.set_ticklabels(tick_range)
         plt.ylim(0,self.ylim)
-        plt.savefig( title + ".png")
+        self.set_legend(ax, y_label)
+        plt.savefig( title, dpi=300)
         plt.plot()        
         self.set_radii_angle(angle=self.radii_angle)
 
 
-    def legend(self, loc='lower right', **kwargs):
+    def legend(self, loc=(0.75,0), **kwargs):
         """
         Sets the legend location and her properties.
         The location codes are