This is driving me nuts. Using matplotlib in python, I am drawing a simple plot (twenty pixels of different color) as follows: fig1, ax = plt.subplots() color_rgb_list = np.random.rand(n_colors, 3) ax.imshow(color_rgb_list[None, :], aspect='equal') for label in train_y:     ax.text(label - 1.5, 1, str(label)) plt.tight_layout() plt.show() # fig1.savefig(&quot;test.png&quot;, bbox_inches='tight')  However, the result I get has a lot of white space around it. I found out that I can use bbox_inches='tight' when actually saving the figure to a file, however that does not really help me, as instead I would like to remove the white spaces while drawing the actual image. (I am using this for an app, where I want to display several different plots in one window using tkinter with .pack())  How can I remove the white spaces when drawing/showing my plot? I would basically like to achieve the same thing that bbox_inches='tight' does, only when using plt.show(), or when drawing on canvas using tkinter. Thanks in advance.
How do you change the size of figure drawn with Matplotlib?
table side by side with minipage I can't manage to get two tables side by side in a minipage environment. Any kind suggestion would be highly appreciated!   \documentclass{article} \usepackage{array}  \begin{document} \begin{table}[htbp] \centering \begin{minipage}{.2\textwidth}     \begin{tabular}{| m{3cm} | m{4.3cm} | c |}   \hline  number of entity filter (size 1) &amp; number of context filters (size 2, size 3,  size 4) &amp; Accuracy\\ [2ex]   \hline  32  &amp;  32  ,  32  ,  32  &amp;  0.835 \\[0.5ex] \hline 32  &amp;  64  ,  64  ,  64  &amp;  0.821 \\[0.5ex] \hline 32  &amp;  128  ,  128  ,  128  &amp;  0.819 \\[0.5ex] \hline 32  &amp;  256  ,  256  ,  256  &amp;  0.749 \\[0.5ex] \hline 32  &amp;  512  ,  512  ,  512  &amp;  0.683 \\[0.5ex] \hline 32  &amp;  1024  ,  1024  ,  1024  &amp;  0.528 \\[0.5ex] \hline 32  &amp;  2048  ,  2048  ,  2048  &amp;  0.235 \\[0.5ex] \hline 64  &amp;  32  ,  32  ,  32  &amp;  0.850 \\[0.5ex] \hline 64  &amp;  64  ,  64  ,  64  &amp;  0.816 \\[0.5ex] \hline 64  &amp;  128  ,  128  ,  128  &amp;  0.786 \\[0.5ex] \hline 64  &amp;  256  ,  256  ,  256  &amp;  0.795 \\[0.5ex] \hline 64  &amp;  512  ,  512  ,  512  &amp;  0.765 \\[0.5ex] \hline 64  &amp;  1024  ,  1024  ,  1024  &amp;  0.669 \\[0.5ex] \hline 64  &amp;  2048  ,  2048  ,  2048  &amp;  0.331 \\[0.5ex] \hline 128  &amp;  32  ,  32  ,  32  &amp;  0.920 \\[0.5ex] \hline 128  &amp;  64  ,  64  ,  64  &amp;  0.890 \\[0.5ex] \hline 128  &amp;  128  ,  128  ,  128  &amp;  0.886 \\[0.5ex] \hline 128  &amp;  256  ,  256  ,  256  &amp;  0.846 \\[0.5ex] \hline 128  &amp;  512  ,  512  ,  512  &amp;  0.789 \\[0.5ex] \hline 128  &amp;  1024  ,  1024  ,  1024  &amp;  0.755 \\[0.5ex] \hline 128  &amp;  2048  ,  2048  ,  2048  &amp;  0.488 \\[0.5ex] \hline 256  &amp;  32  ,  32  ,  32  &amp;  0.920 \\[0.5ex] \hline 256  &amp;  64  ,  64  ,  64  &amp;  0.922 \\[0.5ex] \hline 256  &amp;  128  ,  128  ,  128  &amp;  0.912 \\[0.5ex] \hline 256  &amp;  256  ,  256  ,  256  &amp;  0.877 \\[0.5ex] \hline 256  &amp;  512  ,  512  ,  512  &amp;  0.872 \\[0.5ex] \hline 256  &amp;  1024  ,  1024  ,  1024  &amp;  0.771 \\[0.5ex] \hline 256  &amp;  2048  ,  2048  ,  2048  &amp;  0.683 \\[0.5ex]  \hline  \end{tabular} \end{minipage}% \hfill \begin{minipage}{.2\textwidth}     \begin{tabular}{| m{3cm} | m{4.3cm} | c |}   \hline  number of entity filter (size 1) &amp; number of context filters (size 2, size 3,  size4) &amp; Accuracy\\ [2ex]   \hline 512  &amp;  32  ,  32  ,  32  &amp;  0.910 \\[0.5ex] \hline 512  &amp;  64  ,  64  ,  64  &amp;  0.922 \\[0.5ex] \hline 512  &amp;  128  ,  128  ,  128  &amp;  0.909 \\[0.5ex] \hline 512  &amp;  256  ,  256  ,  256  &amp;  0.910 \\[0.5ex] \hline 512  &amp;  512  ,  512  ,  512  &amp;  0.883 \\[0.5ex] \hline 512  &amp;  1024  ,  1024  ,  1024  &amp;  0.730 \\[0.5ex] \hline 512  &amp;  2048  ,  2048  ,  2048  &amp;  0.682 \\[0.5ex] \hline 1024  &amp;  32  ,  32  ,  32  &amp;  0.925 \\[0.5ex] \hline 1024  &amp;  64  ,  64  ,  64  &amp;  0.931 \\[0.5ex] \hline 1024  &amp;  128  ,  128  ,  128  &amp;  0.920 \\[0.5ex] \hline 1024  &amp;  256  ,  256  ,  256  &amp;  0.917 \\[0.5ex] \hline 1024  &amp;  512  ,  512  ,  512  &amp;  0.899 \\[0.5ex] \hline 1024  &amp;  1024  ,  1024  ,  1024  &amp;  0.858 \\[0.5ex] \hline 1024  &amp;  2048  ,  2048  ,  2048  &amp;  0.776 \\[0.5ex] \hline 2048  &amp;  32  ,  32  ,  32  &amp;  0.933 \\[0.5ex] \hline 2048  &amp;  64  ,  64  ,  64  &amp;  0.934 \\[0.5ex] \hline 2048  &amp;  128  ,  128  ,  128  &amp;  0.925 \\[0.5ex] \hline 2048  &amp;  256  ,  256  ,  256  &amp;  0.928 \\[0.5ex] \hline 2048  &amp;  512  ,  512  ,  512  &amp;  0.907 \\[0.5ex] \hline 2048  &amp;  1024  ,  1024  ,  1024  &amp;  0.878 \\[0.5ex] \hline 2048  &amp;  2048  ,  2048  ,  2048  &amp;  0.798 \\[0.5ex]  \hline  \hline \end{tabular} \end{minipage} \caption{filter window size} \label{tab:config_filternum} \end{table}   \end{document}   What I have so far  EDIT: I followed the second solution from , and it somehow didn't work. I am not sure why. This question is asked in various forms here but the question boils down to:  I know shrinking a database is risky. In this case, I've removed so much data and I'll never use it again.   How can I shrink my database? What files do I shrink?  What should my considerations be while doing this?  Should I do anything after? What if it is a large database? Can I shrink it in smaller increments? Why does friction play the role of centripetal force during the turning of a car? What makes frictional force the centripetal force of a car turning along a curve? As friction is the opposing force and acts anti-parallel so there is no component of frictional force towards the center,right? Then how can frictional force be centripetal force? Windows Backup & Restore: What to Keep from AppData? A couple years ago, my father made a backup of one of our computers using Windows Backup and Restore. It was either Windows Vista or Windows 7, not sure which. He backed up the entire computer, including Program Files, AppData, My Documents, everything, and now it is on .zip files on a WD Passport with 300GB, I'm not sure exactly what it is called. Now I am trying to decide which files to keep and which to delete. Most of what we would keep are files, as we would need CD's to use the programs, and I'm pretty sure they would install everything all over again. That pretty much leaves out Program Files, however, I'm not sure about AppData. For example, my mother used Greetings Workshop and wants some files from there, and she may want to keep some default settings she used. I am talking generally here, as I'm sure some programs have different ways of saving things in AppData.  What, if anything, should I keep from AppData, and what should I delete? By the time, many files are still on my system and I don't need them anymore, so how to delete all files that are one year old at least? Android: Overlay on Android Camera Preview Why Java needs Serializable interface? We work heavily with serialization and having to specify Serializable tag on every object we use is kind of a burden. Especially when it's a 3rd-party class that we can't really change.  The question is: since Serializable is an empty interface and Java provides robust serialization once you add  implements Serializable - why didn't they make everything serializable and that's it?    What am I missing? Why didn't the basilisk bite in Chamber of Secrets destroy the Horcrux? As the title asks, why didn't the basilisk bite received in the Chamber of Secrets destroy the Horcrux inside the bitten person?   Yes, I know Fawkes quite quickly healed the bite wound with his phoenix tears, but when Harry used the basilisk fang to destroy Tom Riddle's diary the destruction of that Horcrux was immediate. When Ron hit the locket with the Sword of Gryffindor, it was destroyed immediately. Although the destruction of the ring occurred off-page, Dumbledore used the Sword of Gryffindor to destroy it, so presumably, like the locket, it was gone right away. Nagini died straightaway when Neville decapitated her. The destruction of the Hufflepuff cup happens off-page. The diadem seems to have been destroyed by Fiendfyre immediately as well, as when Harry examined it outside the Room of Requirement it was already leaking a blood-like substance, and then it cracked in half. When Voldemort hit Harry with Avada Kedavra in the forest, Harry woke up in limbo with the last fragment of Voldemort's soul - that awful flayed baby-like being - separated from him immediately.   Is there a logical/canon-based explanation for why the fragment of Voldemort's soul residing in Harry wasn't destroyed upon Harry being bitten by the basilisk?  NOTE: I've read the HP Wiki's entry on Horcruxes; however, I find the HP Wiki to be inconsistent in its accuracy, so I'm hesitant to accept the Wiki's explanation on the matter. I'd prefer an explanation constructed from information in the books or a statement by JKR, or the like. Interior of cartesian product is cartesian product of interiors I have to prove that:  $$Int(A\times B) = Int(A)\times Int(B)$$  Where $A\subset M$ and $B\subset N$, both $M$ and $N$ metric spaces.  The problem is that the exercise does not specify the metric, so I need to try to prove it using a generic metric.  If $x\in Int(A\times B)$, then an open ball can be centered at $(x,y)$ such that it is contained in $A\times B$. Therefore, this open ball, $B((x,y),r)\subset A\times B$. It means that $d((x,y),a)&lt;r$ for any $a\in A\times B$ for some $r&gt;0$. I guess that if I can take from here that $d(x,a)&lt;r$ and $d(y,a)&lt;r$ I can prove thhat $Int(A\times B)\subset Int(A)\times Int(B)$, but I still have to prove the other way around.   Any ideas? If $f(xy)=f(x)f(y)$ then show that $f(x) = x^t$ for some t Let  $f(xy) =f(x)f(y)$ for all $x,y\geq 0$. Show that $f(x) = x^p$ for some $p$.    I am not very experienced with proof. If we let $g(x)=\log (f(x))$ then this is the same as  $g(xy) = g(x) + g(y)$   I looked up the hint and it says let $g(x) = \log f(a^x) $   The wikipedia page for functional equations only states the form of the solutions without proof.  Attempt  Using the hint (which was like pulling a rabbit out of the hat)  Restricting the codomain $f:(0,+\infty)\rightarrow (0,+\infty)$ so that we can define the real function $g(x) =  \log f(a^x)$ and we have $$g(x+y) = g(x)+ g(y)$$   i.e $g(x) = xg(1)$ as $g(x)$ is continuous (assuming $f$ is).  Letting $\log_a f(a) = p$ we get $f(a^x) =a^p $. I do not have a rigorous argument but I think I can conclude that $f(x) = x^p$ (please fill any holes or unspecified assumptions) Different solutions are invited I am a non-EU national, permanent UK Resident. Recently, my work issued me with a multiple Schengen visa with Norway as the first (main) point of entry. Now I want to go on holidays to Greece - do I need to apply to Schengen visa again, as Greece is not Norway and I am not going there for work? Ubuntu 18.10 gnome extensions stop working after hibernation After upgrading to 18.10 I am experiencing very strange behaviour of gnome extensions. After my laptop goes into hibernation they all switch off and enabling them back on  doesn't help: nothing changes and when I refresh the page they are disabled again.   The only way to turn them back on is to reinstall them. Does Windows 7 allow auto-login with a stored password, like TweakUI did? The TweakUI powertoy for Windows XP had an option to auto-login. It stored your password and did the login for you. This was useful, since you kept password protection, but had login programs loaded when you first booted.  When you switched users or hibernated, it would still ask for a password, which is the desired behavior.  Is there a way of doing this in Windows 7? I have written a C++ program and complied it to produce a.out file. However, whenever I try to run it, I get Permission Denied. I read that we can use sudo, but I can't quite get it to work. I use something like, sudo "./a.out" but that too doesn't work.  Edit:  Here is the message I get when I try "./a.out".  bash: ./a.out: Permission denied Notify us when the question has been edited after posting an answer In fact, of these, only Charcoal shows a recent time stamp. Show that $ab + bc + ac \ge a\sqrt{bc} + b\sqrt{ac} + c\sqrt{ab}$ Where $a,b$ and $c$ are positive real numbers.  So far I have shown that $$a^2+b^2+c^2 \ge ab+bc+ac$$ and that $$a^2+b^2+c^2 \ge a\sqrt{bc} + b\sqrt{ac} + c\sqrt{ab}$$ but I am at a loss what to do next... I have tried adding various forms of the two inequalities but always end up with something extra on the side of $ab+bc+ac$. Any help appreciated! How to create Unity indicators? I'm interested in Unity indicators and wonder if there is any tutorial on how to program them. I can use the sources of the existing ones as last resort, but I'd prefer a more friendly approach because my programming skills are quite limited. Can somebody tell me why the counting measure (so, if $S=P(X)$, then $\mu(A)$=infinity if $A$ isn't finite and $\mu(A)=$#$A$ if $A$ is finite) is a measure? (The second property of a measure isn't clear for me). I wanna create a new partition from the existing root partition.My root partition is about 250GB.I wanna create a new partition say 150 GB taking space from this root partition.Can anyone help me with the procedure on doing this?  output: fdisk -l  karthick@karthick:~$ sudo fdisk -l [sudo] password for karthick:   Disk /dev/sda: 250.0 GB, 250000000000 bytes 255 heads, 63 sectors/track, 30394 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x28219744  Device Boot      Start         End      Blocks   Id  System /dev/sda1   *           1          61      487424   83  Linux Partition 1 does not end on cylinder boundary. /dev/sda2              61       30395   243650561    5  Extended /dev/sda5              61         124      498688   82  Linux swap / Solaris /dev/sda6             124         186      498688   82  Linux swap / Solaris /dev/sda7             186       30395   242651136   83  Linux