MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Font and Style problems using Image to create bitmaps of Plots/Charts etc

  • To: mathgroup at smc.vnet.net
  • Subject: [mg119981] Re: Font and Style problems using Image to create bitmaps of Plots/Charts etc
  • From: John Fultz <jfultz at wolfram.com>
  • Date: Sun, 3 Jul 2011 04:11:23 -0400 (EDT)
  • Reply-to: jfultz at wolfram.com

This is a bug, which I've now reported.

There are workarounds which involve constructing a Notebook[] expression on your 
own with the right options to be rasterized.  I could put together a simple
workaround for the basic cases for you if you like, but putting together one
that deals well with all of the various options for Image (or Rasterize, which 
is what Image is doing behind the scenes) is more work than I can offer right 
now.

Sincerely,

John Fultz
jfultz at wolfram.com
User Interface Group
Wolfram Research, Inc.


On Sat, 2 Jul 2011 05:01:05 -0400 (EDT), Roger Wilson wrote:
> In a default setting...
>
> plot = Plot[Sin[x], {x, -10, 10}, Frame -> True, PlotLabel -> "Sine
> Wave"]
>
> and
>
> Image[plot]
>
> Will look the same.
>
> However, if Style options have been set either through OptionInspector
> FormattingOptions/GraphicsBoxOptions/GraphicsBoxOptions/DefaultStyle
> or the "Graphics" style has been altered in the notebook's StyleSheet
> (e.g. a change of FontFamily, FontWeight, FontFace etc).  Then the two
> will be different.  The Graphic entity plot will have the styles
> applied and the raster produced by Image will have them all stripped
> off.
>
> Now something like this does work...
>
> plot2 = Plot[Sin[x],{x,-10,10},Frame->True,PlotLabel->"Sine
> Wave",FrameTicksStyle->Directive[FontSize->15,FontColor-
>> Blue,FontSlant->Italic,FontWeight->Bold]]
>>
> Image[plot2]
>
> Both are pretty much identical so Image can produce the correct styles
> just clearly does not inherit them from either GraphicsBoxOptions (nor
> RasterBoxOptions) or from the prevailing "Graphics" style of the
> stylesheet.
>
> So where do they come from and can they be changed?
>
> Many thanks for reading.




  • Prev by Date: Is Put - Get cycle in Mathematica always deterministic?
  • Next by Date: Insoluble marbles-in-urn problem?
  • Previous by thread: Re: Font and Style problems using Image to create bitmaps of Plots/Charts etc
  • Next by thread: Re: Font and Style problems using Image to create bitmaps of Plots/Charts etc