Various questions

- I have 2 Suplots on top of each other, but when I select only one
    axis on the drop-down button I get an error:

This was a python2.2 specific bug relating to nested scopes. It's
fixed for the next release.

  - I want to systematically disable the vertical zoom/move on the
    second subplot, but not the first. How can I do that ?

Well, when the menu is working properly that is how you do it. By
"systematically", do you mean by default so it's disabled when the
plot comes up?

If so, this depends on how you are building your GUI window.
Basically you need to get your hands on the gtk.Toolbar instance,
which contains an omenu (gtk.OptionMenu) attribute (wait until the
next release, a couple of days, where I've cleaned this up a bit).
Eg, if you are using the matlab interface

  manager = get_current_fig_manager()
  items = manager.toolbar.omenuItems
  items[-1].set_active(False)

Turns off navigation for the last subplot. items[0] would turn off
navigation for the first subplot, and so on.

Here are the docs for gtk.MenuItem -
http://www.gnome.org/~james/pygtk-docs/class-gtkmenuitem.html

  - How can I activate a tooltip on top of my plots ?

You'll have to read up on gtk tooltips. Depends on what elements you
want to add tips to. Give me a little more info. DO you want to add
tips to the navigation buttons or lines on your plot or text elements
or what?

http://www.gnome.org/~james/pygtk-docs/class-gtktooltips.html

Also check out the pygtk FAQ http://www.async.com.br/faq/pygtk and
tutorial
http://www.moeraki.com/pygtktutorial/pygtk2tutorial/index.html.

  - I cannot zoom or move an plot I set the axis ticks to , ie
    ax.set_xticks([])

This is a bug - thanks for reporting it. I use the tick width as the
default interval in pan. When there are no ticks, I divided by the
number of ticks and got a division by zero error. I now check for 0
and default to 20% of the plot if there are no ticks.

  - How could I add a button to directly print out the picture in the toolbar ?

Print as in to a printer? No support for that yet and am not sure I
want to go there right now (cross platform printing would might take
lot of work). Best I can offer you currently is the savefig button.
I think gnome-print has made a fair amount of progress since I first
wrote matplotlib so if you want to be on the vanguard and explore this
option I would be happy.

  - Is there any density plot available ?

Do you mean hist?

http://matplotlib.sourceforge.net/screenshots.html#histogram_demo
http://matplotlib.sourceforge.net/matplotlib.matlab.html#-hist

  - Can I change the size taken by each of the Suplots ?

Just use axes. Subplot derives from Axes. With axes, you can set the
size of your subplot with a rect [left, bottom, width, height]

http://matplotlib.sourceforge.net/matplotlib.matlab.html#-axes
http://matplotlib.sourceforge.net/matplotlib.axes.html
http://matplotlib.sourceforge.net/screenshots.html#axes_demo

- I have MANY small plots on my graph. Is there a cost effective way
  to filter which plots to show ?

I don't know what this means. Wouldn't you want to show all the plots
on your figure? Why else would you put them there? Please elaborate.

Cheers,
JDH

Sæl

Thanks for the detailed answerS I will try to go one step further for the unclear question.
I hope this will help other users too :slight_smile:

  - I want to systematically disable the vertical zoom/move on the
    second subplot, but not the first. How can I do that ?

Well, when the menu is working properly that is how you do it. By
"systematically", do you mean by default so it's disabled when the
plot comes up?

If so, this depends on how you are building your GUI window.
Basically you need to get your hands on the gtk.Toolbar instance,
which contains an omenu (gtk.OptionMenu) attribute (wait until the
next release, a couple of days, where I've cleaned this up a bit).
Eg, if you are using the matlab interface

  manager = get_current_fig_manager()
  items = manager.toolbar.omenuItems
  items[-1].set_active(False)

Turns off navigation for the last subplot. items[0] would turn off
navigation for the first subplot, and so on.

Indeed I meant 'by default' and you answered partially my question.
I would like to disable only the veritcal zoom, not the horizontal one.
Is it possible ?

  - How can I activate a tooltip on top of my plots ?

You'll have to read up on gtk tooltips. Depends on what elements you
want to add tips to. Give me a little more info. DO you want to add
tips to the navigation buttons or lines on your plot or text elements
or what?

I am aware of tooltips in pygtk, and I would liek to use them on the axes only.
As I understood those axes are included in a figure which is a DrwaingArea. But DrawingArea do not accept tooltip easily.
Did you implement a workaround to have a tooltip on the axes

  - How could I add a button to directly print out the picture in the toolbar ?

Print as in to a printer? No support for that yet and am not sure I
want to go there right now (cross platform printing would might take
lot of work). Best I can offer you currently is the savefig button.
I think gnome-print has made a fair amount of progress since I first
wrote matplotlib so if you want to be on the vanguard and explore this
option I would be happy.

I used the NavigationToolbar as a GTKToolbar and added a button with the function I wanted.
This solved my problem

  - Is there any density plot available ?

Do you mean hist?

The histogram provide a similar plot to what I want.
I am currently using it, but when i zoom horizontally I can get very few and large bars.
Therefore I would be interested in a simple curve fitted to pass through all the tops of histograms.
This would make the picture more consistent throughout the zooming

If the curve was filled it would be even better :slight_smile:

- I have MANY small plots on my graph. Is there a cost effective way
  to filter which plots to show ?

I don't know what this means. Wouldn't you want to show all the plots
on your figure? Why else would you put them there? Please elaborate.

Within one Sublot I have thousands of small "lines" plotted. This takes time to draw and show on the screen
Within my software I would like to be able to filter interactively that information according to various criteria to show only few of them
In order to do that cost effectively I was wondering if matplotlib provides an option to show/hide specific "lines" that I could turn on/off
That woudl avoid me to redraw the whole picture after 1 single change

Takk

Kveðja

Jean-Baptiste

···

--
-----------------------------
Jean-Baptiste.Cazier@...15...

Department of Statistics
deCODE genetics Sturlugata,8
570 2993 101 Reykjavík