Matplotlib: Grid is too tight for small plot - matplotlib

I want to make the plot smaller, so it can save some space in print. However, when I make it smaller, the grid will be too tight:
Honestly, I don't get it. Why can't matplotlib auto-detect that this image is too small that the lable should be with a bigger interval?
So, How can I make the grid more sparse, so the lables won't overlap with each other?
Additionally, the title will also collapse with the labels. I can set it manually, by plt.suptitle(title, y=1.08). So it will look better
But I'm wondering if there is anyway to do it automatically?
Note: I'm using seaborn, but I tried with pure matplotlib, same problem.

Related

I am unable to increase the size of the plot(graph)

I'm using matplotlib in spyder. Size of plot is not good enough. I can only see it in the console on the bottom right. Is there any way to make it large?
Spyder images are supposed to be adjustable based on your setup. You can do this manually through the gui. I am guessing that you are not setting your figure size which is one way to increase the size of your figure.
fig = plt.figure(figsize=(16,16)) #Larger the numbers, the larger the figure
Another thing to consider when saving your figure. Use a vectorized format like a pdf and set your dpi so that you can zoom without degrading quality. This will make the file larger of course but it helps make publication quality figures.

How to resize subplots in pyplot, dependent on the height of a table?

There are many ways in matplotlib.pyplot to change the size of subplots. However, they all seem to require some hand-tuning. I would like to do it in an automatic way, depending on the actual sizes of the plots.
In my case, I would like to generate a whole lot of pdf files that look something like this:
As you can see, the table in the top subplot has a lot of white space around it, so I would like to reduce the vertical size of the top subplot and make the bottom one larger, to fill up the space a bit better.
I know that I can set the sizes of subplots with GridSpec, among a bewildering array of other methods. However, the number of rows in my tables will vary from file to file, so I don't know in advance what sizes I want the subplots to be.
TL;DR: I want the first subplot to be as tall as the table (however tall that is) and the second to take up the remaining space. Is this possible in MatPlotLib?

Gnuplot resize with key below

When I use gnuplot I make a multiplot with 2x2 Pics. They got all the same lines with something different in there though. Thus I want them just one line title for all of them. When I scale on on below of there it resizes that special plot. Any Idea how to archieve it properly?
Thanks!
There is a patch recently added to the gnuplot sourceforge site (patch 611 here) which allows the addition of explicit margins around plots while keeping the plots the same size.
If you don't want to patch and build gnuplot yourself, you probably have to resort to setting margins manually or in a semiautomatic way, as I have done before.

How do i set the borders of an mplot3d, and also make the grid lines lie behind the plot?

I have this plot as part of a PySide program;
And there are two problems I have with it. The first is the ugly grey border. I know I can can get rid of it using the toolbar option, but I can't find a way to it programatically, or make it default to that when it plots...
The second issue, is that it is drawing the grid lines on top of the surface, which I would rather it didn't do... How do I get the grid lines to be drawn underneath the surface?
EDIT:
i'm using version 1.1.1;
this doesn't happen for all plot types - i.e.
that is fine.
If i try and plot multiple objects, then it can be a problem;
but i understand that's a limitation of mplot3d not being a try 3D engine, just a set of 3D images with a Z-Ordering, so the order of objects drawn becomes orientation dependant. (same graph - different angle: enter link description here).
The grid lines should surely always be at the bottom of the drawing though, no? Is there a way to force them to be?
Will.

How to move a Core Plot graph

I have a Core-Plot Graph within a Mac Application. But the inside table is appearing shifted down and to the left of the containing "frame/border" so that neither of the axis' are showing. I cannot figure out how to change this does anyone know what parameters I need to change to fix this?
Update: Sorry I did not realize I could upload an image, I have done so know and will try your suggestions in the mean-time.
Not sure what you mean by "inside table". It would be easier to offer suggestions if you could post a screenshot.
Without seeing what's wrong, here are some common areas to look at:
If you haven't already done so, look at the example apps included with Core Plot for ideas. The Plot Gallery app has many sample plots and the others are useful, too.
You may need to add padding (paddingLeft, paddingBottom, etc.) on the graph and/or plot area frame. Padding the graph pushes everything in away from the edges of the graph. Padding the plot area frame pushes the plot area in so the axes and titles can hang outside the plot area (the area where the plots are drawn).
If you want to keep an axes pinned to a specific place, e.g., the edge of the graph, set up a floating axis. Otherwise make sure the orthogonal coordinate is set (it defaults to 0). For example, the orthogonal coordinate for the x-axis is the y-value where the x-axis crosses the y-axis.