[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Plotting a function of 3 variables ?
From: |
Martin Helm |
Subject: |
Re: Plotting a function of 3 variables ? |
Date: |
Wed, 25 Apr 2012 21:09:56 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120421 Thunderbird/12.0 |
Am 25.04.2012 21:05, schrieb Mike Miller:
> On Wed, Apr 25, 2012 at 1:00 PM, Martin Helm <address@hidden> wrote:
>> Oisin found meanwhile that scatter3 does what he want
>>
>> [x,y,z] = meshgrid(-10:1:10,-5:1:5,-8:2:8);
>> % this creates x,y and z 3-D arrays, x contains -10:1:10 replicated
>> length(-5:1:5)xlength(-8:2:8) times, y contains -5:1;5 replicated .....
>> c = x.^2+y.^2+z.^2;
>> % c is now our function of 3 variables
>> figure
>> scatter3(x(:),y(:),z(:),5,c(:),'filled')
>>
>> which gives the attached result with fltk but does not work with gnuplot.
>>
>> Anyone has an idea if that can somehow work with gnuplot as well?
> This is the error I get with gnuplot, same for you?
>
> error: invalid value for color property "markerfacecolor"
> error: called from:
> error: /usr/share/octave/3.6.1/m/plot/private/__scatter__.m at line
> 274, column 11
> error: /usr/share/octave/3.6.1/m/plot/private/__scatter__.m at line
> 211, column 13
> error: /usr/share/octave/3.6.1/m/plot/scatter3.m at line 68, column 11
>
> I got this example to work with gnuplot using the following:
>
> cmap = colormap ();
> colors = cmap (fix (c(:).*(rows(cmap)-1)./max(c(:))) + 1, :);
> scatter3(x(:), y(:), z(:), 20, colors, 'filled');
>
> Marker size 5 is invisible to me in gnuplot so I bumped it up to 20.
>
>> Otherwise I file a bug.
> Yes, please do.
>
Jordi gave me the hint by PM that the bug is already filed
https://savannah.gnu.org/bugs/?36193
I commented on it, the fix mentioned there to replace
line 271 of /_scatter_/.m to
solves the problem for me.
Re: Plotting a function of 3 variables ?, Martin Helm, 2012/04/25