[Matplotlib-users] Reading a remote JPG URL using imread

2012-10-19 Thread Rich Signell
MPL folks, Would it be possible to enhance Matplotlib to allow im=imread(url) to work if url returns a JPG? Currently (it seems): 1. If the URL returns a PNG this works: im = imread(urllib2.urlopen(url)) 2. If the URL returns a JPG, this DOESN'T work: im = imread(urllib2.urlopen(url)) ..

Re: [Matplotlib-users] dpi

2012-10-19 Thread Pierre Haessig
Hi, Le 19/10/2012 06:48, Jae-Joon Lee a écrit : Figuring out the dpi of the screen, I have no clue at this moment. Maybe this is something a gui expert can answer. I'm certainly not a gui expert, but as a PyQt user, I know screen resolution is indeed Python-accessible with PyQt. (I guess other

Re: [Matplotlib-users] Reading a remote JPG URL using imread

2012-10-19 Thread Phil Elson
Good idea. If the png version works then the jpg version should also be made to work, Would you be willing to open up an issue for the feature request? : https://github.com/matplotlib/matplotlib/issues/new If your ready and willing to implement such a thing, that would be even better (just open

[Matplotlib-users] plot with marker color coded according to z-value

2012-10-19 Thread elmar werling
Hi, is there a way to adjust the marker color in a xy-plot in relation to the value of a third parameter. Something as the following - not working - example 1. Example 2 is working but rather slow for large arrays. cheers Elmar # example 1 import matplotlib.pyplot as plt x = [1,2,3,4] y

Re: [Matplotlib-users] plot with marker color coded according to z-value

2012-10-19 Thread Joe Kington
That's what ``scatter`` is intended for. Basically, you want something like: plt.scatter(x, y, c=z, marker='s') plt.colorbar() Note that you can also vary the markers by size based on an additional parameter, as well. Have a look at this example:

Re: [Matplotlib-users] plot with marker color coded according to z-value

2012-10-19 Thread elmar werling
thanks for help, finally I found the following solution elmar import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt N = 200 x = np.linspace(0,1,N) y = np.random.randn(N) z = np.random.randn(N)*2+5 cm = mpl.cm.get_cmap('RdYlBu') sc = plt.scatter(x, y, c=z, vmin=min(z),

Re: [Matplotlib-users] plot with marker color coded according to z-value

2012-10-19 Thread Daπid
On Fri, Oct 19, 2012 at 11:08 PM, elmar werling el...@net4werling.de wrote: vmin=min(z), vmax=max(z) A suggestion, when dealing with arrays, it is generally faster to use the numpy function to compute the max and min, either np.max(z) or z.max(), than the standard Python one.

Re: [Matplotlib-users] plot with marker color coded according to z-value

2012-10-19 Thread Damon McDougall
On Fri, Oct 19, 2012 at 10:23 PM, Daπid davidmen...@gmail.com wrote: On Fri, Oct 19, 2012 at 11:08 PM, elmar werling el...@net4werling.de wrote: vmin=min(z), vmax=max(z) A suggestion, when dealing with arrays, it is generally faster to use the numpy function to compute the max and min, either

Re: [Matplotlib-users] plot with marker color coded according to z-value

2012-10-19 Thread elmar werling
Am 19.10.2012 23:26, schrieb Damon McDougall: Correct me if I'm wrong, but I don't even think you need them. I think the default cmap behaviour is to normalise to the min and max of the data. yes, default cmap behaviour will normalise to the min and max of the data.