Re: [Matplotlib-users] imshow restricted to circle

2007-05-16 Thread John Hunter
On 5/16/07, Thorsten Kranz <[EMAIL PROTECTED]> wrote:
> Hi, I have a question about the command "imshow". Is there a way to have
> such a colorplot only limited to a circular area?
>
> I want to have it look like the colorplots in
>
> http://www.uke.uni-hamburg.de/kliniken/neurologie/downloads/klinik-neurologie/Hummel_Figure7.jpg
>
>
> Nice is also something like
> http://www.sol.lu.se/humlab/research/img/erp02.jpg
>
> Can it be done with matplotlib?


Not quite.  I recently added support for clipping to polygons in *Agg,
but I haven't ported this to all the mpl Artists yet.  In particular,
I haven't done it for images.  You might be able to do it yourself if
you wanted to explicitly set the alpha channel, so that alpha outside
the circle was 0.

JDH

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imshow restricted to circle

2007-05-16 Thread Jose Gomez-Dans
Hi,

On 5/16/07, Thorsten Kranz <[EMAIL PROTECTED]> wrote:
> Hi, I have a question about the command "imshow". Is there a way to have
> such a colorplot only limited to a circular area?
>
> I want to have it look like the colorplots in
>
> http://www.uke.uni-hamburg.de/kliniken/neurologie/downloads/klinik-neurologie/Hummel_Figure7.jpg

I have used the same sort of plots for the polar regions, where you
sometimes want to concentrate on one single annulus. One thing you can
do is to have a mask, with the same size as your matrix. You calcualte
r_ij = sqrt(xi*xi + yj*yj), set a threshold U and let the mask be
equal to 1 if r<=U, or else 0. When you apply the mask, the area
outside your radius of interest will be masked out.

I know, I know... long winded :)

Cheers,
Jose

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] using different font families with?LaTeX-generated text

2007-05-16 Thread Alexander Schmolck
Darren Dale <[EMAIL PROTECTED]> writes:

> On Monday 14 May 2007 1:29:05 pm Alexander Schmolck wrote:
>> Darren Dale <[EMAIL PROTECTED]> writes:
>> I'd *really* like the ability to ``usepackage`` for various reasons and it
>> would clearly add useful functionality that is not otherwise obtainable.
>>
>> I understand concern about an additional support burden, but couldn't this
>> be handled by explicitly noting that it's unsupported, possibly even
>> printing out an unsubtle warning
[...]
> As far as I'm concerned, being unsupported disqualifies the feature from 
> being 
> included in mpl.

Well, if ever there was a compelling use-case for an undocumented/unsupported
feature it would be this one, I think.

We are talking about something that involves very little implementation effort
(< 5 LOC or so), right? So provided it doesn't result in either an
implementation burden or in additional support requests, why wouldn't you
allow people to obtain functionality, at their own risk, that may be of high
utility to them?

For example, I use a few lower-case bold greek symbols in my work, and I also
want to use them in my plots. Due to some arbitrary braindamage in latex, this
essentially requires a ``\usepackage{bm}`` somewhere in your preamble, and
there are other fairly standard things are as far as I can see impossible to
obtain without (if it doesn't cause portability hassles of the type you
mentioned etc., I think it might actually be worth-while considering to add
things like 'bm' and 'ammssymb' to the default-preamble).

I don't think me and other users editing texmanager by hand or resulting to
some really nasty hacks in order to just extend simple template string being a
better solution (or one that necessarily results in fewer support requests --
"oops, sorry I just noticed I actually screwed around with this file in order
to change my latex-preamble").

It wouldn't even be necessary to add some proper latex_preamble option, as
long as there is some TexManager attribute that's easily enough to modify.

cheers,

'as


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imshow restricted to circle

2007-05-16 Thread Thorsten Kranz

Thanks a lot anyway! So I will have a look a Custom solution...
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] using different font families with?LaTeX-generated text

2007-05-16 Thread Darren Dale
On Wednesday 16 May 2007 01:29:56 pm Alexander Schmolck wrote:
> Darren Dale <[EMAIL PROTECTED]> writes:
> > On Monday 14 May 2007 1:29:05 pm Alexander Schmolck wrote:
> >> Darren Dale <[EMAIL PROTECTED]> writes:
> >> I'd *really* like the ability to ``usepackage`` for various reasons and
> >> it would clearly add useful functionality that is not otherwise
> >> obtainable.
> >>
> >> I understand concern about an additional support burden, but couldn't
> >> this be handled by explicitly noting that it's unsupported, possibly
> >> even printing out an unsubtle warning
>
> [...]
>
> > As far as I'm concerned, being unsupported disqualifies the feature from
> > being included in mpl.
>
> Well, if ever there was a compelling use-case for an
> undocumented/unsupported feature it would be this one, I think.
>
> We are talking about something that involves very little implementation
> effort (< 5 LOC or so), right? So provided it doesn't result in either an
> implementation burden or in additional support requests, why wouldn't you
> allow people to obtain functionality, at their own risk, that may be of
> high utility to them?
>
> For example, I use a few lower-case bold greek symbols in my work, and I
> also want to use them in my plots. Due to some arbitrary braindamage in
> latex, this essentially requires a ``\usepackage{bm}`` somewhere in your
> preamble, and there are other fairly standard things are as far as I can
> see impossible to obtain without (if it doesn't cause portability hassles
> of the type you mentioned etc., I think it might actually be worth-while
> considering to add things like 'bm' and 'ammssymb' to the
> default-preamble).
>
> I don't think me and other users editing texmanager by hand or resulting to
> some really nasty hacks in order to just extend simple template string
> being a better solution (or one that necessarily results in fewer support
> requests -- "oops, sorry I just noticed I actually screwed around with this
> file in order to change my latex-preamble").
>
> It wouldn't even be necessary to add some proper latex_preamble option, as
> long as there is some TexManager attribute that's easily enough to modify.

I'll give this some more thought.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users