AssertionError without further description

Hello matplotlib-community,

I’m using matplotlib since a while, but have never had a real reason to write to the mailing-list yet.
Furthermore I know, that the Cookbook at scipy.org is more or less outdated

Anyway, I tried the multicolored Line example at http://www.scipy.org/Cookbook/Matplotlib/MulticoloredLine (at the bottom) and found that I get an AssertionError, without further description or exeption string.

The line producing the error is this one:

10. LC = LineCollection(segments, colors = colors)

How to get rid of this problem?
Is there an alternative way?

Thanks and greets!
Martin


Can you copy and paste the actual error message and traceback? I run
the script here on SVN trunk and it works fine.

If you're looking for an update "cookbook", you can always look at the gallery:

http://matplotlib.sourceforge.net/gallery.html

Ryan

···

On Sun, Mar 21, 2010 at 6:17 AM, Martin Bothe <martin.bothe@...982...> wrote:

Hello matplotlib-community,

I'm using matplotlib since a while, but have never had a real reason to
write to the mailing-list yet.
Furthermore I know, that the Cookbook at scipy.org is more or less outdated

Anyway, I tried the multicolored Line example at
http://www.scipy.org/Cookbook/Matplotlib/MulticoloredLine (at the bottom)
and found that I get an AssertionError, without further description or
exeption string.
The line producing the error is this one:

10. LC = LineCollection(segments, colors = colors)

How to get rid of this problem?
Is there an alternative way?

--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma

Hey Ryan,

thanks for your answer.

Ashamed I have to realize that the example works for me as well.

When I tried it the first time, I had no pc featuring both internet and a matplotlib installation, so I had to copy everything manually.

It seems I skipped a line or whatever.

In the gallery, I can’t find a multicolored line.

Thanks again, greetings

Martin

···

On Sun, Mar 21, 2010 at 5:59 PM, Ryan May <rmay31@…287…> wrote:

On Sun, Mar 21, 2010 at 6:17 AM, Martin Bothe > > <martin.bothe@…982…> wrote:

Hello matplotlib-community,

I’m using matplotlib since a while, but have never had a real reason to

write to the mailing-list yet.

Furthermore I know, that the Cookbook at scipy.org is more or less outdated

Anyway, I tried the multicolored Line example at

http://www.scipy.org/Cookbook/Matplotlib/MulticoloredLine (at the bottom)

and found that I get an AssertionError, without further description or

exeption string.

The line producing the error is this one:

  1. LC = LineCollection(segments, colors = colors)

How to get rid of this problem?

Is there an alternative way?

Can you copy and paste the actual error message and traceback? I run

the script here on SVN trunk and it works fine.

If you’re looking for an update “cookbook”, you can always look at the gallery:

http://matplotlib.sourceforge.net/gallery.html

Ryan

Ryan May

Graduate Research Assistant

School of Meteorology

University of Oklahoma

That's because it wasn't there. :slight_smile: I've ported it to make better use
of matplotlib facilities that are now available and added it to SVN.
In general, however, the gallery is the best place to look because we
should be keeping it up to date with changes in the code.

I attached the modified script since it won't show up in the gallery
right away. I'd take a look, because it drastically simplifies the
colormapping.

Ryan

multicolored_line.py (1.23 KB)

···

On Sun, Mar 21, 2010 at 12:23 PM, Martin Bothe <martin.bothe@...3035...> wrote:

Hey Ryan,
thanks for your answer.
Ashamed I have to realize that the example works for me as well.
When I tried it the first time, I had no pc featuring both internet and a
matplotlib installation, so I had to copy everything manually.
It seems I skipped a line or whatever.
In the gallery, I can't find a multicolored line.

--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma

Ryan May wrote:

Hey Ryan,
thanks for your answer.
Ashamed I have to realize that the example works for me as well.
When I tried it the first time, I had no pc featuring both internet and a
matplotlib installation, so I had to copy everything manually.
It seems I skipped a line or whatever.
In the gallery, I can't find a multicolored line.

That's because it wasn't there. :slight_smile: I've ported it to make better use
of matplotlib facilities that are now available and added it to SVN.
In general, however, the gallery is the best place to look because we
should be keeping it up to date with changes in the code.

I attached the modified script since it won't show up in the gallery
right away. I'd take a look, because it drastically simplifies the
colormapping.

Nice!

Would you also edit the cookbook, please? You could just point to your new example; and maybe include a version with a more typical colormap and norm, giving a smooth gradation.

Thank you.

Eric

···

On Sun, Mar 21, 2010 at 12:23 PM, Martin Bothe <martin.bothe@...3035...> wrote:

Ryan

------------------------------------------------------------------------

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev

------------------------------------------------------------------------

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

There actually was an example there already showing the nice smooth
gradient of colors. I've cleaned up that example and added that to
SVN as well. I kept the discrete example as it shows nicely the use of
listed colormaps and boundary norms, which aren't used in a lot of
examples.

I've updated the recipes on scipy.org to reflect our examples, as well
as putting a link to the gallery.

Ryan

···

On Sun, Mar 21, 2010 at 1:36 PM, Eric Firing <efiring@...202...> wrote:

Ryan May wrote:

That's because it wasn't there. :slight_smile: I've ported it to make better use
of matplotlib facilities that are now available and added it to SVN.
In general, however, the gallery is the best place to look because we
should be keeping it up to date with changes in the code.

I attached the modified script since it won't show up in the gallery
right away. I'd take a look, because it drastically simplifies the
colormapping.

Nice!

Would you also edit the cookbook, please? You could just point to your new
example; and maybe include a version with a more typical colormap and norm,
giving a smooth gradation.

--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma