experchange > python

Adam Funk (11-08-18, 09:31 PM)
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.

Stefan Ram (11-08-18, 10:19 PM)
Adam Funk <a24061> 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,


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).
Similar Threads