Michael Droettboom | 1 Jun 14:46

Re: computer modern

There's no easy way to do what you ask.  You can, however, use math mode 
to get to those characters in STIX.  For example, set mathtext.fontset 
to "stix" and then:

  r'$\mathcal{Caligraphic} \mathtt{Monospace}$'

Mike

Nicolas Pourcelot wrote:
> Thanks, it works well.
>
> However, I forgot that computer modern does not include accented 
> characters (unlike latin modern), so I eventually used Stix :
>
> mpl.rc('font', family = 'serif', serif = 'STIXGeneral')
>
> By the way, is there any way to use Stix for sans-serif as well, or 
> even cursive and monospace ? I don't know how to do that, since Stix 
> seems to contain all of them in a single file (STIXGeneral.ttf) ?
>
> Nicolas
>
>
> Michael Droettboom a écrit :
>> The name of the Computer Modern Roman font that ships with matplotlib 
>> is "cmr10", so
>>
>>   mpl.rc('font', family = 'serif', serif = 'cmr10')
>>
>> should work.
(Continue reading)

Michael Droettboom | 1 Jun 14:58

Re: display a path?

If your path has bezier curve segments, then, yes, PathPatch is the most 
direct method (see the dolphin.py example).  However, if you just need a 
series of line segments, then Polygon is probably much simpler for 
filling areas.

Mike

lucab wrote:
> i apologize in advance for what is undoubtedly a silly question, but, having
> looked through the coding examples and the forum i am still a little
> confused...
>
> am i correct in understanding that the only way to draw / display a path on
> an axes is by converting it to a PathPatch and adding that to the axes?
>
> ideally i would like to display a PathPatch as well as parts of the path
> that surround it. to do this i would like to show the PathPatch with no edge
> and then also show part of the path (with no fill).
>
> thanks in advance,
>
> lb
>   

--

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
(Continue reading)

Alexander Lamaison | 1 Jun 19:29
Picon

Non-X11 fallback on import

I have a script that uses matplotlib to plot graphs both displayed as
a GUI and as PDF documents.  The script may need to be run from remote
terminals without X11-passthrough so they way I would like it to work
is to use the default backend if X is available and, otherwise, fall
back to using the Agg backend.  How can I do this?

I've been trying to catch a RuntimeError and then retry with a
different backend but part of matplotlib remains loaded and won't let
me change backend:

try:
   import matplotlib.pyplot as plt
except RuntimeError:
   # retry import but without GUI capability
   import matplotlib
   plt.use('Agg')
   import matplotlib.pyplot as plt

Has anyone managed this?

Many thanks.

Alex

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
(Continue reading)

pgb205 | 1 Jun 20:08

Labeling X-axis with time data


et say i have two arrays
time_array=[00:00:00,00:00:10...17:59:50,18:00:00]
and
data_array=[1,12..34,2]
both of them with the same number of elements.
I want to graph data_array on y axis vs time_array on x_axis.
However, I'm unable to do this using matplotlib because it complains
time_array is not in numeric form.
I guess I should do plot=(data_array) and somehow mark the x axis with
time_array data at periodic intervals. Any suggestion on how to mark x-axis
with times?

thanks
--

-- 
View this message in context: http://www.nabble.com/Labeling-X-axis-with-time-data-tp23819363p23819363.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
Christopher Barker | 1 Jun 20:44
Picon
Favicon

Re: Non-X11 fallback on import

Alexander Lamaison wrote:
> I would like it to work
> is to use the default backend if X is available and, otherwise, fall
> back to using the Agg backend.  How can I do this?

I had a similar need a good while back with wxPython. I found some C 
code on the net that tries to connect to an X server and fails 
gracefully if it can't. I also wrote a Python wrapper around it. I 
haven't used it for years, and can't even find it on  my machine, but 
thanks to the glory of archives and google, here it is:

http://osdir.com/ml/python.wxpython/2004-03/msg00294.html

You'd use it like:

import matplotlib
import isX

if isX.isX:
     matplotlib.use("wxGTK") or whatever..
else:
     matplotlib.use("AGG")

note that you can also just check and see if the "DISPLAY" environment 
variable is set, but that won't be as reliable.

However, as the whole user interaction has to be totally different, I 
wonder if you can't just have a different start-up script depending on 
whether they want to run the GUI version or not.

(Continue reading)

Drain, Theodore R | 1 Jun 21:44
Picon
Picon
Favicon

Re: Non-X11 fallback on import

FYI I just went through this w/ an application of ours.  There is no easy way to handle this.  You can do this:

Display* disp = XOpenDisplay( 0 );
if ( ! disp )
{
   // no DISPLAY variable is set - no x connection
}

However, if the DISPLAY variable is set but doesn't point to a usable x-server (or it can't connect to the
x-server), this will actually call halt/exit inside the X library.  The X library has this coded as the
standard error behavior.  You can set a custom X11 IO error handler but it's kind of worthless because if the
error handler ever returns, the X11 library will exit.  The work around is to do a setjmp/longjump call in
the error handler.  

Here's the resulting code we use to check for a valid x-server connection.  We actually trap 3 different
conditions (success, no display, display but can't connect).  You modify this a little bit if you just
wanted to check for a valid display.

====================================
#include <X11/Xlib.h>
#include <setjmp.h>

static jmp_buf s_displayJumpBuf;

static int s_xIOhandler( Display* disp )
{
   // Jump back to the status function.
   longjmp( s_displayJumpBuf, 1 );
   return 0;
}
(Continue reading)

lucab | 1 Jun 22:11
Picon

Re: display a path?


Mike,

thanks so much for the response. my intent is to build compound paths that
(ideally) include bezier curve approximations to circle segments and
straight-line elements. the final output will most likely be an SVG file so
it would be nice to keep the beziers. but since i'm new to matplotlib, scipy
and python in general this may be trying to bite off more than i can chew.
;)

lb

Michael Droettboom-3 wrote:
> 
> If your path has bezier curve segments, then, yes, PathPatch is the most 
> direct method (see the dolphin.py example).  However, if you just need a 
> series of line segments, then Polygon is probably much simpler for 
> filling areas.
> 
> Mike
> 
> 

--

-- 
View this message in context: http://www.nabble.com/display-a-path--tp23805921p23820801.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
(Continue reading)

Kurt Forrester | 1 Jun 23:37
Picon

savefig behaviour with transparent patches


I am searched the mailing list and web without success with this problem. I am getting unexpected behaviour
when using savefig in the eps format.

The pdf renders the figure as it appears in the plot figure however the alpha for the patches is lost when
saving as eps (see code below).

Any help would be greatly appreciated.

Kind Regards,

Kurt

matplotlib '0.98.5.2'
python 2.6.2
ubuntu 9.04

#!/usr/bin/env python
# -*- coding: utf-8 -*-
from numpy import *
from pylab import plot, show, grid, xlabel, ylabel, axhspan, axvspan, savefig
from scipy.optimize import leastsq, fsolve

sample_day = array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,\
22,23,24,25,26,27,28,29,30,31])

sample_measurement = array([0,0,0,0,0,0,0,0.02190,0.04910,0.06540,0.08170,\
0.10930,0.13650,0.15850,0.20200,0.33320,0.52000,0.66110,0.78710,0.85250,\
0.89070,0.91270,0.92890,0.94560,0.96180,0.97280,0.97280,0.97810,0.97810,\
0.98370,0.98370,0.98370])
(Continue reading)

John Hunter | 1 Jun 23:54
Picon
Gravatar

Re: savefig behaviour with transparent patches

On Mon, Jun 1, 2009 at 4:37 PM, Kurt Forrester
<kurtforrester@...> wrote:
>
> I am searched the mailing list and web without success with this problem. I am getting unexpected
behaviour when using savefig in the eps format.

PS/EPS do not support alpha transparency.  This is not a limitation of
mpl, but of the format.  You will need to use SVG or PDF if you need a
vector output that supports transparency.

JDH

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
Xavier Gnata | 2 Jun 00:24
Picon
Gravatar

Re: x= / y= labels default format is wrong

John Hunter wrote:
> On Sat, May 30, 2009 at 6:46 PM, Eric Firing <efiring@...> wrote:
>
>   
>> Possible, but I think there is a much better solution along the lines I
>> suggested earlier.  I have it partly implemented.  To really do it right
>> will require a little bit of work on all the interactive backends; it might
>> be very little and very easy.  It prompted my question starting another
>> thread as to whether we can drop support for GTK < 2.4 so as to simplify
>> that backend.
>>     
>
> Sorry I forgot to answer -- I answered you in my mind <wink>.  While I
> am never in favor of dropping support for l packages just because they
> are old, if they are impeding adding good functionality because it is
> too difficult to code/test against too many interfaces, then by all
> means yes, we can drop <2.4.  I thnk we could safely drop <2.6.
>
> JDH
>   

Please do so.

Xavier

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
(Continue reading)


Gmane