Another question

Dear ALL,

Another (this time possibly quite silly) question: how can I make a
Basemap cover entirely the display area of the GUI backend (ie.,
without the top, bottom, left, right spaces)?

I tried something like:

self.figure = Figure()
self.figure.subplots_adjust(left=-0.01, bottom=-0.750, right=1.0, top=1.55)

but could not control the bottom (or top) margins.

Thanks in advance for any hints.

Best regards,

···

--
Dr. Mauro J. Cavalcanti
Ecoinformatics Studio
P.O. Box 46521, CEP 20551-970
Rio de Janeiro, RJ, BRASIL
E-mail: maurobio@...287...
Web: http://studio.infobio.net
Linux Registered User #473524 * Ubuntu User #22717
"Life is complex. It consists of real and imaginary parts."

Mauro Cavalcanti wrote:

Dear ALL,

Another (this time possibly quite silly) question: how can I make a
Basemap cover entirely the display area of the GUI backend (ie.,
without the top, bottom, left, right spaces)?

I tried something like:

self.figure = Figure()
self.figure.subplots_adjust(left=-0.01, bottom=-0.750, right=1.0, top=1.55)

but could not control the bottom (or top) margins.

The reason is that a map has a fixed aspect ratio, and there is no mechanism for automatically shrinking the appropriate figure dimension to eliminate extra space. You will have adjust the figure dimensions manually.

Eric

···

Thanks in advance for any hints.

Best regards,

Dear Eric,

Thanks for your reply. This is surely not good news -- maybe an
automatic shrinking mechanism could be added in a future version of
Matplotlib (this would be useful not only with maps, but with other
plots as well)?

Regards,

2008/11/20 Eric Firing <efiring@...202...>:

···

Mauro Cavalcanti wrote:

Dear ALL,

Another (this time possibly quite silly) question: how can I make a
Basemap cover entirely the display area of the GUI backend (ie.,
without the top, bottom, left, right spaces)?

I tried something like:

self.figure = Figure()
self.figure.subplots_adjust(left=-0.01, bottom=-0.750, right=1.0,
top=1.55)

but could not control the bottom (or top) margins.

The reason is that a map has a fixed aspect ratio, and there is no mechanism
for automatically shrinking the appropriate figure dimension to eliminate
extra space. You will have adjust the figure dimensions manually.

Eric

Thanks in advance for any hints.

Best regards,

--
Dr. Mauro J. Cavalcanti
Ecoinformatics Studio
P.O. Box 46521, CEP 20551-970
Rio de Janeiro, RJ, BRASIL
E-mail: maurobio@...287...
Web: http://studio.infobio.net
Linux Registered User #473524 * Ubuntu User #22717
"Life is complex. It consists of real and imaginary parts."

Mauro Cavalcanti wrote:

Dear ALL,

Another (this time possibly quite silly) question: how can I make a
Basemap cover entirely the display area of the GUI backend (ie.,
without the top, bottom, left, right spaces)?

I tried something like:

self.figure = Figure()
self.figure.subplots_adjust(left=-0.01, bottom=-0.750, right=1.0, top=1.55)

but could not control the bottom (or top) margins.

Thanks in advance for any hints.

Best regards,

Mauro: You'll have to create a figure with the same aspect ratio as the map, and then add an axes to the figure that fills the entire figure (i.e. fig.add_axes([0,0,1,1]). The `aspect` Basemap instance variable tells you the aspect ratio of the map. For instance, in the wx embedding example you sent me, the map.aspect = 0.5. Therefore, you would need to create a figure canvas that is twice as wide as it is high, like this

self.figure = Figure(figsize=(10,5))

then add an axes instances that fills the figure completely

self.ax = self.figure.add_axes([0,0,1,1])

Note that you will not have any room for labels if you do this.

HTH,

-Jeff

···

--
Jeffrey S. Whitaker Phone : (303)497-6313
NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449
325 Broadway Boulder, CO, USA 80305-3328