[Bioperl-l] Bio::Graphics Resolution

Jonathan Crabtree jonathancrabtree at gmail.com
Thu Sep 13 09:20:43 EDT 2007


Nathan-

As Chris said, you'll want to use GD::SVG instead of GD.  However, you're
still going to have the issue that you raised that the fonts will be
proportionally small with respect to your figure (particularly if you're
printing a large region at poster size.)  From what I remember GD only gives
you a few font sizes to choose from, so even at the largest size you may
still have problems.  I've worked around this in the past by using scripts
to post-process the resulting SVG.  I do a global search and replace to
increase the font sizes (and, in many cases, to adjust the y-offset of the
text accordingly.)  You may also need to tweak the amount of vertical
whitespace in the image (e.g., between adjacent rows of features) to give
yourself space to increase the font size.  The same caveat applies to the
horizontal dimension, since with a larger font you may have collisions
between labels (assuming that the features in your figure are labeled.)  To
fix this you need to trick Bio::Graphics into thinking the feature labels
are longer than they actually are.  I forget whether I did this by padding
the labels with extra whitespace or actually modifying the code that
computes the feature bounding boxes, but something along those lines should
work.  Essentially you have to trick Bio::Graphics into leaving extra
whitespace so that everything looks OK when you bump up the font sizes.
Unfortunately I don't have a generic script that does this; after generating
a couple of posters this way I switched to direct SVG generation to avoid
the constraints imposed by going through GD.

Jonathan


On 9/13/07, Nathan Haigh <n.haigh at sheffield.ac.uk> wrote:
>
> I want to be able to print my Bio::Graphics image on a poster with good
> resolution. What can I do to ensure I don't get blocky graphics/text.
>
> Altering the width/height of the panel simple increases the size of the
> canvas on which to draw the image, but the text appears the same size
> and thus relatively smaller to the rest of the image. So I don't think
> this would work for printing on a poster.
>
> Cheers,
> Nath
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>


More information about the Bioperl-l mailing list