Phillip M. Feldman wrote:
> Jeff Whitaker wrote:
>> Dr. Phillip M. Feldman wrote:
>>> The attached program generates a map and then saves it to a file. I
>>> have two
>>> problems with the result:
>>>
>>> (1) Note that the screenshot shows a title above the map, while the
>>> .png
>>> file that was saved by the program does not.
>>>
>> Philip:
>>
>> mapdemo.jpeg (which was presumably created from the png saved by your
>> program) is totally empty.
>>> (2) I would like to be able to label the lines of latitude and
>>> longitude,
>>> but have not been able to figure out how to do this.
>>>
>>
>> use the label keyword to drawmeridians and drawparallels.
>>
>> -Jeff
>>
> Hello Jeff,
>
> I had tried that, but thought that it wasn't working because I wasn't
> seeing anything on the screen. I now think that the label parameter
> must be working, because the lines of latitude and longitude are
> labeled in the version of the map that is saved by the program, and
> that I'm not seeing them on the screen because I have black text on a
> black background. Is there a way to control the color of the text
> labels? Note also that the plot title appears on the screen shot
> jpeg, but not in the version saved by the program. Any advice will be
> appreciated.
>
> Philllip
Philip: To change the color of the lat/lon lines, use the color keyword
in drawparallels and drawmeridians (i.e. color="red"). To change the
font color for the labels, use fontdict=dict(color='red'). The plot
title color can be changed in the same way.
-Jeff
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------
>
--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg

Jeff Whitaker wrote:
> Dr. Phillip M. Feldman wrote:
>> The attached program generates a map and then saves it to a file. I
>> have two
>> problems with the result:
>>
>> (1) Note that the screenshot shows a title above the map, while the .png
>> file that was saved by the program does not.
>>
> Philip:
>
> mapdemo.jpeg (which was presumably created from the png saved by your
> program) is totally empty.
>> (2) I would like to be able to label the lines of latitude and
>> longitude,
>> but have not been able to figure out how to do this.
>>
>
> use the label keyword to drawmeridians and drawparallels.
>
> -Jeff
>
Hello Jeff,
I had tried that, but thought that it wasn't working because I wasn't
seeing anything on the screen. I now think that the label parameter
must be working, because the lines of latitude and longitude are labeled
in the version of the map that is saved by the program, and that I'm not
seeing them on the screen because I have black text on a black
background. Is there a way to control the color of the text labels?
Note also that the plot title appears on the screen shot jpeg, but not
in the version saved by the program. Any advice will be appreciated.
Philllip

Hello,
I'm trying to make a log plot using set_xscale and set_yscale. The default LogFormatter however shows 10^-1, 10^0, and 10^1 rather than 0.1, 1, and 10 (other plotting packages I've used usually automatically substitute these three common labels). Is there a way that the LogFormatter could have an extra option for basically enabling this (or even better, that this be made the default, with an option to disable - I don't see most people wanting 1 shown as 10^0)?
Cheers,
Thomas

Dr. Phillip M. Feldman wrote:
> The attached program generates a map and then saves it to a file. I have two
> problems with the result:
>
> (1) Note that the screenshot shows a title above the map, while the .png
> file that was saved by the program does not.
>
Philip:
mapdemo.jpeg (which was presumably created from the png saved by your
program) is totally empty.
> (2) I would like to be able to label the lines of latitude and longitude,
> but have not been able to figure out how to do this.
>
use the label keyword to drawmeridians and drawparallels.
-Jeff
> Thanks!
>
> Phillip
>
> http://old.nabble.com/file/p27313185/mapdemo.py mapdemo.py
> http://old.nabble.com/file/p27313185/mapdemo%2Bscreenshot.jpeg
> http://old.nabble.com/file/p27313185/mapdemo.jpeg
>
>
--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg

Gökhan Sever wrote:
> Hello,
>
> I have thought of this might interesting to share. Register at
> http://www.sagenb.org or try on your local Sage-notebook and using the following
> code:
>
>
A related example that lets you get the actual matplotlib figure from a
Sage graphic and play with it is here:
http://sagenb.org/home/pub/1413/
The thing we'd like to do now is be able to wrap matplotlib axes with
Sage Graphics objects (so someone can construct a matplotlib object and
then wrap it in a Sage Graphics instance to then do further stuff with
it in Sage). However, I think we need to resolve the issues involving
taking the axes from one figure and adding them to another figure; these
issues were brought up on the mailing list a while ago.
Thanks,
Jason
--
Jason Grout
jason.grout@...

On Mon, Jan 25, 2010 at 9:14 AM, Dimitri Linten
<dimitri.linten@...> wrote:
> What is the best way to do this ?
Please explain what you want and what your issue is.
Do not expect us (developers or other users) to study your code. If
possible, post a small stand-alone example that others can simply run.
As far as the watermark is concerned, the easiest way is to use
figimage as John suggested, but apparently this is not what you want.
The svn version of matplotlib has OffsetImage and AnnotationBox, which
could be helpful.
Regards,
-JJ

Hi Gökhan,
I just wanted to discuss the key, because I think this patch should be part of
matplotlib and not only of individual users. I think it is worth be be added
to the mpl-tracker at http://sourceforge.net/tracker/?group_id=80706 or maybe
one of the developers has the time to commit this small change?
I think your idea about key-mappings in the matplotlib-rc is a good option to
customize keyboard short cuts and even remove short-cuts which aren't of
intrest for the individual user. Furthermore the latter yields space for
keyboard shortcuts, which are used in one's own program.
Kind regards,
Matthias
On Friday 22 January 2010 16:57:22 Gökhan Sever wrote:
> It is very simple to change key-assignment. Take a look at the
> backend_bases.py code (search for event.key instances) :
>
> elif event.key == 'L':
>
> I was thinking to move y-scaling to "y" and x-scaling to "x" but x and y
> are assigned to something else (
> http://matplotlib.sourceforge.net/users/navigation_toolbar.html)
>
> For me toggling "k" is simpler for me than doing Shift-L.
>
> Maybe these options could be provided in the matplotlibrc file. Users can
> make their key mapping based on their choice. That requires some more
> coding
>
> :)
>
> On Fri, Jan 22, 2010 at 1:59 AM, Matthias Michler
>
> <MatthiasMichler@...>wrote:
> > Hi Gökhan, Hi list members,
> >
> > This is really a missing feature in matplotlib in my opinion and it's
> > great that you took the time to make an suggestion, but I would prefer
> > capital "L"
> > for the xaxis-scaling like gnuplot although I'm not sure this is
> > possible.
> >
> > What do you and other list members think about that?
> >
> > Kind regards,
> > Matthias
> >
> > On Thursday 21 January 2010 19:45:37 Gökhan Sever wrote:
> > > Hello,
> > >
> > > "l" key does the log - linear scaling for y-axis. I have made a minor
> > > change to use "k" for x-axis scaling.
> > >
> > > Patch added. Feel free to add if you find it useful.

Hi Jeff,
you can do something like the following and specify the color for each bar by
providing a list of colors for the keyword argument 'color'.
import numpy as np
import matplotlib.pyplot as plt
# generate some data
left = np.arange(6)
height = np.random.uniform(size=6)
# plot 3 blue and 3 red bars:
plt.bar(left, height, color=['blue']*3+ ['red']*3)
plt.show()
You second way could be provided by the color list
['red', '0.5']*3 = ['red', '0.5', 'red', '0.5', 'red', '0.5']
Kind regards,
Matthias
On Saturday 23 January 2010 16:36:36 Jeff Layton wrote:
> Good morning,
>
> I hate to ask such a newbie question but I am a newb with matplotlib :)
>
> I want to create a bar chart with, for example, 6 "bars". I want the first
> 3 bars to be one color and the second 3 bars to be another color. I'm
> not entirely sure how to do this - any suggestions?
>
> Alternatively, I would like to create 6 bars where every other bar is
> a different color. For example, gray, red, gray, red, gray, red. Any
> suggestions on this?
>
> TIA!
>
> Jeff

Dear listmembers,
I experienced a problem with matplotlib yesterday that caused me a lot of
headache and I don't know whether this is a bug or if I forgot something.
What I want is to plot different datasets in different plots in different
files. My code looks like that:
#######################
from pylab import fft, ifft, var, average, real, show
import matplotlib.pyplot as plt
def process_file(filename, fig_nr):
plt.figure(fig_nr)
plt.clf()
plt.subplot(211)
plt.plot(s, alt, '-')
plt.subplot(212)
plt.plot(s,map(lambda x: x*3.6,speed))
plt.savefig(filename+".png")
process_file("foo1.tcx", 1)
process_file("foo2.tcx", 2)
process_file("foo3.tcx",3)
##########################
The problem here is that in the plots for file foo2 the data from foo1 is
included, in the plots for foo3 the data of foo1 and foo2.
I thought that I paid respect to this behaviour with plt.figure(), on
stackoverflow I read about the plt.clf() - thing but nothing happened. I tried
to make fig_nr a hash over the filename or leave it blank (like suggested in
the documentation) but this had no effect and I ended up with the additional
parameter (fig_nr in the example above) which also did not work.
Is this maybe a bug or did I forget an important thing?
I'm running Debian sid with python-matplotlib 0.99.1.2-2 (I hope the numbering
from Debian and matplotlib is similar).
Best regards,
Philipp Bender

Jeff Whitaker wrote:
> Dr. Phillip M. Feldman wrote:
>> Jeff Whitaker wrote:
>>
>>> <snip>
>>> Philip: That's an error from the proj4 c library saying that it
>>> didn't like one of the parameters you used to define the
>>> projection. Since you didn't include the parameters you used, I
>>> can't say which one is the culprit.
>>>
>>> -Jeff
>>>
>>>
>>
>>
> Philip: I believe that lat_0 must be zero for the geostationary
> projection (you have to be looking down on the equator). I usually
> leave the lat_0 parameter off entirely, in which case zero is
> assumed. I'll try to catch that and raise a more insightful error
> message.
>
> -Jeff
>
Hm. I suppose that you are right. "Geostationary" does imply that the
viewer is 35786.2 km above the equator.
What would be more useful is a geosynchronous projection. This would
allow the viewer to be located at any latitude. Geostationary is a
special case of geosynchronous.
Even more useful than a geosynchronous projection is a camera projection
that allows one to place the viewer at any location in space (i.e., any
latitude and longitude for the nadir point, and any altitude). (I wrote
something like this is Fortran 25 years ago). Generalizing the existing
geostationary projection to turn it into a camera projection would make
it far more useful. I hope that someone will consider making this change.
Phillip

Dr. Phillip M. Feldman wrote:
> Jeff Whitaker wrote:
>
>> <snip>
>> Philip: That's an error from the proj4 c library saying that it didn't
>> like one of the parameters you used to define the projection. Since you
>> didn't include the parameters you used, I can't say which one is the
>> culprit.
>>
>> -Jeff
>>
>>
>
>
Philip: I believe that lat_0 must be zero for the geostationary
projection (you have to be looking down on the equator). I usually
leave the lat_0 parameter off entirely, in which case zero is assumed.
I'll try to catch that and raise a more insightful error message.
-Jeff