<div dir="ltr">Hello all<div><br></div><div>I'm producing some pngs for an article, using d.mon, d.grid and d.legend in a python loop. In some of the images, the legend background is fine, but in others, the background rectangle is way larger than what I defined.</div><div><br></div><div>This is an example of the loop:</div><div><br></div><div><br></div><div><div>araca = ['tdx12_Araca', 'tdx30_Araca', 'srtm30_Araca', 'aster30_Araca', 'aw3d30_avg_Araca']</div><div>area_name = area[0].split('_')[-1]</div><div>for dem in area:</div><div>    grass.run_command('g.region', raster=dem, flags='pa', res='0:0:01')</div><div>    out_shade = dem + '_shade_315_20'</div><div>    grass.run_command('d.mon', start='png', output=dem+'.png', resolution = '2', height=600, width=600, overwrite=True)</div><div>    grass.run_command('d.shade', shade=out_shade, color=dem)</div><div>    grass.run_command('d.grid', size='0.25', text_color='white', color='white', border_color='white', flags='c')</div><div>    grass.run_command('d.legend', raster=dem, flags='sb', at='4,25,2,4', font='Helvetica', \</div><div>        fontsize=12, bgcolor='240:240:240', range=(0,1500), units=' m')</div><div>    grass.run_command('d.mon', stop='png')</div><div>    print('PNG export OK. map: ' + dem)</div><div><br></div><div><br></div><div>This are examples of the results, note the legend background.</div><div><br></div><div><br></div><div><a href="https://www.dropbox.com/s/skecv5lpxza7led/tdx30_Araca.png?dl=0">https://www.dropbox.com/s/skecv5lpxza7led/tdx30_Araca.png?dl=0</a><br></div><div><a href="https://www.dropbox.com/s/szbmq5kqinfbiff/aster30_wgs84_Araca.png?dl=0">https://www.dropbox.com/s/szbmq5kqinfbiff/aster30_wgs84_Araca.png?dl=0</a><br></div><div><br></div><div><br></div><div><br></div><div>I've run this same script previously without any issues.</div><div><br></div><div>Any hints on why this is happening are greatly appreciated.</div><div><br></div><div>Carlos</div><div><br></div><div><br></div><div><br></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Prof. Carlos Henrique Grohmann<br>Institute of Energy and Environment - Univ. of São Paulo, Brazil<div>- Digital Terrain Analysis | GIS | Remote Sensing - </div><div><br></div><div><a href="http://carlosgrohmann.com/" target="_blank">http://carlosgrohmann.com</a></div><div><a href="http://orcid.org/0000-0001-5073-5572" style="font-size:13px;color:rgb(17,85,204);font-family:arial,sans-serif;background-color:rgb(255,255,255)" target="_blank">http://orcid.org/0000-0001-5073-5572</a><br><div>________________<br>Can’t stop the signal.</div></div></div></div>
</div></div>