[Matplotlib-users] how to save pseudo-colorized images as 8-bit PNG files

2010-07-22 Thread Jim Vickroy
Hello, Apologies for reposting my question from yesterday (save image as color-mapped 8-bit rather than true-color). I am hoping this reposting clarifies what I am trying to accomplish. The attachment is a simple script that creates a 2D array of unsigned, 8-bit integers and uses

Re: [Matplotlib-users] progress bar?

2010-06-28 Thread Jim Vickroy
Carlos Grohmann wrote: I've been searching but coudn't find any example on how to add a progress bar to a wxpython+matplotlib app. I'd like my app to show a progress bar while some gridding and contouring are being done. this is the code I'm using (without preogress bar) funcs = {Natural

[Matplotlib-users] how to define custom colormap from set of RGB values ?

2010-06-16 Thread Jim Vickroy
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?

Re: [Matplotlib-users] how to define custom colormap from set of RGB values ?

2010-06-16 Thread Jim Vickroy
not understand how to use that example to replicate an IDL color map. The requirement is for me to exactly duplicate the IDL color map (actually several IDL color maps) listed in my script. -- jv *From:* Jim Vickroy [mailto:jim.vick...@noaa.gov] *Sent:* Wednesday, June 16, 2010 8:14 AM

Re: [Matplotlib-users] Question?

2010-06-08 Thread Jim Vickroy
Waléria Antunes David wrote: Hello!!! My name is Waleria. I work at INPE in Sao Jose dos Campos, Brazil. And I'd like to make a question. I'm in trouble to generate a two functions graph. I have a problem to generate a graph of the two functions. I have this functions, is bellow: *y1 =

[Matplotlib-users] how to display data with a fixed color scale ?

2010-06-03 Thread Jim Vickroy
I want to generate a 2-d figure with a (fixed) color scale that does not vary with the range of the data being plotted. How do I do this? Attempts to specify vimin and vmax appear to be ignored. The following example: #code import numpy data = numpy.zeros(shape=(240,240),dtype=int) data[

Re: [Matplotlib-users] how to display data with a fixed color scale ?

2010-06-03 Thread Jim Vickroy
Jae-Joon Lee wrote: On Thu, Jun 3, 2010 at 4:00 PM, Jim Vickroy jim.vick...@noaa.gov wrote: How do I do this? Attempts to specify vimin and vmax appear to be ignored. Hmm, vmin and vmax should work. cax= ax.imshow(data, interpolation='bilinear', vmin=-1, vmax=1

Re: [Matplotlib-users] how to display data with a fixed color scale ?

2010-06-03 Thread Jim Vickroy
Eric Firing wrote: On 06/03/2010 10:00 AM, Jim Vickroy wrote: I want to generate a 2-d figure with a (fixed) color scale that does not vary with the range of the data being plotted. How do I do this? Attempts to specify vimin and vmax appear to be ignored. The following example: #code

Re: [Matplotlib-users] how to display data with a fixed color scale ?

2010-06-03 Thread Jim Vickroy
OK, upon a more careful review of the code, I made a simple(-minded) error. Specifying vmin and vmax do work (as everyone already knew). Thanks to Jae-Joon and Eric for their quick replies. and valuable suggestions. -- jv Jim Vickroy wrote: I want to generate a 2-d figure with a (fixed

Re: [Matplotlib-users] How to make colormaps

2010-04-20 Thread Jim Vickroy
Nikolaus Rath wrote: Hello, Maybe my googling skills are deficient, but I wasn't able to find any information on how to define my own colormap. Can someone give me a pointer, or a basic example how to create a simple map that e.g. maps -1 to Red, 0 to White, and 1 to Blue? Thanks,

Re: [Matplotlib-users] How to make colormaps

2010-04-20 Thread Jim Vickroy
Ryan May wrote: On Tue, Apr 20, 2010 at 11:40 AM, Jim Vickroy jim.vick...@noaa.gov wrote: Nikolaus Rath wrote: Hello, Maybe my googling skills are deficient, but I wasn't able to find any information on how to define my own colormap. Can someone give me a pointer, or a basic example how

Re: [Matplotlib-users] Put many graphs on the same plot.

2010-03-24 Thread Jim Vickroy
david.kremer...@gmail.com wrote: Hello. I would like to know, please, how you can add graphics on a same plot. eg : superpose sine and cosine graphs on the same plot. Thank you very much. -- Download Intel#174;

Re: [Matplotlib-users] how to reduce width of figure border ?

2010-03-12 Thread Jim Vickroy
Pierre de Buyl wrote: change line 29 to: left, bottom, width, height = 0.1, 0.07, 1., 0.84 # values in 0-1 relative figure coordinates -- allow space on left for colorbar it works on my machine (python 2.5 and mpl 0.99, mac os X 10.4). Pierre Le 11 mars 10 à 23:36, Jim Vickroy a écrit

Re: [Matplotlib-users] Bug: string.letters

2010-03-09 Thread Jim Vickroy
Enssle Carl Philipp wrote: Hallo. When importing string in python, letters are defined as follows: import string string.letters 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' ... whereas when importing matplotlib, the order of letters seems to be changed: import

[Matplotlib-users] colorbar on LEFT side of figure ?

2010-03-04 Thread Jim Vickroy
Hi, I have been unable to place a colorbar on the LEFT side of a figure. For example, in the Gaussian noise with vertical colorbar http://matplotlib.sourceforge.net/examples/pylab_examples/colorbar_tick_labelling_demo.html demo, how can the colorbar be positioned on the left side of the

Re: [Matplotlib-users] configuring colorbar labels on a black background

2010-02-24 Thread Jim Vickroy
for the explanation and alternative which works just fine! As per your suggestion, I have submitted a trouble report (2957923). entitled: set_yticklabels(labels, color='white') ignored -- jv On Tue, Feb 23, 2010 at 11:03 AM, Jim Vickroy jim.vick...@noaa.gov wrote: Hello, I'm (unsuccessfully) trying

[Matplotlib-users] configuring colorbar labels on a black background

2010-02-23 Thread Jim Vickroy
Hello, I'm (unsuccessfully) trying to generate a figure (with a labeled colorbar) having a black background. Here is the code. _purpose_ = 'demonstrate capability to create PNG with black background including labeled color bar' _author_ = 'jim.vick...@noaa.gov' import numpy #

Re: [Matplotlib-users] A second copy of a figure

2010-02-23 Thread Jim Vickroy
Bruce Ford wrote: I'm needing to keep two copies of a figure, with the properties different on one copy. However with logic like below, both copies remain the same regardless: #I want one copy with the defaul background and one to be transparent... imgname = GenFilename(20)+.png

Re: [Matplotlib-users] pylab quick reference? (

2009-04-23 Thread Jim Vickroy
Esmail wrote: Selam to you too Gökhan, Gökhan SEVER wrote: What I recommend you is: watching John Hunter's video at Matplotlib by John D. Hunter http://videolectures.net/mloss08_hunter_mat/. His introduction of matplotlib and examples he use could be very interesting to watch for you.

[Matplotlib-users] matplotlib.pyplot.pcolor and matplotlib.pyplot.savefig unexpectedly slow

2009-04-13 Thread Jim Vickroy
Hello all, I am a matplotlib novice so I expect I am doing something inappropriate. From the attached script (matplotlib-slow.py), it will be seen that I am creating a 512x512 (numpy) array and using matplotlib to plot it. Below is the script output on my Microsoft Windows XP (service pack

Re: [Matplotlib-users] matplotlib.pyplot.pcolor and matplotlib.pyplot.savefig unexpectedly slow

2009-04-13 Thread Jim Vickroy
-- an amazing difference! Thanks very much for your quick response! -- jv -JJ On Mon, Apr 13, 2009 at 10:54 AM, Jim Vickroy jim.vick...@noaa.gov wrote: Hello all, I am a matplotlib novice so I expect I am doing something inappropriate. From the attached script (matplotlib-slow.py

Re: [Matplotlib-users] can any windows 0.91.2 user reproduce this bug?

2008-03-25 Thread Jim Vickroy
Mark Bakker wrote: Thanks to Fred, Chris, and JV for reproducing this bug. We all get the same eps file, that doesn't show the greek symbols produced with mathtext. And we all do get correct results on the screen (using Tk) and in pdf and png files. I loaded the *eps* file in Adobe Photoshop

[Matplotlib-users] day-night terminator and/or solar zenith angle code ?

2008-02-13 Thread Jim Vickroy
Hello all, Could someone offer suggestions for (preferably) python code to compute: * day/night terminator position * solar zenith angle I'm developing a basemap application that is required to hide contour data in the night regions of the earth. The projections will be Mercator and

[Matplotlib-users] RuntimeError: Buffer lengths not the same

2008-02-08 Thread Jim Vickroy
Hello everyone, I do not understand why the attached script fails one of my assertion checks. I do not seem to understand pylab.meshgrid and numpy arrays. I looked at contour_demo.py in the basemap examples, but I have somehow missed my mistake. Could someone elaborate. Thanks, -- jv

Re: [Matplotlib-users] Error when using TkAgg backend

2008-01-31 Thread Jim Vickroy
Michael Biester wrote: Hi, I use matplotlib frequenctly on Python 2.4.x. . Recently changed to Python 2.5.1 (upgraded to numpy 1.0.4, matplotlib 0.91.2, scipy 0.6). The Tkinter graphics does not work anymore. I tried the code snippet below and got a blank window and message box:

Re: [Matplotlib-users] setting non-basic dashes

2008-01-31 Thread Jim Vickroy
John Prince wrote: First off, thanks for matplotlib. It really is amazing. I can't seem to figure out an acceptable sequence of dashes per the documentation: 'dashes: sequence of on/off ink in points' This is what I'm trying: mydashes = ['- ', '--', '- ', '--', '- '] lines =

Re: [Matplotlib-users] matplotlib.toolkits.basemap. Basemap overlays?

2008-01-23 Thread Jim Vickroy
Jeff Whitaker wrote: Jim Vickroy wrote: Hello users, I'm using matplotlib.toolkits.basemap.Basemap to plot data on several types of projections at a regular cadence. I am presently regenerating the maps each time new data is to be plotted. Is it possible to generate template map