SourceForge logo
SourceForge logo
Menu

matplotlib-users

From: paulo <phe...@eo...> - 2004年03月25日 19:09:46
Hi,
I am simulating the movement of some particles that carry some
concentration of different species. Those concentrations change in time
and space and I would like to be able to see their distribution in
space. 
I am using the scatter plot of Matplotlib to plot the position of each
particle. That works great, but when I try to assign different colors to
each dot according to their concentration I find some problems. Although
there is a big range of concentrations (colors) I can only see two in
the plot. Is it possible to define more intervals to assign the colors?
I think I did not understand the right way to define the c array
intensities when I use the command: 
scatter(self, x, y, s=None, c)
How should I generate that array? I looked at the example but I couldn't
figure it out.
Thanks for your help,
I look forward to see the future versions of Matplotlib. So far, it
looks very good.
Paulo.
From: John H. <jdh...@ac...> - 2004年03月26日 03:28:02
>>>>> "paulo" == paulo <phe...@eo...> writes:
 paulo> I am using the scatter plot of Matplotlib to plot the
 paulo> position of each particle. That works great, but when I try
 paulo> to assign different colors to each dot according to their
 paulo> concentration I find some problems. Although there is a big
 paulo> range of concentrations (colors) I can only see two in the
 paulo> plot. Is it possible to define more intervals to assign the
 paulo> colors? I think I did not understand the right way to
 paulo> define the c array intensities when I use the command:
 paulo> scatter(self, x, y, s=None, c) How should I generate that
 paulo> array? I looked at the example but I couldn't figure it
 paulo> out.
Hi Paulo,
It would help to see some code to let you know why your current
approach isn't working. For now, all I can say is that c should be a
len(x) Numeric array of concentrations. It might help for you to do
 hist(c, 100) 
to look at the distribution of concentrations. If the distribution is
bimodal and strongly peaked, this may explain why you only see two
colors.
As for your question about defining more colors, the default is to use
a colormap of 1000 colors, which should be an ample number to see a
range unless something funny is going on with your c array.
When you post some code, also post the first few entries of c, eg
c[:10].
JDH
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /