I need to make a table in this specific format

enter image description here

The main problem is that I do not want to use any other package and want to do it in only latex code!

Note: I found a related question but it uses TikZ to solve the problem. However I want pure latex code only.

  • 2
    May I ask why you want it to be pure (La)TeX? – Grimler Oct 6 '15 at 16:01
  • 1
    Confusion matrix is new to me. Do you mean correlation matrix? – user31729 Oct 6 '15 at 16:11
  • This is related, but uses packages: tex.stackexchange.com/questions/172578/…. My answer there uses xcolor, graphicx, and stackengine, but not tikz. – Steven B. Segletes Oct 6 '15 at 16:22
  • @ChristianHupfer Confusion matrix is used in binary machine learning classification problems / medical diagnosis and show frequencies of true positive, false positive, false negative and false positive cases and the subtotal tallies for a classifier or diagnosis method. – Mobius Pizza Oct 7 '15 at 10:19

Just graphicx to rotate the "Source2" label:

enter image description here

The code:


  \fbox{\parbox[c][1.7cm][c]{1.7cm}{\centering #1}}%
  \parbox[c][1.7cm][c]{1cm}{\centering\bfseries #1}%
  \parbox[c][1cm][c]{#1}{\centering\bfseries #2}%




I won't claim this is a very good solution, but the built-in picture can be used for this. I did use graphicx for \rotatebox though.

enter image description here






\put (-1.2,1.5){\rotatebox{90}{Text}}

Your Answer

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

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