Gary Ruben | 1 Apr 01:19
Picon
Picon
Favicon

Re: A few mayavi2 how-to questions

I've been using the helpful script recorder (using 3.1.0 in WinXP) but 
many changes aren't recorded - for example, the cut_plane implicit_plane 
state that I was asking about. I've resorted a fair bit to inserting 
"print dir(object)" statements in the code, exploring the class 
heirarchy using iPython and a fair bit of guessing at the names of trait 
attributes.

Gary

Prabhu Ramachandran wrote:
> I guess you've found the answers now.  Here is one tip:  if you have 
> 3.1.0 you can do all of the scripting by using the recorder feature and 
> cut/pasting that code from the recorded script and then mlab-ifying it 
> if needed.  I.e. do your work interactively with the recorder turned on 
> and then edit the generated code to suit your needs.

--

-- 
Gary Ruben
Postgraduate student
School of Physics, Monash University
e.  gary.ruben@...
ph. +61 3 99020766
Robert Kern | 1 Apr 01:43
Gravatar

Re: [chaco] adding plot to plot container...

On Tue, Mar 31, 2009 at 17:51, fred <fredmfp <at> gmail.com> wrote:
> Robert Kern a écrit :
>
>> p = Plot(...)
>> add_xy_plot('xvals', 'yvals', p, PolygonPlot)
> Yes, I understand that, but what about a CMapImagePlot?
>
> I can't get it working for CMapImagePlot (ie what should I set as
> index_name & value_name args for add_xy_plot?)
> Is it expected to work for CMapImagePlane?

Not being a BaseXYPlot, no. Take a look at the operations being done
inside img_plot to see what similar things you need to hook up.

--

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco
_______________________________________________
Enthought-dev mailing list
Enthought-dev <at> mail.enthought.com
https://mail.enthought.com/mailman/listinfo/enthought-dev
bryce hendrix | 1 Apr 01:47

Re: changes to the TabularEditor

fred wrote:
bryce hendrix a écrit :
A couple of weeks ago the TabularEditor was patched to use the TextEditMixin, which allows for editing all column as text. Unfortunately, this allows for unwanted editing in some cases. For this reason, I have added a new attribute to TabularEditor, "editable_labels". There are three modes of editing allowed by the TabularEditor now: 1. Strictly read-only. Set "editable=False" 2. Editable labels (i.e. the first column). Set "editable=False, editable_labels=True" 3. All columns are editable. This is the default.
Sounds great to me, as I asked this feature! :-) However, I don't see in the list above this item: 4. Strictly read-only labels, others columns editable.

Okay, its implemented, but if you want anything more complicated, I'm gonna have to force you to use the TableEditor instead :)

I didn't try with the ArrayEditor, just my simple use case, so please let me know how it works for you.

Bryce
_______________________________________________
Enthought-dev mailing list
Enthought-dev@...
https://mail.enthought.com/mailman/listinfo/enthought-dev
Christiaan Putter | 1 Apr 06:49

Tabular Editor

Hi guys,

Quick question:

Is there a way for a user to customize the tabular editor at run time?
 Calling configure_traits() brings up the standard view with all the
traits, though changing their properties doesn't effect the gui.
Calling configure_traits on the editor's adapter crashes the app.

So I'm guessing I'll need to 'role my own' little class for doing
this...  The class that get's displayed in the tabular editor can be
extended (new traits get added) at run time, so it would be nice if
the user could also configure the tabular editor to reflect this.

Any advice?

Regards,
Christian
Picon
Gravatar

Re: A few mayavi2 how-to questions

On 04/01/09 04:49, Gary Ruben wrote:
> I've been using the helpful script recorder (using 3.1.0 in WinXP) but 
> many changes aren't recorded - for example, the cut_plane implicit_plane 
> state that I was asking about. I've resorted a fair bit to inserting 

A listing of those that aren't recorded would help us fix them faster. 
I'm not sure why I didn't record the implicit plane widget.  Will look 
at that during the weekend.

Thanks.
prabhu
fred | 1 Apr 09:36
Picon

Re: changes to the TabularEditor

bryce hendrix a écrit :

> Okay, its implemented, but if you want anything more complicated, I'm
> gonna have to force you to use the TableEditor instead :)
Nothing more complicated ;-)

> I didn't try with the ArrayEditor, just my simple use case, so please
> let me know how it works for you.
It's perfect! :-)

Thanks a lot, Bryce.

Cheers,

--

-- 
Fred
bpthrane | 1 Apr 09:40
Favicon

[mv2] zzz_reader template

I have made several data import modules based on the zzz_reader.py
template, but they don't work exactly as hoped.

I import the filter in the file site_mayavi.py with the statement
import zzz_reader

First of all the file filter doesn't work, this applies also to the
template. When you open the file browser and set the filter to "Files
(ZZZ files (*.zzz))", the file list becomes empty even if I have files
with the extension .zzz in the current directory.

Furthermore, when I have several filters based on the same template,
only the first one to be imported appears in the filter list. I have of
course renamed all variables and filter names and descriptions. The
filters work correctly, it's just the drop down filter menu and the file
extension filter function itself that doesn't work.

Ubuntu 8.10 64-bit Mayavi version 3.2.1.dev-r23438 - VTK version 5.2.0
Python 2.5.2 wxPython 2.8.9.2

Regards,
B. P. Thrane

--

-- 
http://www.fastmail.fm - One of many happy users:
  http://www.fastmail.fm/docs/quotes.html
fred | 1 Apr 09:46
Picon

Re: [chaco] adding plot to plot container...

Robert Kern a écrit :

> Not being a BaseXYPlot, no. Take a look at the operations being done
> inside img_plot to see what similar things you need to hook up.
Ok. Just wanted to know. Thanks.

In fact, the way I want to go is to use .add()/.remove() Plot methods,
because I need all properties (colormap, etc) from already created plots.

I'll send a CME asap, showing two of the majors bugs I get.
For plots in my tabs list, I want to:

- sync two plots in two different tabs (for zooming/panning) if needed;
- superimpose a plot in one tab with another plot in another tab
(background image) if needed; zooming/panning is required too, of course.

(the word "if needed" is essential ;-))

Cheers,

--

-- 
Fred
fred | 1 Apr 16:51
Picon

Re: [chaco] adding plot to plot container...

Hi,

I fixed one of my issue, with a slightly modified version of
plot.img_plot() (for now; others are straighforward too).

Say I have a Plot object.

To add plots to it, one can do:

p = Plot()

.../...

p.img_plot(...) # first plot

p.img_plot(...) # second plot.

Doing this, the second plot is on top on the first.

My purpose being to add background image, I have to, _not add_, but
_insert_ it before the first plot.

To do this, I have slightly modified plot.img_plot():

def img_plot(self, data, name=None, colormap=None,
                 xbounds=None, ybounds=None, origin=None,
hide_grids=True, insert_index=None, **styles):
                 ^^^^^^^^^^^^^^^^^^ here

and at the end:

        if insert_index is None:                      # line added
            self.add(plot)
        else:                                         # line added
            self.insert(insert_index, plot)           # line added
        self.plots[name] = [plot]
        return self.plots[name]

This fits perfectly my needs.

Thouhts about this?

TIA

Cheers,

--

-- 
Fred
bryce hendrix | 1 Apr 22:34

Re: Tabular Editor

The adapter has a columns attribute, which is a list of (display_name, 
trait_name) tuples. You can change the columns' values at any time, 
though I am not sure what the behavior is if you try changing the 
columns while the TabularEditor is visible.

Bryce

Christiaan Putter wrote:
> Hi guys,
>
> Quick question:
>
> Is there a way for a user to customize the tabular editor at run time?
>  Calling configure_traits() brings up the standard view with all the
> traits, though changing their properties doesn't effect the gui.
> Calling configure_traits on the editor's adapter crashes the app.
>
> So I'm guessing I'll need to 'role my own' little class for doing
> this...  The class that get's displayed in the tabular editor can be
> extended (new traits get added) at run time, so it would be nice if
> the user could also configure the tabular editor to reflect this.
>
> Any advice?
>
> Regards,
> Christian
>
> _______________________________________________
> Enthought-dev mailing list
> Enthought-dev@...
> https://mail.enthought.com/mailman/listinfo/enthought-dev
>   

Gmane