Re: Suggestions for plotting slide rule & sector scales?

2018-11-20 Thread Adam Funk
On 2018-11-08, Stefan Ram wrote:

> Adam Funk  writes:
>>and get a line 100 mm long with a log scale on the top and a linear
>>scale on the bottom.
>
>   From what I have heard,
>
> pyqt.sourceforge.net/Docs/PyQt4/qx11info.html#appDpiX
>
>   will give you the dots per inch (link not validated).
>
>   matplotlib.axis.Axis handles drawing of t tick lines,
>   grid lines, tick and axis label (information not verified).

I hadn't thought of using matplotlib to do axes only, without the rest
of the graph --- interesting idea.

I've also found pynomo, which looks more appropriate, but I'm having
problems with that (see other post).


-- 
Physics is like sex. Sure, it may give some practical results, but 
that's not why we do it.---Richard Feynman
-- 
https://mail.python.org/mailman/listinfo/python-list


Suggestions for plotting slide rule & sector scales?

2018-11-08 Thread Adam Funk
I like old scientific instruments & that sort of thing, & am wondering
what libraries I could use for programmatically generating
mathematical scales, ideally able to display the result in the GUI &
save it as a png (or other standard graphics format).  Ideally, I'd
like to be able to write code like this:

line = foo_library.draw_line(0, 0, 100, 0)

for x in range(1,101):
line.add_minor_tick(math.log10(x) * 100/2, side=top)

for x in range(1,11):
line.add_major_tick(math.log10(x*10) * 100/2, label=str(x), side=top)

for x in range(0,100):
line.add_minor_tick(x, side=bottom)

for x in range(0,10):
line.add_major_tick(x*10, label=str(x), side=bottom)

and get a line 100 mm long with a log scale on the top and a linear
scale on the bottom.

Thanks,
Adam


-- 
It takes a thousand men to invent a telegraph, or a steam engine, or a
phonograph, or a telephone or any other important thing --- and the
last man gets the credit and we forget the others.   ---Mark Twain
-- 
https://mail.python.org/mailman/listinfo/python-list