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.

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?

share|improve this question

migrated from stackoverflow.com Nov 3 '12 at 13:58

This question came from our site for professional and enthusiast programmers.

1  
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` –  chris Nov 3 '12 at 19:47
add comment

1 Answer 1

up vote 5 down vote accepted

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! ;-)

share|improve this answer
    
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! –  murray Nov 3 '12 at 17:55
    
Thank you very much, it solved my problem entirely. I'm quite new to Mathematica :) Glad to help you too!! –  user1792605 Nov 3 '12 at 19:22
1  
This seems a little hit and miss, GraphicsGrid doesn't seem to work. –  image_doctor Nov 3 '12 at 21:54
    
@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? –  chris Nov 4 '12 at 8:08
    
GraphicsRow seems to work fine, but GraphicsGrid doesn't - Linux - 8.0.4 –  image_doctor Nov 5 '12 at 9:53
add comment

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.