2

Is it possible to draw "Magic Quadrant chart" in latex? This is an example of it:

enter image description here

I don't want the exact answer. I need some clues to know if I can draw it with latex or not. If yes, would you please let me know the name of chart and package.

Thanks a lot.

  • 3
    Welcome to TeX SX! What is a Magic Quadrant? – Bernard Oct 14 '14 at 10:26
  • 1
    Welcome to TeX.SX! When asking questions it is better to provide a full minimal working example (MWE). The MWE should like like \documentclass...\begin{document}...\end{document}, it should compile and contain close to the minimal amount of code needed to explain/demonstrate what you are asking. This saves a lot of time for everyone. In this case, I for one have no idea what a "magic quadrant" so an example would help. –  Oct 14 '14 at 10:28
  • I assume you mean what is called in English a Magic Square? http://en.wikipedia.org/wiki/Magic_square I don't think there's a package out there to do that. – Alan Munn Oct 14 '14 at 11:40
  • 4
    The picture doesn't look anything like a magic square (which is an array of numbers). It looks like a labelled scatter plot, which is pretty easy with pgfplots. Look at the pgfplots manual. But how do you arrive at numeric values for your ``variables''? – Benjamin McKay Oct 14 '14 at 13:22
  • 1
    A few days ago I did something that could be the starting point for this: http://uweziegenhagen.de/?p=3041. You just need to find out how to feed the chart from a CSV. – Uwe Ziegenhagen Oct 14 '14 at 17:03

1 Answers1

6

Either embed it as an external graphic, as described in the Wikibook page on graphics in LaTeX, or draw it with one of the many drawing packages discussed in this answer, such as Metapost which I used for this not very serious example.

A four box model

The (x,y) coordinates are based on numbers of questions asked in the most popular topics on tex.SE.

prologues := 3;
outputtemplate := "%j%c.eps";
% a magic quadrant template
beginfig(1);
defaultfont := "phvr8r";

s = 3.4in;

fill unitsquare scaled s                withcolor .95 white;
fill unitsquare scaled s shifted -(s,s) withcolor .95 white;

path L, a,b,c,d;
L = unitsquare xscaled 1/2s yscaled 1/12s;
a = L shifted (1/4s,11/12s);
b = L shifted (-3/4s,11/12s);
c = L shifted (-3/4s,-s);
d = L shifted (1/4s,-s);

drawoptions(withcolor .98 white);
fill a; fill b; fill c; fill d;

drawoptions(withcolor .8 white);
draw a; draw b; draw c; draw d; 
label("LEADERS",       center a);
label("CHALLENGERS",   center b);
label("NICHE PLAYERS", center c);
label("VISIONARIES",   center d);

draw (left--right) scaled s withpen pensquare scaled 1;
draw (down--up   ) scaled s withpen pensquare scaled 1;
draw unitsquare shifted -(1/2,1/2) scaled 2s withpen pensquare scaled 2;

picture xx, yy, date; 
xx = thelabel.lrt("COMPLETE LACK OF VISION", llcorner currentpicture);
yy = thelabel.ulft("ABILITY TO LOOK CUTE" 
              infont defaultfont rotated 90, llcorner currentpicture);
date = thelabel.llft("As of 1 April 2015",   lrcorner currentpicture);
draw xx;
draw yy;
drawarrow ((12,4) -- (53,4)) shifted lrcorner xx;
drawarrow ((4,12) -- (4,53)) shifted ulcorner yy;
draw date;
drawoptions();

picture blob; color blu; blu = (22/255,90/255,150/255);
blob = image(
for i=10 step -1 until 3: fill fullcircle scaled .9i withcolor ((8-i/2)/10)[blu,white]; endfor
draw fullcircle scaled 9 withcolor blu;);

vardef do_mark(expr name,x,y,offset) =
   save p, t; pair p; p := ((x-5)/5,(y-20)/20) scaled s;
   picture t; t = thelabel(name,p+offset);
   if (abs(ypart offset) > 16) or (length(offset)>1cm):
     draw p -- p+offset cutafter bbox t withpen pencircle scaled .3 withcolor .5 white; 
   fi
   draw blob shifted p; draw t withcolor blu;
enddef;

do_mark("tikz-pgf"            , 9.249,  5, (  0, 12));
do_mark("tables"              , 4.701, 20, (  0, 12));
do_mark("beamer"              , 3.822, 15, ( 24, 0));
do_mark("fonts"               , 3.302, 24, (  0, 12));
do_mark("math-mode"           , 3.298, 18, ( 32, 0));
do_mark("spacing"             , 2.983, 14, (  0, 12));
do_mark("macros"              , 2.851,  9, ( 22, -6));
do_mark("pgfplots"            , 2.824, 27, (  0, 12));
do_mark("graphics"            , 2.608, 18, (  0, 12));
do_mark("biblatex"            , 2.539, 10, ( 40, 20));
do_mark("table-of-contents"   , 2.429,  8, ( 43, -6));
do_mark("bibtex"              , 2.272, 10, ( 10, 22));
do_mark("floats"              , 2.230,  9, ( 48, 12));
do_mark("sectioning"          , 2.224,  5, ( 30, -3));
do_mark("bibliographies"      , 2.071,  9, (-20, 22));
do_mark("horizontal-alignment", 2.041,  6, ( 52, 2));
do_mark("xetex"               , 1.846, 14, ( 12, 24));
do_mark("errors"              , 1.845, 29, (  0, 12));
do_mark("hyperref"            , 1.706,  7, (-27, -6));
do_mark("formatting"          , 1.696,  9, (-36, -12));
do_mark("equations"           , 1.688,  5, (  0, -24));
do_mark("symbols"             , 1.622, 14, (-20, 22));
do_mark("header-footer"       , 1.582, 12, (-36, 2));
do_mark("cross-referencing"   , 1.574, 34, (  0, 12));
do_mark("pdftex"              , 1.503, 10, (-32, -2));

setbounds currentpicture to bbox currentpicture scaled 1.05;
endfig;
end.
Thruston
  • 42,268