I have array like:
import numpy as np
np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
and I want to visualize in some nice way, like:
but having resolution: 400 x 600.
So in the end I want to have new array of shape (400, 600) which if plotted using:
import matplotlib.pyplot as plt
plt.imshow(my_new_array)
will show image like above.
Is it possible? Is there some package that help me?
[edit:] After @Mad Physicist comment, I researched latex and following code would do the job:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\begin{bmatrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9
\end{bmatrix}
\]
\end{document}
and matplotlib has option to use text on axis and title but I would not know how to use it in body of plot. Maybe empty plot and use title in the middle?
[edit2]: Second answer here is the closest to what I need: Converting latex code to Images (or other displayble format) with Python However, as stated in my comment below I am running into error on kaggle with different methods which uses matplotlib and latex:
FileNotFoundError: [Errno 2] No such file or directory: 'latex': 'latex'