dk / PDL-Drawing-Prima

Low-level PDL-threaded interface to the Prima drawing commands.
5 stars 4 forks source link

line smoothing or anti-aliasing ? #27

Closed aero closed 1 year ago

aero commented 11 years ago

lines and graphs drawn by this module are somewhat rough feel compared to R's ggplot2 or Python's matplotlib. Can be improved ?

run4flat commented 11 years ago

Yes, but the solution to this problem is quite involved. It would require updating Prima's line drawing functionality to perform said anti-aliasing. At the moment, Prima simply translates the various drawing operations into the operating system's equivalent drawing operations, and since very few have antialiasing built into their lines and curves, Prima doesn't get it either.

And now, with this ticket, this is officially on my list of things to do. :-)

run4flat commented 2 years ago

Prima now supports anti-aliased line drawing. I was just playing around with it using the lines command and pdl_lines gets anti-aliasing! You have to turn anti-aliasing on explicitly with the method, i.e. $widget->antialias(1). This does not seem to work right "out of the box" for PDL::Graphics::Prima unfortunately. More investigations will follow...

dk commented 1 year ago

$widget->antialias(1) works now after upgrading to use latest Prima API. Whether there should be needed a pdl property "antialiases" or the like (in line with lineWidths etc), no idea. But that should anyway be another PR