4
$\begingroup$

In my custom stylesheet that I use for all my notebooks, I had a definition of the style for graphics that looked like so:

Cell[StyleData["Graphics"],
 CellFrame->False,
 TextAlignment->Center,
 TextJustification->0.,
 MenuSortingValue->10000,
 FontFamily->"Times New Roman",
 FontSize->12,
 Background->None,
 GraphicsBoxOptions->{ImageSize->600}]

to set my default font for graphics, and to have the graphics appear centered. This worked fine in Mma10, and resulted in centered graphics. In Mma11, there's a minor issue in that the graphics do not appear centered anymore, but the much more major issue is that using the new Callout command causes series of error messages and ultimately makes the graphics fail:

ListPlot[Table[Callout[i, i], {i, 1, 5}]]

ImageDimensions::imginv: Expecting an image or graphics instead of Internal`PartitionRagged({},{1,1,1,1,1,0,0,0,0,0}).

ImageResize::imginv: Expecting an image or graphics instead of Internal`PartitionRagged({},{1,1,1,1,1,0,0,0,0,0}).

ImageDimensions::imginv: Expecting an image or graphics instead of Internal`PartitionRagged({},{1,1,1,1,1,0,0,0,0,0}).

ImageResize::imginv: Expecting an image or graphics instead of Internal`PartitionRagged({},{1,1,1,1,1,0,0,0,0,0}).

ImageDimensions::imginv: Expecting an image or graphics instead of Internal`PartitionRagged({},{1,1,1,1,1,0,0,0,0,0}).

General::stop: Further output of ImageDimensions::imginv will be suppressed during this calculation.

ImageResize::imginv: Expecting an image or graphics instead of Internal`PartitionRagged({},{1,1,1,1,1,0,0,0,0,0}).

General::stop: Further output of ImageResize::imginv will be suppressed during this calculation.

Part::partw: Part {1,2,3,4,5} of {} does not exist.

MapThread::mptd: Object {}[[{1,2,3,4,5}]] at position {2, 3} in MapThread[Charting`CommonDump`renderCalloutLabels(#1,#2,#3,{Automatic},#4,({1.,1.}  {2.,2.} {3.,3.} {4.,4.} {5.,5.}),{1,2,3,4,5},{},{300,300/\[Phi]},None,(0.   5.
0   5.

),{0.,0},1/\[Phi],(Scaled[0.02] Scaled[0.08]
Scaled[0.02]    Scaled[0.097082039]

),False)&,{(1.  1.
2.  2.
3.  3.
4.  4.
5.  5.

),{{1->Internal`PartitionRagged({},{1,1,1,1,1,0,0,0,0,0})},<<3>>,{5->Internal`PartitionRagged({},{<<1>>})}},<<1>>,({}
{}
{}
{}
{}

)}] has only 0 of required 1 dimensions.

If I take the two lines

 TextAlignment->Center,
 TextJustification->0.,

out, everything works fine. Is this a bug? Any way to work around this? It's not the end of the world, but having my graphics appear centered on the notebook page automatically would be nice.

P.S.: Doing something like:

CellPrint[
 ExpressionCell[ListPlot[Table[Callout[i, i], {i, 1, 5}]], "Output", 
  TextAlignment -> Center]]

works fine, however. Still, I'd like to have those things in the stylesheet, so I don't need to repeat them all the time in my input.

$\endgroup$
  • $\begingroup$ Yup, I'm seeing this on Mathematica 11 on Windows. I would contact Tech Support and let them know you've found a possible bug, wolfram.com/support/contact/email/?topic=Technical $\endgroup$ – user6014 Aug 10 '16 at 20:56
  • $\begingroup$ O.k., sent them a note. $\endgroup$ – Pirx Aug 10 '16 at 21:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.