On Sun, Dec 21, 2008 at 1:30 PM, Georg Brandl <g.brandl@...> wrote:
> I'm currently using Qwt to display a plot in a GUI application, but I'd like
> to replace it with matplotlib and a shell window, so that the user can not
> only view the plot but also modify it in-place using pyplot commands.
> One thing I'd like to do is to adjust the spacing surrounding the plot to be
> constant, regardless of the window size. Since the plot window is resized
> often, it is impossible to use very small subplot params and a waste of
> viewing space to use larger ones when the window is maximized.
> Is there a way to make the figure use absolute params like "20 pixels/points"?
Axes in matplotlib uses normalized figure coordinates. Therefore, you
have to convert your dimension (say 20 points) into normalized figure
coordinates, and you need to do it whenever your the figure size
There are ways to do this, but no easy way like
One way is to use axes_divider.py that I recently added In the example
directory (in the svn trunk).
import matplotlib.pyplot as plt
from axes_divider import LocatableAxes, Divider, Size
fig1 = plt.figure(1)
pad=0.8 # inch
divider = Divider(fig1, [0, 0, 1, 1],
locator = divider.new_locator(nx=1, ny=1)
ax = LocatableAxes(fig1, divider.get_position())
> Second, less important question: is there a way to give default font properties
> (like weight="bold") for axis labels?
Unfortunately not, although font size and font color can be set using rcParams.
> Third, I normally get my data one point at a time. Is there a more efficient
> way to insert single data points in existing plots than doing
> Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
> Four shall be the number of spaces thou shalt indent, and the number of thy
> indenting shall be four. Eight shalt thou not indent, nor either indent thou
> two, excepting that thou then proceed to four. Tabs are right out.
> Matplotlib-users mailing list