El 15/06/10 01:22, Mike Alger escribió:
The way that color keyword is set up, it is dedsigned to take a color
word or rgba tuple , (Reinier will know this better than me), however
if you want to just assign colors based on a colour map you can take
you color array and reshape the same way
pcolor runs directly on polar plots just fine. No need to convert polar
to cartesian outside of matplotlib.
#!/usr/bin/env python
from pylab import *
import numpy as np
# Sampling 60 points in both dimensions
T = linspace(0, np.pi * 2, 60)
R = linspace(0, 1.0, 60)
Z = rand(60,60)
# Create a
Hello,
The attached script shows my (failed) attempt to define a custom color
map from a set of RGB values (taken from an IDL palette).
My approach is presumably completely wrong, but I have not found
information or examples on how to do this.
Could someone point in the right direction?
Give this a shot:
http://www.scipy.org/Cookbook/Matplotlib/Show_colormaps
From: Jim Vickroy [mailto:jim.vick...@noaa.gov]
Sent: Wednesday, June 16, 2010 8:14 AM
To: Matplotlib
Subject: [Matplotlib-users] how to define custom colormap from set of RGB
values ?
Hello,
The attached script shows my
phob...@geosyntec.com wrote:
Give this a shot:
http://www.scipy.org/Cookbook/Matplotlib/Show_colormaps
Thanks for your reply.
Previously, I had tried something based on the second example at that
URL, but, after considerable time, I could only get a palette that was
close. I do not
You're not defining your dictionary in the way specified in the link. In fact,
I don't think you have a dictionary at all.
First, create a script that will map the range (0,1) to values in the RGB
spectrum. In this dictionary, you will have a series of tuples for each color
'red', 'green', and
As you can see from the error, the dimension of your input is wrong
(it needs to be transposed).
Furthermore, matplotlib expects the rgb values in 0-1.
replace
colormap = matplotlib.colors.ListedColormap(palette,'custom-orange')
with
colormap =
Did you check values in palette?
With
palette /= 255
you're setting the value in place. Because the palette.dtype is int,
the result is also an integer array, i.e., only with with zeros and
ones.
You may do
palette = [reds,greens,blues]
palette = numpy.array(palette, dtype=d)
Regards,
Hi,
Eamon Caddigan eamon.caddi...@gmail.com
The reason my initial attempts failed was because I (erroneously)
assumed that the default axis spanned (0, 0), (1, 1). Now I that I
know better, I can place an axis for each image in the right place and
everything looks fine.
However, I'm still
Hi,
is it helpful to write that both of you examples doesn't crash anything for me
(except the second only being able to be $killed)?
m...@eee:~$ uname -a
Linux eee 2.6.29-2-686 #1 SMP Sun May 17 17:56:29 UTC 2009 i686 GNU/Linux
m...@eee:~$ python --version
Python 2.5.5
Regards,
Malte
Pablo,
I found the example on the svn
http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/examples/mplot3d/surface3d_demo3.py?view=log
http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/examples/mplot3d/surface3d_demo3.py?view=log
it will
11 matches
Mail list logo