(Heavens, how is my ancient Cambridge email ended up here!?)
Hi Doug,
Yes, indeed that is true, so I find that I need to use the lower-level
interface regularly, but I am lazy so I map to the high-level
interface whenever I can. This part is easy actually - that is just a
question of mapping options using a set of hashes and some small
routines (to deal with colour handling etc) - so there is rarely need
to re-invent the wheel :).
Cheers,
J.
On 6 Oct 2009, at 16:39, Doug Hunt wrote:
> Hi Jarle: Your higher level graphics interface sounds interesting.
> One
> (probably obvious) comment. It would be best to interface to PLplot
> using
> the 'low level' interface in PDL::Graphics::PLplot for this purpose.
> There is also a 'high level' interface, but this is trying to do the
> same
> thing you are doing. Using the low level (C-style) interface for
> your common plotting interface would avoid unnecessary layers of
> code and
> also permit access to the full power of PLplot.
>
> Regards,
>
> Doug Hunt
>
> [email protected]
> Software Engineer
> UCAR - COSMIC, Tel. (303) 497-2611
>
> On Tue, 6 Oct 2009, SourceForge.net wrote:
>
>> Feature Requests item #2872095, was opened at 2009-10-03 02:26
>> Message generated for change (Comment added) made by jarle
>> You can respond by visiting:
>> https://sourceforge.net/tracker/?func=detail&atid=350612&aid=2872095&group_id=612
>>
>> Please note that this message will contain a full copy of the
>> comment thread,
>> including the initial issue submission, for this request,
>> not just the latest update.
>> Category: None
>> Group: None
>> Status: Open
>> Priority: 3
>> Private: No
>> Submitted By: Chris Marshall (marshallch)
>> Assigned to: Nobody/Anonymous (nobody)
>> Summary: PGPLOT compatibility module with PLplot
>>
>> Initial Comment:
>> Given the PGPLOT no longer appears to be maintained, it would be
>> nice to switch to PLplot as the default PDL 2D plotting library.
>> This would be greatly simplified if, for example, a work alike for
>> PDL::Graphics::PGPLOT was implemented using PLplot. This would
>> require someone famliar with both libraries but it should be
>> straightforward at the high level plotting view....
>>
>> ----------------------------------------------------------------------
>>
>> Comment By: Jarle Brinchmann (jarle)
>> Date: 2009-10-06 11:46
>>
>> Message:
>> I did start on this some time ago, well, actually very long ago as
>> I put in
>> Graphics2D.pm in there, but that was before plplot had a PDL
>> interface - we
>> only had pgplot at that time, hence little was put in at the time :)
>>
>> Anyway, so what I have done now is to write a wrapper routine - at
>> the
>> moment called JBGraphics2D.pm because I was doing exploratory
>> coding and
>> did not know if it would work. The goal of the code is to try to
>> abstract
>> from the two libraries a bit, although it is hard to do it too far.
>> Thus
>> the way it works right now is:
>>
>> - I try to put wrappers that work the same way for plplot & pgplot
>> using in general the pgplot naming scheme, but this is a bit clunky.
>> - Implements a generic 'plot' function which then delegates further:
>>
>> plot($x, $y) -> delegates to lines or points if x & y are piddles.
>> plot(%hash) -> Delegates to a scatter plot matrix routine which
>> plots
>> all keys in the hash that are piddles against all others (splom if
>> you know
>> R).
>> plot($object) -> Should delegate to the plot routine in the object.
>>
>> etc.
>>
>> This works-ish. The general type of call is:
>>
>> $w = PDL::JBGraphics2D->new('plplot', Device => 'x11', Width =>
>> 400);
>>
>> If you switch plplot with pgplot it should be visually very similar
>> (see
>> the file I attach to this feature request), which incidentally adds
>> a bit
>> of hassle. It does require some patches to Window.pm
>> PGPLOTOptions.pm and
>> PDL::Options, none of which I have submitted yet because I wasn't
>> sure they
>> were exactly what I wanted. They appear stable so when I understand
>> git
>> better maybe I can submit them :)
>>
>> One 'cool' thing you can do, which does seem to work, is to submit a
>> function as well to the plot routine. This will operate on the x &
>> y data
>> in each panel. Say you want a multi-panel plot, split according to
>> some
>> variable, and then do a linear fit to the data in each panel. The
>> way to
>> do that is to create a function and pass it in with the 'Do' option
>> - the
>> function is then executed for each panel plotted (which is how the
>> green
>> line is plotted in the figure attached).
>>
>> In fact, getting the code to do the same in PLplot as in PGPLOT does
>> require meddling in the internals a bit and is at some level not
>> possible.
>> I haven't even started looking at the image routines.
>>
>> The problem is that a) I'm too busy these days to do the necessary
>> hacking
>> and b) the code is too far off being ready to be put into the code-
>> base I
>> think. Does anyone have any suggestions of how to proceed,
>> branching off
>> seems too drastic?
>>
>>
>> ----------------------------------------------------------------------
>>
>> Comment By: Derek Lamb (lambd)
>> Date: 2009-10-06 00:54
>>
>> Message:
>> PDL::Graphics2D was ostensibly started for exactly this reason,
>> though
>> nothing much ever came of it.
>>
>> ----------------------------------------------------------------------
>>
>> Comment By: Derek Lamb (lambd)
>> Date: 2009-10-06 00:54
>>
>> Message:
>> PDL::Graphics2D was ostensibly started for exactly this reason,
>> though
>> nothing much ever came of it.
>>
>> ----------------------------------------------------------------------
>>
>> You can respond by visiting:
>> https://sourceforge.net/tracker/?func=detail&atid=350612&aid=2872095&group_id=612
>>
>> _______________________________________________
>> PDL-porters mailing list
>> [email protected]
>> http://mailman.jach.hawaii.edu/mailman/listinfo/pdl-porters
>>
>
> _______________________________________________
> Perldl mailing list
> [email protected]
> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl