[Matplotlib-users] Offset details for contour plot

2008-02-06 Thread Dan Karipides
I'm considering using Matplotlib to programmatically generate images for a
web-based application.  I want some specific information about contour plot
images produced by Matplotlib and I was wondering if it was easy/possible to
get this information.

 

Imagine a contour plot rendered to a .png.  For simplicity, assume the size
is 1000x1000 pixels.  Of course, this image has white-space, axes, axis
labels, perhaps a colorbar, etc.  The actual contour part, showing the data,
is smaller than 1000x1000 pixels.  I'd like to know:

 

*   the size (in pixels) of the actual contour part of the generated
.png

*   the offset (in pixels) from the bottom left hand corner of the
actual contour part

 

Of course if pixel information isn't possible, offset and size as a
percentage of the total image size would be fine.

 

Thanks,

 

-Dan

---

Dan Karipides

[EMAIL PROTECTED]

 

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] screen colors invert with matplotlib

2008-01-10 Thread Dan Karipides
Just to follow up:

Mike was indeed correct.  I never found the qt4 demos but I did find some
simple pyqt4 sample code.

http://zetcode.com/tutorials/pyqt4/firstprograms/

The first example on this page causes the same problem.  It really isn't a
color inversion.  It seems to be more of a messed up color palette.  Some
colors remain unchanged, other colors are wildly different.  White does go
to black though which is the most notable change.

So this is a PyQt (or Qt?) problem.  As such, I'll stop cluttering this list
and move my investigation elsewhere.

Thanks for your help, all.

-Dan

-Original Message-
From: Michael Droettboom [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 09, 2008 2:35 PM
To: Dan Karipides
Cc: 'Matplotlib Users'
Subject: Re: [Matplotlib-users] screen colors invert with matplotlib

I wonder if the problem exhibits itself in any other pyqt4 apps (such as 
the demo apps)...  In that case, I would take your question to the pyqt 
list.  Otherwise, we'll want to track down what specifically matplotlib 
is doing that causes this.

Cheers,
Mike



-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] screen colors invert with matplotlib

2008-01-09 Thread Dan Karipides
Darren,

This is interesting.  I tried to get a screenshot of the bad behavior for
you.  My first attempt was to just hit "print screen".  Under Fedora Core 8,
KDE window manager this brings up the application KSnapshot.  When KSnapshot
gets focus, the bad behavior goes away and it was not captured in the
screenshot.

I did notice the KSnapshot app has a snapshot delay feature.  I set it to 2
seconds, and clicked new snapshot.  The KSnapshot window disappeared for 2
seconds; the bad behavior was back for that period of time.  However, even
in this case, the behavior doesn't show up in the screenshot.

This makes me wonder if maybe it is a video driver problem.  Linux has the
right colors in memory (which is I assume the level at which the snap shot
is taken), but the driver is wigging out when communicating the info to the
actual video card.

If I manage to get a SS I will post it.

-Dan

-Original Message-
From: Darren Dale [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 09, 2008 3:08 PM
To: matplotlib-users@lists.sourceforge.net
Cc: Dan Karipides
Subject: Re: [Matplotlib-users] screen colors invert with matplotlib

Could you please post a screenshot of the bad behavior? I don't see anything

strange here, and I'm using qt-4.3.3, pyqt-4.3.3, and an nvidia GeForce
6600.

Darren

On Wednesday 09 January 2008 05:00:28 pm Dan Karipides wrote:
> Do the demo apps come with the standard qt4/pyqt4 install?  I just used
the
> Fedora Core 8 package manager to install both of these packages.
>
> I apologize that my knowledge of qt is limited.  I'll do some
investigation
> of qt4 / pyqt4 on my own before bothering the list further.
>
> Thanks for the suggestion,
>
> -Dan
>
> -Original Message-
> From: Michael Droettboom [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, January 09, 2008 2:35 PM
> To: Dan Karipides
> Cc: 'Matplotlib Users'
> Subject: Re: [Matplotlib-users] screen colors invert with matplotlib
>
> I wonder if the problem exhibits itself in any other pyqt4 apps (such as
> the demo apps)...  In that case, I would take your question to the pyqt
> list.  Otherwise, we'll want to track down what specifically matplotlib
> is doing that causes this.
>
> Cheers,
> Mike
>


-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] screen colors invert with matplotlib

2008-01-09 Thread Dan Karipides
Do the demo apps come with the standard qt4/pyqt4 install?  I just used the
Fedora Core 8 package manager to install both of these packages.

I apologize that my knowledge of qt is limited.  I'll do some investigation
of qt4 / pyqt4 on my own before bothering the list further.

Thanks for the suggestion,

-Dan

-Original Message-
From: Michael Droettboom [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 09, 2008 2:35 PM
To: Dan Karipides
Cc: 'Matplotlib Users'
Subject: Re: [Matplotlib-users] screen colors invert with matplotlib

I wonder if the problem exhibits itself in any other pyqt4 apps (such as 
the demo apps)...  In that case, I would take your question to the pyqt 
list.  Otherwise, we'll want to track down what specifically matplotlib 
is doing that causes this.

Cheers,
Mike

Dan Karipides wrote:
> Thanks John.
> 
> I did this test:
> 
>   python simple_plot.py -dTkAgg  
> 
> and it worked just fine.  (The GTK backend won't compile for me, but that
is
> a topic for another email.)
> 
> So you are correct, it seems to be a qt4 problem or a pyqt4 problem, I
> guess.
> 
> At least I know where to look now.
> 
> -Dan
> 
> -Original Message-
> From: John Hunter [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, January 09, 2008 11:40 AM
> To: Dan Karipides
> Cc: Matplotlib Users
> Subject: Re: [Matplotlib-users] screen colors invert with matplotlib
> 
> On Jan 9, 2008 10:14 AM, Dan Karipides <[EMAIL PROTECTED]> wrote:
> 
>> OS: Fedora Core 8
>>
>> Video Card: Nvidia GeForce 8800 Ultra
>>
>> Driver: Latest Unix driver from Nvidia (169.07, release date: Dec 20,
> 2007)
>> Matplotlib version: matplotlib-0.91.2.tar.gz (built from source)
>>
>> Backend chosen: qt4agg
>>
> 
> Hi Dan,
> 
> No one has ever reported anything like this before as far as I know.
> Could you try running a simple test script with a different GUI
> backend, eg tkagg or gtkagg
> 
>   > python simple_plot.py -dTkAgg  #or GTKAgg
> 
> I assume this is a qt4 problem, but I'd just like to confirm before we
> proceed.  Do you see it with qtagg or just qt4agg?
> 
> 
> -
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
>
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] screen colors invert with matplotlib

2008-01-09 Thread Dan Karipides
I don't have pyqt installed, just pyqt4, so I'm afraid I can't do that test
for you at the moment.  Though I suppose I could install pyqt as one method
of testing this.

Thanks,

-Dan

-Original Message-
From: John Hunter [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 09, 2008 2:32 PM
To: Dan Karipides; Matplotlib Users
Subject: Re: [Matplotlib-users] screen colors invert with matplotlib

On Jan 9, 2008 1:32 PM, Dan Karipides <[EMAIL PROTECTED]> wrote:
> Thanks John.
>
> I did this test:
>
> python simple_plot.py -dTkAgg
>
> and it worked just fine.  (The GTK backend won't compile for me, but that
is
> a topic for another email.)
>
> So you are correct, it seems to be a qt4 problem or a pyqt4 problem, I
> guess.
>
> At least I know where to look now.

What about qtagg vs qt4agg?  It would be interesting to know if it is
qt4 specific, or qt specific.

Please keep the responses on list because there are other developers
more knowledgeable than I about qt.

JDH


-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] screen colors invert with matplotlib

2008-01-09 Thread Dan Karipides

Thanks John.

I did this test:

python simple_plot.py -dTkAgg  

and it worked just fine.  (The GTK backend won't compile for me, but that is
a topic for another email.)

So you are correct, it seems to be a qt4 problem or a pyqt4 problem, I
guess.

At least I know where to look now.

-Dan

-Original Message-
From: John Hunter [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 09, 2008 11:40 AM
To: Dan Karipides
Cc: Matplotlib Users
Subject: Re: [Matplotlib-users] screen colors invert with matplotlib

On Jan 9, 2008 10:14 AM, Dan Karipides <[EMAIL PROTECTED]> wrote:

> OS: Fedora Core 8
>
> Video Card: Nvidia GeForce 8800 Ultra
>
> Driver: Latest Unix driver from Nvidia (169.07, release date: Dec 20,
2007)
>
> Matplotlib version: matplotlib-0.91.2.tar.gz (built from source)
>
> Backend chosen: qt4agg
>

Hi Dan,

No one has ever reported anything like this before as far as I know.
Could you try running a simple test script with a different GUI
backend, eg tkagg or gtkagg

  > python simple_plot.py -dTkAgg  #or GTKAgg

I assume this is a qt4 problem, but I'd just like to confirm before we
proceed.  Do you see it with qtagg or just qt4agg?


-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] screen colors invert with matplotlib

2008-01-09 Thread Dan Karipides
I've recently started using matplotlib on new unix box and I'm running in to
an odd problem.  I'm not sure what the root cause is (my linux installation,
graphics drivers, matplotlib, or something else) but I thought I would ask
here to see if anyone else had experienced this.

 

OS: Fedora Core 8

Video Card: Nvidia GeForce 8800 Ultra

Driver: Latest Unix driver from Nvidia (169.07, release date: Dec 20, 2007)

Matplotlib version: matplotlib-0.91.2.tar.gz (built from source)

Backend chosen: qt4agg

Qt4 version: 4.3.3

 

The problem:  If a matplotlib plot window ever has focus, the screen colors
on the whole screen invert themselves.  White becomes black, etc.  I can
probably post a link to a screenshot if that will help, but it looks like a
simple color inversion to me.  If the plot window doesn't have focus,
everything is drawn correctly.

 

My simple test was:

 

$ ipython -pylab

 

In [1]: plot(range(10))

 

With older versions of matplotlib, the colors did not invert-the screen went
totally black when the plot window had focus.  When it doesn't, everything
looks fine.

 

I'm not seeing this behavior with any other application so far.  If
upgrading to the SVN trunk version would help, I'm willing to give that a
try.  But I wanted to get some feedback before updating anything else.

 

Thanks,

 

-Dan

-

Dan Karipides

Tech-X Corporation

[EMAIL PROTECTED]

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Removing a data series

2006-11-09 Thread Dan Karipides
Fernando,

Thanks, this is exactly what I need.

BTW, I think I missed it in the search because the archive here:

http://sourceforge.net/mailarchive/forum.php?forum_id=33405

doesn't show anything more recent that 10/02/2006.  I'm not sure why this
is.

Thanks again,

-Dan
-
[EMAIL PROTECTED]


-Original Message-
From: Fernando Perez [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 09, 2006 9:46 AM
To: Dan Karipides
Cc: matplotlib-users@lists.sourceforge.net
Subject: Re: [Matplotlib-users] Removing a data series

Hi Dan,

On 11/9/06, Dan Karipides <[EMAIL PROTECTED]> wrote:

> I did my best to search the examples, mailing list, etc. but was surprised
> that I didn't even find this question asked, let alone answered.

Coincidentally it was asked just yesterday by Andrea Gavana, but you
may have missed it in your search (it may have crossed with your
posting time).

> My basic question: Is it possible to remove a data series from a
matplotlib
> plot?

Here is a little self-contained example you can try (N==numpy, P=pylab):

In [24]: x = N.arange(10)

In [25]: fig = P.figure()

In [26]: ax = fig.add_subplot(111)

In [27]: ax.plot(x)
Out[27]: []

In [28]: ax.plot(x+10)
Out[28]: []

In [29]: ax.plot(x+20)
Out[29]: []

In [30]: P.show()

In [31]: ax.lines
Out[31]:
[,
 ,
 ]

In [32]: del ax.lines[1]

In [33]: P.show()


This makes the middle line disappear from the plot.

Regards,

f



-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Removing a data series

2006-11-09 Thread Dan Karipides








I
did my best to search the examples, mailing list, etc. but was surprised that I
didn’t even find this question asked, let alone answered.

 

My
basic question: Is it possible to remove a data series from a matplotlib plot?

 

Longer
question:

 

I'm
using matplotlib to generate graph images for an interactive web site.  Through
the web site, the user can create a plot and add data series to it.  I'd also
like the user to be able to remove a data series.  At the moment, I am
accomplishing this by clearing the plot and replotting all the data series
except of course for the one to be removed.  This seems inefficient.

 

So
something like:

 

  fig
= Figure()

  

  ax
= fig.add_subplot(111)

 

  series1
= ax.plot()

  series2
= ax.plot()

  series3
= ax.plot()

 

And
now I want to remove series2 from the plot.

 

Is
this possible?  If it is, can anyone point me to the relevant part of the
user's guide/class library?  Or is the best approach to clear the plot and
replot 1 and 3 (and reset all the axes, legends, etc.)

 

I
apologize if this is a FAQ, but as I said, my search for it came up empty.

 

Thanks,

 

-Dan

--

[EMAIL PROTECTED]

 






-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users