The source code for all screenshots is given in both Python and Forth.
IMHO the Forth code is often much simpler and shorter than the Python
prototype and no less good looking (the output, not the input :-)
I generated all JPEG, Postscript and PNG files with the Forth gnuplot
library, so you can rest assured that at least three of the drivers are
working. Against my expectations gnuplot has an embarassingly high number
of "features" that behave "interesting," meaning that e.g. EMF and SVG do
not work satisfactorily.
The gnuplot library might be a good contribution to the FLAG. I hope
some people may feel challenged to produce Forth scripts for the
remaining screenshots. I did not implemented some of the more
difficult (read time-consuming) business graphics scripts (e.g.
pie charts).
For the Forth gnuplot lib it is only needed to have a working OS pipes
interface. I provided this some time ago for a number of mainstream
Forths.
-marcel
> For the Forth gnuplot lib it is only needed to have a working OS pipes
> interface. I provided this some time ago for a number of mainstream
> Forths.
With the OS pipes interface for a number of mainstream Forths, it
would be an even better contribution to the FLAG. As fascinating as
the C-call discussion in March was, I find it more appealing to
program to a defined socket plug consisting of a set of defined pipes
and code the other side of the pipes in C or AWK or scripting the
command line via a forth SH word (or etc.) where necessary to get at
built in libraries.
On Dec 7, 10:39 am, m...@iae.nl (Marcel Hendrix) wrote:
> This page (http://home.iae.nl/users/mhx/gnuplot/screenshots.html) is
> my (good-natured!) spoof of the Python matplotlib site at
> (http://matplotlib.sourceforge.net/users/screenshots.html?highlight=sc...).
Since they are both driving the same output engine, that seems
unlikely, unless the two set-ups are handing slightly different
settings to gnuplot.
On my hardware there are no differences I can attribute to
anti-aliasing. Can you please provide the URLs of two pictures
where it is noticeable?
Note that the natural resolution of the jpeg files is 640x480, of the
png's it is 800x600, and the postscript files should be looked at with
the highest possible magnification (and a correctly, non-default,
configured ghostview).
In the Forth plots the x, y and title labels are bold (it looks better
on screen esp. for vertical text). Also the font selection is deliberately
limited because not all fonts work for all drivers and all OSes. You can
see this in e.g. the Mathtext example (the Forth figures don't use an
italic font).
Without doing anything, many more Python-equivalent plots will become
available with Gnuplot 4.5 (opposed to the currently stable 4.2).
The version 4.5 I tried a few days ago is a very long way from bugfree
on Windows.
BTW, the Forth gnuplot library only uses a write pipe and binary files.
Sockets are not needed. The X windows version is dog slow (compared to
Windows), but I'll test it on better hardware shortly.
-marcel
If you look closer at the the blue curve, you can see, that
http://matplotlib.sourceforge.net/plot_directive/mpl_examples/pylab_examples/simple_plot.hires.png
has antialiasing and http://home.iae.nl/users/mhx/gnuplot/simple_plot0.png
has not
The sizes are different too. Could the difference somehow depend on that?
Jerry
--
Engineering is the art of making what you want from things you can get.
�����������������������������������������������������������������������
I don't think so
No, if you look at Marcel's images, they're clearly not antialiased.
The gnuplot documentation doesn't have much of anything about
antialiasing. But it sounds like it depends on the backend (they call
them "terminal drivers") that you use. And pyplot has a flag for
whether to antialias. So it's presumably just some detail of how he's
setting up gnuplot.
--Josh
I think so. Its been a decade since I used gnuplot, and I used it to
generate textplots of data for use in an economic mailing list, so
anti-aliasing is well outside my gnuplot experience in any event, but
that sounds right to me.
> Jerry Avins wrote: <8pWTm.26724$gd1....@newsfe05.iad>
>> forther wrote:
>>> On Dec 9, 12:34 pm, m...@iae.nl (Marcel Hendrix) wrote:
>>> anti-aliasing. Can you please provide the URLs of two pictures
>>> If you look closer at the the blue curve, you can see, that
>>> http://matplotlib.sourceforge.net/plot_directive/mpl_examples/pylab_examples/simple_plot.hires.png
>>> has antialiasing and http://home.iae.nl/users/mhx/gnuplot/simple_plot0.png
>>> has not
>> The sizes are different too. Could the difference somehow depend on that?
> No, if you look at Marcel's images, they're clearly not antialiased.
They are anti-aliased, but I use a default linewidth of 3 pixels where Python uses
a default of 1 pixel. Sorry for not mentioning this before.
> The gnuplot documentation doesn't have much of anything about
> antialiasing. But it sounds like it depends on the backend (they call
> them "terminal drivers") that you use. And pyplot has a flag for
> whether to antialias. So it's presumably just some detail of how he's
> setting up gnuplot.
Right. Obviously the defaults are for my own preferences.
-marcel
They are not. And I don't see how it could be related to line width.
Oh, I see. The JPEGs are anti-aliased; it's only the PNGs that aren't.
--Josh
No. http://j.mp/54TTVM is png and is antialiased.
Er...what does that have to do with anything? Of *course* the images on
the matplotlib site are antialiased; that's the reason you started this
line of conversation in the first place.
--Josh
I just responded to yours "Oh, I see. The JPEGs are anti-aliased; it's
> Marcel Hendrix wrote: <9884341...@frunobulax.edu>
>> Josh Grams <jo...@qualdan.com> writes Re: Forth gnuplot library screenshots
[..]
>> They are anti-aliased, but I use a default linewidth of 3 pixels where Python uses
>> a default of 1 pixel. Sorry for not mentioning this before.
> Oh, I see. The JPEGs are anti-aliased; it's only the PNGs that aren't.
Last night I wasted a lot of time trying to understand this. Here is
my current understanding of it:
0. The linewidth has nothing to do with it, indeed.
1. The png's from Forth gnuplot come from the png terminal redirected to
disk and they are NOT antialiased.
2. The Python hires png's are postscript files, (on-the-fly?) converted
to png. Their natural (png) size is 1100 x 900. Postscript, of course,
is anti-aliased.
3. The LCD monitor I am using with IE 7 (Windows) is 1280 x 1024, with
Firefox under Linux I have 1680 x 1050 resolution. Both monitors are
a little bit too small to fully display the 1100 x 900 sample pictures
(because of menu bars etc.) The result was that superficially the
quality of Forth gnuplot and Python png plots looked the same (because
the browsers scale them to the available screen space). However, when
I accidentally clicked the pictures the browser magnified them to
their natural resolution. This caused a barely noticeable size
increase, a status display that still said 100% in both cases (round
off), but a very large increase in Python png quality. It took quite a
lot of time before I realized why the same picture looked so
completely different when all I did was switching between browser
windows and the picture size was in all cases 100%.
4. Zooming Forth and Python pngs away from 100% results in rather shitty
quality. Zooming the jpegs is (subjectively) much better, for both
Forth and Python. Apparently antialiasing and sub-pixel rendering is
done by the browsers for jpeg, but not for png -- or with less effect
for some reason. (This last sentence does not invalidate your (and
forther's) kind comments and acute observations.)
5. The documentation on Freetype2, Quartz anti-aliasing, Gnuplot compile
options etc., etc., is a morass that I intend to stay away from. Forth
gnuplot renders (verified correctly) through the jpeg, png and
postscript terminals. With Ghostview one can very easily convert
postscript to anti-aliased jpeg and png, if this is really wanted
and / or needed.
Thanks for your support in clearing up this matter.
-marcel
Aha! That explains why the docs I could find said that the png
terminal didn't support anti-aliasing.
> The result was that superficially the quality of Forth gnuplot and
> Python png plots looked the same (because the browsers scale them
> to the available screen space).
Sorry, I should have suggested that possibility -- I wondered if
something like that was happening.
> Thanks for your support in clearing up this matter.
Thanks for wasting the time to figure out these details. :)
So now I have one more question: I notice you have code for the
examples, but not for the bindings (I assume that is mostly iForth
specific). If I wanted to get these examples to work under another
Forth system, do I just need to bind to the gnuplot functions, or did
you write some glue/utility words in Forth?
--Josh