Changeset 5735 for qesdi/geoplot
- Timestamp:
- 18/09/09 09:57:15 (10 years ago)
- Location:
- qesdi/geoplot/trunk/lib/geoplot
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
qesdi/geoplot/trunk/lib/geoplot/colour_bar.py
r5710 r5735 101 101 cmap.set_bad("w") 102 102 103 elif type(self.cmap) == str:103 elif type(self.cmap) in [str, unicode]: 104 104 cmap = cm.get_cmap(self.cmap) 105 105 cmap.set_bad("w") -
qesdi/geoplot/trunk/lib/geoplot/contour_drawer.py
r5710 r5735 87 87 cmap=cmap, 88 88 origin='lower', 89 linewidths= 1,89 linewidths=0.5, 90 90 norm=normalize, 91 91 extend='neither', -
qesdi/geoplot/trunk/lib/geoplot/layer_drawer.py
r5710 r5735 54 54 self._mapFactory = MapFactory(projection, drawCoast=True, drawRivers=False, resolution=resolution) 55 55 56 def makeImage(self, xLimits=None, yLimits=None, width=800, height=600, dpi= 100):56 def makeImage(self, xLimits=None, yLimits=None, width=800, height=600, dpi=200): 57 57 """ 58 58 Creates a PIL image of the selected area of the layer. -
qesdi/geoplot/trunk/lib/geoplot/layer_drawer_coastline.py
r5710 r5735 5 5 6 6 import logging 7 8 import matplotlib.colors 7 9 8 10 from geoplot.layer_drawer import LayerDrawerBase … … 21 23 resolution=resolution) 22 24 25 self._coastlineColour = 'black' 26 23 27 # must be done after the base constructor or the _mapFactory won't be 24 28 # created … … 33 37 34 38 #draw the map onto the axes 35 map.drawMap(axes) 39 map.basemap.drawcoastlines(ax = axes, 40 linewidth=0.5, 41 color=self.coastlineColour, 42 antialiased=0, 43 xLimits=xLimits, yLimits=yLimits) 44 45 if map.drawRivers: 46 map.basemap.drawrivers(ax = axes, color='b', linewidth=0.3, 47 antialiased=0, 48 xLimits=xLimits, yLimits=yLimits) 49 36 50 37 #map.basemap.fillcontinents(color='coral',lake_color='aqua', ax=axes) 51 #map.basemap.fillcontinents(color='coral',lake_color=None, ax=axes) 52 #map.basemap.drawparallels([10,20,30,40],ax=axes) 38 53 #map.basemap.bluemarble(ax=axes) 54 55 def _getMatplotlibColour(self, value): 56 """ 57 Makes sure that value is a valid matplotlib colour, will convert form a float 58 to a string if neccesary. Will raise a ValueError if the value is not a valid colour. 59 """ 60 if type(value) == float: 61 val = str(value) 62 else: 63 val = value 64 65 try: 66 matplotlib.colors.colorConverter.to_rgb(val) 67 except: 68 raise 69 else: 70 return val 39 71 40 72 def __set_drawRivers(self, value): … … 45 77 46 78 drawRivers = property(__get_drawRivers, __set_drawRivers) 47 79 80 81 def __set_coastlineColour(self, value): 82 83 try: 84 newCoastColour = self._getMatplotlibColour(value) 85 except ValueError, e: 86 log.warning("Error occurred getting matplotlib colour form %s, Exception:%s" % (value, e)) 87 else: 88 self._coastlineColour = newCoastColour 48 89 49 90 def __get_coastlineColour(self): 91 return self._coastlineColour 92 93 coastlineColour = property(__get_coastlineColour, __set_coastlineColour) 50 94 51 95
Note: See TracChangeset
for help on using the changeset viewer.