labelling super-axes?

For future reference, below is one way I found to do

    > that. It looks like
    > http://web.engr.oregonstate.edu/~bulatov/normal_grid.png

    > I could make this self-contained for the examples.zip if
    > needed

Yes this would be very nice; perhaps you could make a wiki entry?

    > The only unresolved issue is how to make a large image
    > without also make all the lines thick. IE, if I do
    > savefig(dpi=400), I get a large image, but all the lines
    > are extremely thick.

Hmm, this should not make a difference. Eg, in the following example

  >>> plot([1,2,3])
  >>> savefig('test100', dpi=100)
  >>> savefig('test600', dpi=600)

The relative linewidths look comparable.

JDH

John Hunter wrote:

"Yaroslav" == Yaroslav Bulatov <yaroslavvb@...287...> writes:

    > The only unresolved issue is how to make a large image
    > without also make all the lines thick. IE, if I do
    > savefig(dpi=400), I get a large image, but all the lines
    > are extremely thick.

Hmm, this should not make a difference. Eg, in the following example

  >>> plot([1,2,3])
  >>> savefig('test100', dpi=100)
  >>> savefig('test600', dpi=600)

The relative linewidths look comparable.

I'm guessing the OP wanted to get an image with more pixels, but NOT have the lines be more pixels wide. I think this might help:

There are three parameters define an image size (this is not MPL specific):

Size in length units (inches, cm, pt, etc): i.e. 5"x7"
Size in pixels: i.e. 800x600 pixels
Dots per Inch (dpi) i.e. 100 dpi

Only two of these are independent, so if you define two of them, the third can be calculated from the others.

When displaying on a computer screen (or saved to a PNG), the size in length units is irrelevant, the pixels are simply displayed. When printed, or saved to PS, EPS or PDF (all designed to support printing), then the Size or dpi is used to determine how to scale the image.

Now I'm getting into how I think MPL works, but it turns out I'm wrong here. See the example below for a test. Note, this John, please correct this!

1) The size of a figure is defined in length units (inches), and can be set by:

Figure.set_figsize_inches( (w,h) )

2b) The layout of the figure is defined in "figure units" so it can be scaled by changing the figure size.

2) Size of text, width of lines, etc is defined in terms of length units (points?).

3) When displaying to the screen, or creating an image (PNG) the pixel size of text and line widths, etc is determined by the dpi setting, which is set by:

Figure.set_dpi( val )

The trick here is that when printing, it's natural to think in terms of inches, but when creating an image (for a web page, for instance), it is natural to think in terms of pixel size. However, AFAIK, MPL does not have a way to set the pixel size directly (remember that you can only set two of the three size parameters, the third must be calculated from the other two).

So, in the OPs case, I think what is wanted to create a large image in terms of pixel size, but not change hoe many pixels wide a line is. In theory, you could accomplish that by using:

Figure.set_figsize_inches( (w,h) )

Without changing the dpi. I've done a test case, and this works. However, what doesn't seem to have any effect is changing the dpi of the Figure. What's up John? shouldn't Figure.set_dpi effect the dpi of the resulting PNG? I'm using MPL 0.83.1 on Linux. I'll go upgrade now, so if this has been fixed, I guess you can ignore it.

-Chris

Enclosed is a sample script, and below are the results:

using MPL version: 0.83.1
DPI: 80.0
Size in Inches (7.9749999999999996, 5.6624999999999996)
Which should result in a 638 x 453 Image
DPI: 160.0
Size in Inches (7.9749999999999996, 5.6624999999999996)
Which should result in a 1276 x 906 Image
DPI: 160.0
Size in Inches (16.0, 12.0)
Which should result in a 2560 x 1920 Image
DPI: 80.0
Size in Inches (16.0, 12.0)

MPL_size_test.py (1.32 KB)

···

--
Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...

Chris Barker wrote:

However, what doesn't seem to have any effect is changing the dpi of the Figure. What's up John? shouldn't Figure.set_dpi effect the dpi of the resulting PNG? I'm using MPL 0.83.1 on Linux. I'll go upgrade now, so if this has been fixed, I guess you can ignore it.

FWIW, I just upgraded to 0.84, with exactly the same results.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...