[reportlab-users] making logarithmic plots

Willard Myers reportlab-users@reportlab.com
Sat, 15 Mar 2003 15:18:57 -0500


--Apple-Mail-6-732861213
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=US-ASCII;
	format=flowed

On Saturday, Mar 15, 2003, at 14:44 US/Eastern, Christopher N. Deckard 
wrote:

> Where should I start looking in the code for adding such a thing?

Here's what I did to solve a specific reporting need. It uses LinePlot 
and a few 'private' methods to create a (base-10) log-log plot. It 
involves a bit of complexity to relocate the x-axis to the bottom of 
the plot rather than at log(y) = 0.

This certainly isn't general enough to be a reportlab object, but it 
might help you get started. The example() function won't work for you 
-- substitute your own data generator in place of the 
OpticalModel.peakIrradianceAtAperture() method.

Bill



--Apple-Mail-6-732861213
Content-Disposition: attachment;
	filename=OasysLogLogPlot.py.gz
Content-Transfer-Encoding: base64
Content-Type: application/x-gzip;
	x-unix-mode=0644;
	name="OasysLogLogPlot.py.gz"

H4sICISHcz4CA09hc3lzTG9nTG9nUGxvdC5weQC9WW1v28gR/u5fsfAhEHUnsZKT3LUB/MFtLj0D
cRJcdL0eDENYiytpa5LL7q5i0kX/+z2zyzeRlGy3TY3EljivOzM7b1xrlTAtMqVtzG/DjebZVq4M
kwk9AiSNhP709t3JehgxNFueiRr/reb3Mt08Efuz1U9H/qtWu+wg7mrLtTVhLFORxcrWVO/x4BMe
PEooNjhqQ+a+dolieVshrFSstDnxGB92idByVcFitZnPBiGZuhf65GQVc2PYR24K815t8I80fHPC
8HN6evqLEYzXijOrGHQRmlt6TIdj99Ju2S03YjqfkTSu8SCBGJ4LEzo+7tfFzqqEW7nicVzgHLFa
gYth+ZTn0hDnW2WBgj+7NOK6mDCI2QrN7JanjkXkHcq4ZQU7Z7OQXRgjN6kpLcACLaIJU5qnGzFh
hYhjdT9hGy1EOmG38U6MHR/IWkttLH5/EYzcZEIXLYbVpk+NjARTKf6v2VrtNGRonLx9pPeXV5eL
i8Xlxw+f/Xc6klTQBzRGJYI5hzJpRWImzOxWW8Y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