Jordan Dawe | 1 Sep 01:31
Picon
Picon
Favicon

plotting a pcolor over a contourf

I've been trying to plot a pcolor over a contourf with a masked array in 
the pcolor so that parts of the contour will show through underneath, 
but whenever I try to do this the pcolor wipes out the contourf.  I can 
do this fine with a contourf over another contourf, but I'm plotting 
model topography, and I would really prefer to leave the discretization 
visible instead of showing contourf's interpolation.  Any way to get a 
pcolor to plot over a contourf without wiping out the contourf beneath it?

Jordan

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
Eric Firing | 1 Sep 06:00
Favicon
Gravatar

Re: plotting a pcolor over a contourf

Jordan Dawe wrote:
> I've been trying to plot a pcolor over a contourf with a masked array in 
> the pcolor so that parts of the contour will show through underneath, 
> but whenever I try to do this the pcolor wipes out the contourf.  I can 
> do this fine with a contourf over another contourf, but I'm plotting 
> model topography, and I would really prefer to leave the discretization 
> visible instead of showing contourf's interpolation.  Any way to get a 
> pcolor to plot over a contourf without wiping out the contourf beneath it?
> 
> Jordan

Jordan,

I'm not sure I understand what you are trying to do; please provide a 
simple, self-contained script that illustrates the problem.  (Is the 
contour supposed to be seen through holes in the pcolor where it is 
masked?  Or are you talking about using transparency?)

Eric

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
Alan G Isaac | 1 Sep 07:08
Picon
Favicon
Gravatar

marker=None not allowed?

Line2D documentation reads:

    marker: [ '+' | ',' | '.' | '1' | '2' | '3' | '4'

1. Minor documentation bug: missing end bracket
2. Why is marker=None no longer allowed?

Cheers,
Alan Isaac

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
Alan G Isaac | 1 Sep 08:30
Picon
Favicon
Gravatar

annotation problem

I meant to be copying an annotation example from
http://matplotlib.sourceforge.net/examples/annotation_demo.bak.py
but it is not working.  Am I just too bleary eyed because it 
is later here, or is there a problem with the example?

Thank you,
Alan Isaac

%%%%%%%%%%%%  Illustrate Annotation Problem  %%%%%%%%%%%%%%%%%%%%%
import pylab
import matplotlib as mpl
test = pylab.figure()
test_ax = test.gca()
test_ax.plot([1,2,3])

#the following line fails with "ValueError: too many values to unpack" 
a = mpl.text.Annotation(
test,
'F: a figure title (points)',
loc=(-10, -10),
coords='figure points',
horizontalalignment='right',
verticalalignment='top',
fontsize=20)

test_ax.add_artist(f)
test.savefig(r'c:\temp\temp.eps')

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
(Continue reading)

Eric Firing | 1 Sep 08:39
Favicon
Gravatar

Re: marker=None not allowed?

Alan G Isaac wrote:
> Line2D documentation reads:
> 
>     marker: [ '+' | ',' | '.' | '1' | '2' | '3' | '4'
> 
> 1. Minor documentation bug: missing end bracket
Sort of.  Actually, what is also missing is a very long list of possible 
markers, as given in the docstring for the set_marker method.  Some 
docstring modifications and consolidations are needed.
> 2. Why is marker=None no longer allowed?

marker='None' is allowed, as is ' ' and ''.  Do you need None?  The idea 
is to distinguish between 'None' as in 'no marker--don't draw anything', 
and None as the default for a kwarg, meaning use the rcParams value.  In 
plot, if you trace through the chain of half a dozen or so functions, 
you find that the kwargs are handled using setters, not at the stage of 
initialization of the Line2D instance, and setters generally don't 
accept None.

Eric

> 
> Cheers,
> Alan Isaac
> 
> 
> 
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
(Continue reading)

Eric Firing | 1 Sep 09:07
Favicon
Gravatar

Re: annotation problem

Alan G Isaac wrote:
> I meant to be copying an annotation example from
> http://matplotlib.sourceforge.net/examples/annotation_demo.bak.py
I don't see much resemblance to that example; and I haven't tried that 
example, but I did verify that the examples/annotation_demo.py in svn 
works as expected.
> but it is not working.  Am I just too bleary eyed because it 
> is later here, or is there a problem with the example?
Time for bed, rest those bleary eyes...

The signature of the Annotation.__init__ does not match what you were 
trying to feed it.  Here is a modification that does match, but that may 
not be anything like what you were trying to do:

import pylab
import matplotlib as mpl
test = pylab.figure()
test_ax = test.gca()
test_ax.plot([1,2,3])

a = mpl.text.Annotation(

'F: a figure title (points)',
(-10, -10),
xycoords='figure points',
horizontalalignment='right',
verticalalignment='top',
fontsize=20)

test_ax.add_artist(a)
(Continue reading)

Alan G Isaac | 1 Sep 10:08
Picon
Favicon
Gravatar

dateplot problem

I recall some discussion of problem importing mpl EPS files
into Microsoft products in the past, and I think I recall
that there was a fix.  I'm using 0.9.1 and the dates in
my dateplots do not show up when imported into PowerPoint.
(An annotation below the dates does show up.)

Any clues?

Thank you,
Alan Isaac

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
Alan G Isaac | 1 Sep 10:08
Picon
Favicon
Gravatar

Re: annotation problem

> Alan G Isaac wrote:
>> I meant to be copying an annotation example from 
>> http://matplotlib.sourceforge.net/examples/annotation_demo.bak.py 

On Fri, 31 Aug 2007, Eric Firing apparently wrote:
> The signature of the Annotation.__init__ does not match what you were 
> trying to feed it. 

OK, I can see that at 
http://matplotlib.sourceforge.net/matplotlib.text.html
So then the examples *are* wrong at
http://matplotlib.sourceforge.net/examples/annotation_demo.bak.py
Right?

Your example is sending me down the right track.
But I am still getting an odd result with

a = mpl.text.Annotation('text', (0.5,0.5), xycoords="axes fraction", fontsize=20)
fig_ax.add_artist(a)

Shouldn't this put the text smack in the middle of the figure?

OK, I give up for now.  Time for some sleep.

Thanks!
Alan

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
(Continue reading)

Alan G Isaac | 1 Sep 10:18
Picon
Favicon
Gravatar

Re: marker=None not allowed?

On Fri, 31 Aug 2007, Eric Firing apparently wrote:
> marker='None' is allowed, as is ' ' and ''.  Do you need None? 

I recently returned to some old figures where I did things 
like this:

ls1 = dict(linestyle='-', marker=None, color=(0,0,1), linewidth=2, zorder=1000)
fig_ax.plot_date(dates, data, **ls1)

This now fails with a KeyError.

However changing to marker='' works fine.
I find that a bit less intuitve than marker=None,
but I understand you to say that this should mean "use the default".

Thank you,
Alan Isaac

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
Jouni K. Seppänen | 1 Sep 14:07
Face
Picon
Picon
Picon
Favicon
Gravatar

Re: dateplot problem

Alan G Isaac <aisaac@...> writes:

> I recall some discussion of problem importing mpl EPS files
> into Microsoft products in the past, and I think I recall
> that there was a fix.  

Perhaps you are thinking of one of these posts, which suggest using the
svg backend and converting to emf via Inkscape or Visio:

http://article.gmane.org/gmane.comp.python.matplotlib.general/9241
http://article.gmane.org/gmane.comp.python.matplotlib.general/9250

--

-- 
Jouni K. Seppänen
http://www.iki.fi/jks

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

Gmane