# plotting – Generating PlotLabel with mathematical formatting

What’s a good pattern to insert properly formatted matrices into `PlotLabel`? I’m trying to insert something like the following into my plot, where the matrix is programmatically generated.

$$f(x,y)= left( begin{array}{cc} x&y end{array} right) left( begin{array}{cc} 1.00 & 0.00 \ 0.00 & 2.00 \ end{array} right) left( begin{array}{c} x \ y \ end{array} right)$$

Doing `PlotLabel->MatrixForm(mymatrix)` displays the matrix part properly, but how do I concatenate it with the other bits?

``````rotatedAxes(angle_) := (
H = With({r = RotationMatrix(Pi/4)},
r . DiagonalMatrix({1, 2}) . Inverse(r));
f({x_, y_}) = {x, y} . H . {x, y};

rotmat = RotationMatrix(angle);
xaxis = rotmat . {5, 0};
yaxis = rotmat . {0, 5};
Hdisp =
Map(NumberForm(#, {3, 2}) &,
N(Inverse(rotmat) . H . rotmat), {2}) // MatrixForm;

ContourPlot(f({x, y}), {x, -2, 2}, {y, -2, 2},
ContourShading -> None, Contours -> 15,
ContourStyle -> Directive(RGBColor(0.5, 0.5, 1)), Frame -> None,
AxesStyle -> Directive(Black),
Epilog -> {
AxisObject(InfiniteLine({{0, 0}, xaxis}), {-1, 1},
TickLabels -> None),
AxisObject(InfiniteLine({{0, 0}, yaxis}), {-1, 1},
TickLabels -> None)},
PlotLabel -> Hdisp
)
);
rotatedAxes(Pi/4)
`````` Posted on Categories Articles
{"ft_lang_label":"__label__en","ft_lang_prob":0.522999,"math_prob":0.9970199,"size":1179,"snap":"2021-31-2021-39","text_gpt3_token_len":408,"char_repetition_ratio":0.100425534,"word_repetition_ratio":0.0,"special_character_ratio":0.3808312,"punctuation_ratio":0.2672065,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9993722,"pos_list":[0,1,2],"im_url_duplicate_count":[null,1,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-09-20T22:39:57Z\",\"WARC-Record-ID\":\"<urn:uuid:a25372e4-9a72-4f4c-8dc7-30d4ee0c9797>\",\"Content-Length\":\"27157\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:34092f10-5609-4fae-afc4-26a22fd7e3d9>\",\"WARC-Concurrent-To\":\"<urn:uuid:eda53586-02e5-4b9b-a403-1b1b9852f345>\",\"WARC-IP-Address\":\"173.212.203.156\",\"WARC-Target-URI\":\"https://proxies-free.com/plotting-generating-plotlabel-with-mathematical-formatting/\",\"WARC-Payload-Digest\":\"sha1:HF5KY4TMCUJXV5A32L7L5Q3F46T4SYG2\",\"WARC-Block-Digest\":\"sha1:7REGQTJKFCHVDSS6NQ7M6IZ4VY6QNCJL\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-39/CC-MAIN-2021-39_segments_1631780057119.85_warc_CC-MAIN-20210920221430-20210921011430-00134.warc.gz\"}"}