Re: [Matplotlib-users] can't use custom color maps

2009-09-27 Thread Eric Firing
Dr. Phillip M. Feldman wrote: > I'd like to be able to create and use a custom colormap. I'm creating the > colormap via > the following statement: > > matplotlib.colors.ListedColormap([(0,0,0),(0.6,0,0),(0,0.6,0),(0.6,0.6,0)], > name='Earth') Assign it to a variable, like earth_cmap = matplo

Re: [Matplotlib-users] Hiding data via legend

2009-09-27 Thread butterw
Hi, thank you for clearing that up. Some feedback: If plotting a line2D as discrete points rather than a continuous line, you must use numpoints=2 for the legend picking to actually occur on the points. The alpha blending doesn't work on the legend symbols however. Is there any other way, I

[Matplotlib-users] stacked bar graphs not appearing correctly

2009-09-27 Thread per freem
hi all, i am trying to make a simple stacked bar graphs (just two layers) and am getting some strange results. i have the following code: import numpy as np import matplotlib.pyplot as plt ind = np.arange(3) width = 0.35 plt.bar(ind, [5128307, 4305252, 4817425], width, align='center', color='r')

[Matplotlib-users] Simplified version of double-axis time example (beta)

2009-09-27 Thread Gökhan Sever
Hello, As was suggested by Jae-Joon, I have simplified the code for easier investigation and run. The aim of the script is to have time represented on both bottom and top x-axes, on the bottom in seconds-from-midnight (SFM), and the top should show as HH:MM:SS, while there is two different data so

Re: [Matplotlib-users] can't use custom color maps

2009-09-27 Thread Phillip M. Feldman
Thanks very much for the help. I have made some progress, but am still having difficulties. I wrote a function called make_solid_cmap (see test program below) that takes a colormap name, a list of thresholds, and a list of colors as inputs, and produces and registers a solid-color colormap. In

Re: [Matplotlib-users] Simplified version of double-axis time example (beta)

2009-09-27 Thread Jae-Joon Lee
Here is the modified version of your code that works for me. 1) If you change trans_aux, you also need to plot your data in an appropriate coordinate. Your original code did not work because you scaled the xaxis of the second axes (par) but you were still plotting the original data, i.e., "time" n

Re: [Matplotlib-users] stacked bar graphs not appearing correctly

2009-09-27 Thread Jae-Joon Lee
http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.bar The second argument is the heights of the bars, not the top coordinate. -JJ On Sun, Sep 27, 2009 at 11:29 AM, per freem wrote: > hi all, > > i am trying to make a simple stacked bar graphs (just two layers) and > am ge

Re: [Matplotlib-users] Two questions...

2009-09-27 Thread Jae-Joon Lee
I hope my answer in the other thread clears your problem. One note, I found that some grid lines are missing at first run. This can be fixed by using "host.xaxis.get_major_ticks()" instead of "host.xaxis.majorTicks" (same for yaxis). -JJ On Sun, Sep 27, 2009 at 2:22 AM, Gökhan Sever wrote: >

Re: [Matplotlib-users] Simplified version of double-axis time example (beta)

2009-09-27 Thread Gökhan Sever
JJ, Could you please re-attach the code? Apparently, it has been forgotten on your reply. Thanks. On Sun, Sep 27, 2009 at 1:50 PM, Jae-Joon Lee wrote: > Here is the modified version of your code that works for me. > > 1) If you change trans_aux, you also need to plot your data in an > appropri

Re: [Matplotlib-users] Simplified version of double-axis time example (beta)

2009-09-27 Thread Jae-Joon Lee
Here it is. -JJ On Sun, Sep 27, 2009 at 3:09 PM, Gökhan Sever wrote: > JJ, > > Could you please re-attach the code? Apparently, it has been forgotten on > your reply. > > Thanks. > > On Sun, Sep 27, 2009 at 1:50 PM, Jae-Joon Lee wrote: >> >> Here is the modified version of your code that works

Re: [Matplotlib-users] Hiding data via legend

2009-09-27 Thread Jae-Joon Lee
On Sun, Sep 27, 2009 at 10:02 AM, butterw wrote: > > Hi, > > thank you for clearing that up. > > > Some feedback: If plotting a line2D as discrete points rather than a > continuous line, you must use numpoints=2 for the legend picking to actually > occur on the points. The alpha blending doesn't w

Re: [Matplotlib-users] Gradient color on a line object

2009-09-27 Thread Jae-Joon Lee
Take a look at the examples/pylab_examples/demo_agg_filter.py Attached is a simple example that shows a line with gradient. However, the current image filter does not know about the data coordinate of the input image. Therefore, if you want to have your gradient stops at certain data values, you n

Re: [Matplotlib-users] Simplified version of double-axis time example (beta)

2009-09-27 Thread Gökhan Sever
When I run this as it is, and zoom once the top x-axis ticklabels disappear: http://img2.imageshack.us/img2/5493/zoom1.png After commenting these three lines: #locator= MinuteLocator(interval=1) #locator= SecondLocator(interval=30) #par2.xaxis.set_major_locator(locator) and running I get

Re: [Matplotlib-users] Gradient color on a line object

2009-09-27 Thread Gökhan Sever
On Sun, Sep 27, 2009 at 3:04 PM, Jae-Joon Lee wrote: > Take a look at the examples/pylab_examples/demo_agg_filter.py > > Attached is a simple example that shows a line with gradient. > However, the current image filter does not know about the data > coordinate of the input image. Therefore, if yo

Re: [Matplotlib-users] Hiding data via legend

2009-09-27 Thread Peter Butterworth
On Sun, Sep 27, 2009 at 9:31 PM, Jae-Joon Lee wrote: >> Some feedback: If plotting a line2D as discrete points rather than a >> continuous line, you must use numpoints=2 for the legend picking to actually >> occur on the points. The alpha blending doesn't work on the legend symbols >> however. >>

Re: [Matplotlib-users] Simplified version of double-axis time example (beta)

2009-09-27 Thread Jae-Joon Lee
On Sun, Sep 27, 2009 at 4:18 PM, Gökhan Sever wrote: > When I run this as it is, and zoom once the top x-axis ticklabels disappear: > http://img2.imageshack.us/img2/5493/zoom1.png > > After commenting these three lines: > > #locator    = MinuteLocator(interval=1) > #locator    = SecondLocator(inte

Re: [Matplotlib-users] Hiding data via legend

2009-09-27 Thread John Hunter
On Sun, Sep 27, 2009 at 3:45 PM, Peter Butterworth wrote: > On Sun, Sep 27, 2009 at 9:31 PM, Jae-Joon Lee wrote: >>> Some feedback: If plotting a line2D as discrete points rather than a >>> continuous line, you must use numpoints=2 for the legend picking to actually >>> occur on the points. The a

Re: [Matplotlib-users] Simplified version of double-axis time example (beta)

2009-09-27 Thread Gökhan Sever
On Sun, Sep 27, 2009 at 7:44 PM, Jae-Joon Lee wrote: > On Sun, Sep 27, 2009 at 4:18 PM, Gökhan Sever > wrote: > > When I run this as it is, and zoom once the top x-axis ticklabels > disappear: > > http://img2.imageshack.us/img2/5493/zoom1.png > > > > After commenting these three lines: > > > > #