Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

This question is strongly related to:

NotebookWrite Cell with Grid

Let’s create sample chart

mydata = {{"Noise Density \n(\[Mu]g/\!\(\*SuperscriptBox[\(Hz\), \
\(0.5\)]\))", "Mean", "StDev", "Min", "Q1", "Median", "Q3", 
"Max"}, {"X ", 5., 4., 21., 26., 29., 33., 35.}, {"Y ", 25., 5., 
18., 20., 25., 29., 34.}, {"Z ", 39., 4., 30., 38., 39., 40., 
47.}};


myChart = 
  Grid[mydata
, BaseStyle -> {FontFamily -> "Helvetica Neue"
, FontTracking -> "SemiCondensed", FontWeight -> “Thin”, FontSize -> 10}
, Frame -> True
, Dividers -> {{True, True}, {True, True}}
, Spacings -> {2, 1}
, Alignment -> {{Center, Left}, Right}
, Background -> {{1 -> LightGray}}]

The chart renders OK on evaluation:

sample chart

However, when I try to write the chart to a new document:

CreateDocument[ ExpressionCell@myChart]

It inserts it as follows:

Probelmatic chart

What is the correct method of writing a grid to a document?

share|improve this question
    
Does this work for what you need: CreateDocument[ExpressionCell[myChart, ShowStringCharacters -> False]]? –  kguler Apr 18 at 15:21
    
Great… if you post it as an answer that would be great… –  Pam Apr 18 at 15:26
    
@kguler: I can’t seem to do: SetOptions[ExpressionCell, ShowStringCharacters -> False]; and have it propagate through out my document creations… any ideas? –  Pam Apr 18 at 15:28
    
SetOptions[EvaluationNotebook[], ShowStringCharacters -> False] works? –  kguler Apr 18 at 16:17
    
Yes. That seems to work –  Pam Apr 18 at 20:13

2 Answers 2

up vote 3 down vote accepted
CreateDocument[ExpressionCell[myChart, ShowStringCharacters -> False]]

enter image description here

share|improve this answer
    
Sometimes I feel like the amount of styling options with unintuitive default behaviour is "too ... high" :) –  Kuba Apr 18 at 16:26
    
@Kuba, agree .. :) –  kguler Apr 18 at 16:27
    
:-) Not to mention that ShowStringCharacters does not appear in the Documentation for ExpressionCell –  Pam Apr 18 at 20:13

Use the expression cell style, "Print":-

CreateDocument[ExpressionCell[myChart, "Print"]]
share|improve this answer
    
"Output" will work too but with both there is a difference in CellMargins in comparision to simple ExpressionCell. –  Kuba Apr 18 at 16:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.