4

I'm searching for a possibility to display four textual quadrants in a 2D coordinate system. In fact it's a 2x2 matrix with labels.

The figure I wish to have looks like: Wanted figure

I guees there is an easy way to achieve this using tkiz.

  • Welcome to TeX.SE! Of course there is easy way to draw this :-). What you try so far? For starting point search this site for similar images and for example see http://www.texample.net/. – Zarko Jul 04 '20 at 13:34
  • https://tex.stackexchange.com/questions/414403/drawing-vectors-on-3-d-coordinate-system – js bibra Jul 04 '20 at 13:57
  • First you need to pick a graphics package such as TikZ (PGF), PStricks or pict2e. You could just add all the elements using x.y coordinates. You could use a standard plot axis (data visualization or pgfplots) and use graphics instead of graphis. You could use a TikZ matrix for the text and put the arrows and dashed lines in later. – John Kormylo Jul 04 '20 at 14:40

3 Answers3

2

While you definitely shouldn't ask "do it for me" questions and present some abstract issue you encountered while coding after searching by yourself how to do such a figure, I wanted to practice a bit with this example. It is definitely not optimal and could be improved:

\documentclass{standalone}

\usepackage{tikz} \usetikzlibrary{calc} \usetikzlibrary{arrows.meta}

\begin{document}

\begin{tikzpicture}

    \tikzset{%
        language block/.style = {%
            rectangle,
            draw = blue,
            fill = blue!50!white,
            rounded corners,
            minimum width = 2cm,
            minimum height = 1cm
        }
    }

    \node[
        matrix,
        column sep = 0.5cm,
        row sep = 0.25cm,
    ] (graphmat) {
        \node[language block] (fs) {F\#}; & \node[language block] (s) {Swift};\\
        \node[language block] (f) {Fortran}; & \node[language block] (j) {Java};\\
    };

    \draw[Latex-Latex] (graphmat.north west) |- (graphmat.south east);

    \coordinate (highbottom) at ($(graphmat.south west)!0.75!(graphmat.south east)$);
    \coordinate (lowbottom) at ($(graphmat.south west)!0.25!(graphmat.south east)$);

    \coordinate (highleft) at ($(graphmat.south west)!0.75!(graphmat.north west)$);
    \coordinate (lowleft) at ($(graphmat.south west)!0.25!(graphmat.north west)$);

    \node[below] (hbtext) at (highbottom) {high};
    \node[below] (lbtext) at (lowbottom) {low};

    \node[
        above,
        rotate = 90
    ] (hltext) at (highleft) {high};
    \node[
        above,
        rotate = 90
    ] (lltext) at (lowleft) {low};

    \coordinate (pop) at ($(lbtext)!0.5!(hbtext)$);
    \node[below] at ([yshift = -0.2cm] pop) {\textbf{Popularity of language}};

    \coordinate (new) at ($(lltext)!0.5!(hltext)$);
    \node[
        above,
        rotate = 90
    ] at ([xshift = -0.2cm] new) {\textbf{Newness of language}};

    \draw[dashed] (graphmat.south) -- (graphmat.north);
    \draw[dashed] (graphmat.west) -- (graphmat.east);

\end{tikzpicture}

\end{document}

which yields:

enter image description here

KersouMan
  • 1,850
  • 3
  • 13
  • 15
2

Every first question should be helped. Hope you will post MWE in the next question. The code is self-explained.

enter image description here

\documentclass[tikz,border=5mm]{standalone}
\begin{document}
\begin{tikzpicture}
[cell/.style={draw=teal,fill=teal!50,minimum width=2cm,minimum height=1.5cm,rounded corners=2mm,font=\sffamily\bfseries}]
\def\a{1.5}
\def\b{1}
\path
(\a,\b) node[cell]{Swift}
(\a,-\b) node[cell]{Java} +(-90:1.3) node{high}
(-\a,\b) node[cell]{F\#} +(180:1.8) node[rotate=90]{high}
(-\a,-\b) node[cell]{Fortran} +(-90:1.3) node{low} +(180:1.8) node[rotate=90]{low}
;
\draw[dashed] (2*\a,0)--(-2*\a,0) (0,2*\b)--(0,-2*\b);
\draw[-latex] (-2*\a,-2*\b)--+(0:4.25*\a);  
\draw[-latex] (-2*\a,-2*\b)--+(90:4.25*\b);
\path 
(0,-2.8) node{\bfseries Popularity of language} 
(-4,0) node[rotate=90]{\bfseries Newness of language}   
;
\end{tikzpicture}   
\end{document}
Black Mild
  • 17,569
2

Just for fun, a solution using a matrix to distribute inner nodes and as reference for all additional lines and labels.

\documentclass[tikz, border=2mm]{standalone}
\usetikzlibrary{arrows.meta, matrix}
\usepackage{lmodern}

\begin{document} \begin{tikzpicture}[font=\sffamily, >=LaTeX] \matrix (lang) [matrix of nodes, column sep=3mm, row sep=3mm, nodes={anchor=center, minimum width=3cm, minimum height=2cm, rounded corners=3mm, fill=cyan!90!black, draw=cyan!50!black, line width=.5mm}] {F# & Swift \ Fortran & Java \}; \draw [->, shorten >=-3mm](lang.south west)--(lang.south east); \node[below] at (lang.south-|lang-1-1.center) {low}; \node[below] at (lang.south-|lang-1-2.center) {high}; \draw [->, shorten >=-3mm](lang.south west)--(lang.north west); \node[rotate=90, above] at (lang.west|-lang-2-1.center) {low}; \node[rotate=90, above] at (lang.west|-lang-1-1.center) {high}; \draw[dashed] (lang.south) node[below=5mm, font=\bfseries\sffamily]{Popularity of language}--(lang.north); \draw[dashed] (lang.west) node[rotate=90, above=5mm, font=\bfseries\sffamily]{Newness of language} --(lang.east); %\node \end{tikzpicture} \end{document}

enter image description here

Ignasi
  • 136,588