Font sizes for web application

Hi Matplotlib users,

I have a web application in which I would like to scale the plots down
if the users horizontal screen size is less than 800. Currently only
the plot is scaled while the fonts are fixed in size (see link below
for application). This is of course not a viable solution. I was
therefore wondering what the best way to scale fonts consistently with
figure size is. A requirement is that the scaling is thread safe (or
whatever it is called) in the sense that it should not affect other
threads executing matplotlib (since they may have different screen
resolutions).

As far as I can see the relative font size is not an option since they
seem to be adjusted globally by:

matplotlib.font_manager.set_default_size(size)

If that is true I guess I better calculate the font size each time I
write text to the plot and give it explicitly as an input parameter.
What is your opinion on that?

Best regards,
Jesper

Saving the figure with smaller dpi doesn't work?
It is not clear how you're scaling down the over all plot (smaller
figure size, maybe?),
but I guess the easiest way is to have everything same and save it
with a smaller dpi.

-JJ

···

On Mon, Dec 1, 2008 at 12:56 AM, Jesper Larsen <jesper.webmail@...287...> wrote:

Hi Matplotlib users,

I have a web application in which I would like to scale the plots down
if the users horizontal screen size is less than 800. Currently only
the plot is scaled while the fonts are fixed in size (see link below
for application). This is of course not a viable solution. I was
therefore wondering what the best way to scale fonts consistently with
figure size is. A requirement is that the scaling is thread safe (or
whatever it is called) in the sense that it should not affect other
threads executing matplotlib (since they may have different screen
resolutions).

Jesper Larsen wrote:

I have a web application in which I would like to scale the plots down
if the users horizontal screen size is less than 800.

http://www.scipy.org/Cookbook/Matplotlib/AdjustingImageSize

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...

Thank you for your answers and the obvious solution (banging head into wall).

Best regards,
Jesper

2008/12/1 Jae-Joon Lee <lee.j.joon@...287...>:

···

On Mon, Dec 1, 2008 at 12:56 AM, Jesper Larsen <jesper.webmail@...287...> wrote:

Hi Matplotlib users,

I have a web application in which I would like to scale the plots down
if the users horizontal screen size is less than 800. Currently only
the plot is scaled while the fonts are fixed in size (see link below
for application). This is of course not a viable solution. I was
therefore wondering what the best way to scale fonts consistently with
figure size is. A requirement is that the scaling is thread safe (or
whatever it is called) in the sense that it should not affect other
threads executing matplotlib (since they may have different screen
resolutions).

Saving the figure with smaller dpi doesn't work?
It is not clear how you're scaling down the over all plot (smaller
figure size, maybe?),
but I guess the easiest way is to have everything same and save it
with a smaller dpi.

-JJ