Hello Jovan,

Did you try this?
my $z = sequence(10,10)*rand(1);

Seems to me you just need a z-value pdl that has the same dimensions as the
x and y coordinates.

David

On Thu, Apr 18, 2024, 1:11 PM Jovan Trujillo <jovan.trujil...@gmail.com>
wrote:

> Hi Greg,
> Yes, I've been looking into a heat map or flattened 3d scatterplot. In
> Mathematica, I can easily import the Excel spreadsheet and plot using
> ListDensityPlot to give me a nice high-resolution image of the data.
>
> But my question is simply a mapping problem. If I have two piddles with $x
> and $y coordinates and a third representing the $data, how do I create a
> $matrix that maps the $data based on the coordinates from $x and $y? If I
> had $matrix I can simply plot image($matrix) with PDL::Graphics::Gnuplot.
>
> Thank you,
> Jovan
>
> On Thu, Apr 18, 2024 at 1:16 AM Grégory Vanuxem <g.vanu...@gmail.com>
> wrote:
>
>> Hello,
>>
>> I haven’t carefully looked at your problem with GNUPlot but I wonder if
>> what you are trying to achieve could not be done with surface routines,
>> that’s with 3d ones ? Or maybe something like heatmap like this question:
>>
>>
>> https://stackoverflow.com/questions/76577557/trying-to-create-heat-map-using-ggplot-similar-to-density-contour-plot-but-wh
>>
>> Just to give some hints on possible routines.
>>
>> - Greg
>>
>> Le jeu. 18 avr. 2024 à 01:53, Jovan Trujillo <jovan.trujil...@gmail.com>
>> a écrit :
>>
>>> Hi all,
>>>
>>> I've been wracking my brain all morning trying to figure this out, but
>>> how could I convert a set of 3 1D piddles containing xyz data into a matrix
>>> for plotting as an image using PDL::Graphics::Gnuplot? Say for example:
>>>
>>> use PDL;
>>> use PDL::Graphics::Gnuplot qw/image gplot/;
>>>
>>> my $x = flat(xvals(10,10)); # This is basically how x-coordinates are
>>> output from my machine.
>>> my $y = flat(yvals(10,10)); # Same format as x-coordinates
>>> my $z = sequence(100)*rand(1); # Some dummy data for this example.
>>>
>>> my $image; # How do I map $x,$y,$z into this 10x10 $image piddle?
>>> image($image);
>>>
>>> That's my basic problem. How do I map $x,$y,$z data into an $image
>>> matrix?
>>>
>>> Thank you,
>>> Jovan
>>> _______________________________________________
>>> pdl-general mailing list
>>> pdl-general@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/pdl-general
>>>
>> _______________________________________________
> pdl-general mailing list
> pdl-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pdl-general
>
_______________________________________________
pdl-general mailing list
pdl-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-general

Reply via email to