4
$\begingroup$

I have to make a document with multiple bar charts and export it:

A = BarChart[Table[CAB[[1, i]], {i, 16}], ChartLabels -> {"1", "2", "3", "4", "5", "6", "7", 
    "8", "9", "10", "11", "12", "13", "14", "15", "16"}];
Export["Barcharts_2.tex", A];

This is not a problem, but when I try to export multiple bar charts (in my case sixteen):

A = (BarChart[Table[CAB[[1, i]], {i, 16}]]
     BarChart[Table[CAB[[2, i]], {i, 16}]])
Export["Barcharts_2.tex", A];

I get this error:

TeXForm::unspt 

Could anyone help me with this?

$\endgroup$
1
  • 1
    $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2)Read the FAQs! 3) When you see good Q&A, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. ALSO, remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign` $\endgroup$
    – chris
    Commented Nov 3, 2012 at 19:47

1 Answer 1

6
$\begingroup$

May be its a matter of using GraphicsRow?

  plot = GraphicsRow[{ BarChart[Table[i, {i, 5}], ChartStyle -> "DarkRainbow"],
  BarChart[{{1, 2, 3}, {1, 3, 2}}] }]

Mathematica graphics

  Export["test.tex",plot];

works.

I didn't know you could export directly graphs to TeX so I learnt something! ;-)

$\endgroup$
5
  • $\begingroup$ Actually, what the Export does here is create (1) a skeleton .tex document text.tex that has an \includegraphics command; and (2) an .eps file with the actual graphics. That is pretty neat! $\endgroup$
    – murray
    Commented Nov 3, 2012 at 17:55
  • $\begingroup$ Thank you very much, it solved my problem entirely. I'm quite new to Mathematica :) Glad to help you too!! $\endgroup$ Commented Nov 3, 2012 at 19:22
  • 1
    $\begingroup$ This seems a little hit and miss, GraphicsGrid doesn't seem to work. $\endgroup$ Commented Nov 3, 2012 at 21:54
  • $\begingroup$ @image_doctor it does for mac-os 10.7.5 + mathematica 8.0.4 (?) i.e. it produces a latex file and an eps file which you can process? $\endgroup$
    – chris
    Commented Nov 4, 2012 at 8:08
  • $\begingroup$ GraphicsRow seems to work fine, but GraphicsGrid doesn't - Linux - 8.0.4 $\endgroup$ Commented Nov 5, 2012 at 9:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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