help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [newbie] plotting function of three variables


From: Ben Abbott
Subject: Re: [newbie] plotting function of three variables
Date: Mon, 11 Feb 2013 12:11:08 -0500

On Feb 11, 2013, at 11:56 AM, James Sherman Jr. wrote:

> On Mon, Feb 11, 2013 at 11:32 AM, Ben Abbott <address@hidden> wrote:
> 
>> On Feb 11, 2013, at 11:30 AM, Doug Stewart wrote:
>> 
>>> On Mon, Feb 11, 2013 at 11:20 AM, Hugo Coolens <address@hidden> wrote:
>>>> I have a function f(x,y,z) for which I'd like to have a graphical 
>>>> representation. I know f(x,y,z) varies between 1 and a maximum value, so I 
>>>> thought it would be nice
>>>> to represent each x,y,z-point by a pixel for which white represents 1 and 
>>>> black represents the maximum value of f(x,y,z). Intermediate values could 
>>>> be presented by a grayish according to the value.
>>>> Can this be done in Octave, or can someone point me to similar examples 
>>>> and solutions,
>>>> 
>>>> thanks in advance
>>>> hugo
>>> 
>>> Why not use the same ideas as sombrero??
>>> 
>>> type sombrero at the prompt.
>> 
>> If you're looking for a scatter plot in 3D ...
>> 
>>        help scatter3
>> 
>> If something like "sombrero" is what you're looking for ...
>> 
>>        help surf
>> 
>> Ben
> 
> I maybe misinterpreting the question, but surf and sombrero are both
> of the form that z = f(x,y) or in other words, a surface, where this
> gentlemen is looking to view a solid, or w = f(x,y,z).

Both surf() and scatter3() allow that to be rendered using color to represent 
'w". 

        c = w;
        surf (x, y, z, c)
        caxis ([min(c), max(c)])
        colorbar ()

        c = w;
        scatter3 (x, y, z, s, c)
        caxis ([min(c), max(c)])
        colorbar ()

For scatter3() the size (4th input) of the symbols may also be used to 
represent "w".

        s = interp1 ([min(c), max(c)], [5, 20], w)
        c = w;
        scatter3 (x, y, z, s, c)
        caxis ([min(c), max(c)])
        colorbar ()

Ben



reply via email to

[Prev in Thread] Current Thread [Next in Thread]