help-octave
[Top][All Lists]
Advanced

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

Re: Request help on colstyle


From: David Bateman
Subject: Re: Request help on colstyle
Date: Wed, 23 Apr 2008 10:00:46 +0200
User-agent: Thunderbird 2.0.0.12 (X11/20080306)

Schoeller Sebastian wrote:
> Dear all,
>
> recently I started reading a book (Finite Volume Methods for Hyperbolic
> Problems) which is utilizing its own set of functions in order to
> undertake numerical calculations (CLAWPACK). These are to be visualized
> from within Matlab afterwards.
>
> As a Linux user I hence tried executing the delivered Matlab-scripts
> from within Octave and unfortunately ran into a problem. I am running
> Octave 3.0.0 from Ubunty Hardy.
>
> 1.
> error: `colstyle' undefined near line 9 column 18
> error: evaluating for command near line 8, column 1
> error: called from `get_plotstyle' in file
> `/home/schoeller/Work/Coding/CLAW/matlab/get_plotstyle.m'
> error: near line 59 of file
> `/home/schoeller/Work/Coding/CLAW/matlab/plotframe1.m'
> error: evaluating while command near line 76, column 1
> error: near line 93 of file
> `/home/schoeller/Work/Coding/CLAW/matlab/plotclaw1.m'
>
> get_plotstyle.m at line 8:
> for i = 1:length(pstyle),
>   [l,c,m,msg] = colstyle(pstyle{i});
>   if (~isempty(msg))
>
> plotframe1.m at line 59:
> [linestyle,linecolors,markerstyle] = get_plotstyle(pstyle,maxlevels);
>
> plotclaw1.m at line 93:
>   plotframe1   % routine claw/matlab/plotframe1.m
>                % does the plotting for this frame
> end % main loop on frames
>
> So I figured that the colstyle command was missing. Searching I found
> colstyle.m is part of the Specgraph toolbox of Matlab, so I copied
> http://www.nersc.no/~even/matlab/toolbox/specgraph/colstyle.m into the
> respective directory and re-executed. I thus receive the error message
>
> 2.
> warning: get: invalid property `UserData'
> error: value on right hand side of assignment is undefined
> error: evaluating assignment expression near line 11, column 9
> error: called from `get_slices' in file
> `/home/schoeller/Work/Coding/CLAW/matlab/get_slices.m'
>
> get_slices.m at line 11:
> amrplot = get(gcf,'UserData');
>
> When plotting something and requesting its properties via get(gcf) I do
> not see any property named UserData. Now I am wondering whether this is
> a general incompatibility problem or whether there would be a quick fix.
> On http://wiki.octave.org/wiki.pl?ObjectGraphics it looks as if UserData
> is a pending question from ObjectGraphics.
>
> I would be greatful for any advice.
>
> Best wishes
>
> Sebastian
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www.cae.wisc.edu/mailman/listinfo/help-octave
>   

Something like

function [l, c, m, msg] = colstyle (s)
  try
    opt = __pltopt__ ("colstyle", s);
    msg = [];
  catch
    msg = lasterr ();
  end_try_catch
  l = opt.linestyle;
  c = opt.color;
  m = opt.marker;

  if (isvector(c) && length (c) = 3)
    if (all (c == [0, 0, 0]))
      c = "k";
    elseif (all (c == [1, 0, 0]))
      c = "r";
    elseif (all (c == [0, 1, 0]))
      c = "g";
    elseif (all (c == [0, 0, 1]))
      c = "b";
    elseif (all (c == [1, 1, 0]))
      c = "y";
    elseif (all (c == [1, 0, 1]))
      c = "m";
    elseif (all (c == [0, 1, 1]))
      c = "c";
    elseif (all (c == [0, 1, 1]))
      c = "w";
    endif
  endif
endfunction


should be what is needed for the colstyle function. Though its not
perfect as the color that is given might be modified to the same color
with a different name, but that should not be an issue

D.

-- 
David Bateman                                address@hidden
Motorola Labs - Paris                        +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 6 72 01 06 33 (Mob) 
91193 Gif-Sur-Yvette FRANCE                  +33 1 69 35 77 01 (Fax) 

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary



reply via email to

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