[Matplotlib-users] Publish to HTML

2009-12-03 Thread David Arnold
All.

I see the Sphinx tutorial Sampledoc on the Matplotlib site and am  
working through the tutorial. This semester, my students have really  
enjoyed using Matlab's publish to HTML tool, then they upload the  
resulting files to their Drop Box on our Sakai course management system.

I am wondering if Sampledoc type files can be used for this same  
purpose. Is there a way you can gather the output html and upload them  
to our Sakai drop boxes?

David Arnold
College of the Redwoods

--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How to display axis numbers inside the figure area

2009-12-03 Thread Pekeika


Matthias,

And I saw your code now :) and it pretty much looks like mine, with some
more or less formatting. Attached is one of my figures where you can see my
result!
http://old.nabble.com/file/p26634326/Spill%2BVerification%2Bof%2Btwenty%252C%2Bhigh%2Bu%2Bagain%2Bafter%2Bchange%2Bpredicted%2Bat%2Btime%2B7.79%2Bdays.jpeg
 
-- 
View this message in context: 
http://old.nabble.com/How-to-display-axis-numbers-inside-the-figure-area-tp26578109p26634326.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How to display axis numbers inside the figure area

2009-12-03 Thread Pekeika

Matthias,

Thanks for answering. I already solved my problem. I found that there is no
function to display on grids the value of the axis (bad when you need to
display lat, longitude)... so I made it myself using the text() function and
using yticks() and xticks() along with all the formatting properties, all
inside of the text function...

Its pretty nice now,
Angelica.


-- 
View this message in context: 
http://old.nabble.com/How-to-display-axis-numbers-inside-the-figure-area-tp26578109p26634238.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Plotting curves filled with nonuniform color patch

2009-12-03 Thread Tony S Yu

On Dec 3, 2009, at 3:58 PM, Jae-Joon Lee wrote:

> line 1486 of _backend_agg.cpp says
> 
>  /* TODO: Support clip paths */
> 
> So, it seems that, apparently, clipping with arbitrary path has not
> been implemented yet for gouraud shading (pcolormesh will be properly
> clipped if shading is not used).
> I hope Michael pick this up some time soon.
> 
> Meanwhile, you may open a feature request ticket on this.
> 
> Regards,
> 
> -JJ


Hey Jae-Joon,

Thanks for digging into this. Feature request added.

By the way, I was looking through the feature requests and noticed an open 
feature request (ID: 2112292) that was satisfied by the addition of spines in 
the last major release. Just an FYI, if someone with privileges wants to close 
the request.

Thanks,
-Tony
--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] AxesGrid problem.

2009-12-03 Thread Jae-Joon Lee
On Thu, Dec 3, 2009 at 3:40 PM, Ryan Neve  wrote:

>
> I tried all sorts of things, but finally, by setting aspect=False I got it
> to work. In the documentation, the table says this defaults to True and the
> explanation of aspect below says it defaults to False. Although I don't
> entirely understand what is going on, I think this threw me off.
> So then I had this:
>

Can you be more specific about which documentation says the default aspect
is False? This may need to be fixed. Note that AxesGrid is designed
for displaying images with aspect=True. Otherwise, you may better stick to
the subplot..




> [image: 84Kna.png]
> ... which looks much better, except that there are two sets of x and y axis
> labels? This seems to have something to do with the colorbar. I've got:
>
>
To me, there is another axes underneath the AxesGrid. It is hard to tell
without a complete code.



> label_mode = "L",
> cbar_location="right",
> cbar_mode="each",
> cbar_size="2%",
> cbar_pad="0.5%"
>
> Now I'm trying to get scales and labels on my colorbars.
> I tried:
> for i,parameter in enumerate(z_dim):
> ax = my_grid[i].pcolor(x_grid,y_grid,z_dim[parameter]) # This is the
> pcolor plot
> my_grid[i].set_ylabel('Depth') # Correctly puts a y label on every
> plot.
> cb = my_grid.cbar_axes[i].colorbar(ax) # Puts in a colorbar for this
> axes?s
> cb.set_ylabel(parameter) #It would be nice if this was on the far right
> next to the colorbar. I don't see it anywhere. Perhaps underneath something?


The label of the colorbar is set to invisible by default (this is a bug).
So, try something like

my_grid.cbar_axes[i].set_ylabel(parameter)
my_grid.cbar_axes[i].axis["right"].toggle(ticklabels=True,
  label=True)




>
> [image: DPkWz.png]
> It looks like perhaps the colorbar axes is inside the ax axes rather than
> besides it?
> In the 
> demo_grid_with_each_cbarexample,
>  how would you put a scale and label on the colorbar like in this
> plot:?
> [image: 58dFK.png]
> I can put a y_label on each contour plot, but since they all have depth,
> I'd like to label this only once.
> Is there a way to label the entire AxesGrid (or is that subplot?)?
>
>
Does label_mode="1" do what you want?
You may manually make some of the labels invisible.

Please post a "complete", but simple, script that reproduces your problem.
Otherwise, it is hard to track down what is wrong.
Also, please report what version of matplotlib you're using. The axes_grid
toolkit is relatively new and some of the feature may not work in older
versions.

Regards,

-JJ



> Thank you very much for your help,
>
> -Ryan
>
>
>
> On Wed, Dec 2, 2009 at 10:21 PM, Jae-Joon Lee wrote:
>
>> This happens because, when the AxesGrid is created, gca() is set to the
>> last axes, which is the last colobar axes.
>>
>> If you use axes_grid toolkit, you'd better not use pyplot command that
>> works on axes. Instead, use axes method directly.
>>
>> For example, instead of  "pyplot.pcolor(..)" , use "ax.pcolor(..)".
>>
>> Regards,
>>
>> -JJ
>>
>>
>>
>>
>> On Wed, Dec 2, 2009 at 2:18 PM, Ryan Neve  wrote:
>>
>>> Hello,
>>>
>>> I'm trying to use AxesGrid but I'm running into a problem:
>>> I can plot a single pcolor plot:
>>> [image: 58dFK.png]
>>> But when I try to use AxesGrid, my pcolor plot is ending up where I
>>> expect my colorbar to be.
>>> [image: mEbTA.png]
>>>
>>> I want to have up to 6 of these plots stacked vertically, sharing a
>>> common time axis and y (depth) scale.
>>>
>>> I'll try to simplify my code to show what I'm doing:
>>>
>>> # I have arrays x_grid and y_grid for time and water depth.
>>> # z_dim is a dictionary of arrays (one for each plot)
>>> # In the plot above it has two arrays.
>>> from matplotlib import pyplot
>>> nrows = len(z_dim) # Number of rows is the number of arrays
>>> My_figure = pyplot.figure(1,(8,8))
>>> my_grid = AxesGrid(My_figure, 111, #Is this always 111?
>>> nrows_ncols = (nrows,1), # Always one column
>>> axes_pad = 0.1,
>>> add_all=True,
>>> share_all=True, # They all share the same time and depth
>>> scales
>>> label_mode = "L",
>>> cbar_location="right",
>>> cbar_mode="each",
>>> cbar_size="7%",
>>> cbar_pad="2%",
>>> )
>>> for row_no,parameter in enumerate(z_dim):
>>> ax = my_grid[row_no]
>>> ax = pyplot.pcolor(x_grid,y_grid,z_dim[parameter])
>>> pyplot.draw()
>>> pyplot.show()
>>>
>>> I eventually want to end up with something like this matlab output (which
>>> I didn't generate):
>>> [image: jiIaK.png]
>>> but without the duplication of x scales.
>>>
>>> I'm new to pyplot and even after reading the documentation much of this
>>> is baffling

Re: [Matplotlib-users] Plotting curves filled with nonuniform color patch

2009-12-03 Thread Jae-Joon Lee
line 1486 of _backend_agg.cpp says

  /* TODO: Support clip paths */

So, it seems that, apparently, clipping with arbitrary path has not
been implemented yet for gouraud shading (pcolormesh will be properly
clipped if shading is not used).
I hope Michael pick this up some time soon.

Meanwhile, you may open a feature request ticket on this.

Regards,

-JJ



On Wed, Dec 2, 2009 at 5:13 PM, Tony S Yu  wrote:
>
> On Dec 2, 2009, at 3:53 PM, Tony S Yu wrote:
>
>> Hi,
>>
>> I'm having hard time understanding some of the differences between functions 
>> used to plot color patches (not sure what to call them).
>>
>> I'm trying to fill a curve with a nonuniform color patch (like fill or 
>> fill_between but the color in the patch varies). I've attached code that 
>> almost does what I want; my question concerns the color patch (which is 
>> created by the call to plt.pcolor in the code below). I'd like to have 
>> nonuniform grid spacing in the color values, and also shading (i.e. 
>> interpolation of color between points). Here's what I understand:
>>
>> pcolor: allows nonuniform grid spacing, but it doesn't do shading.
>>
>> imshow: allows color shading, but requires uniform spacing
>>
>> pcolormesh: allows color interpolation and nonuniform grid spacing
>>
>> pcolormesh seems like the ideal candidate, but when I replace pcolor with 
>> pcolormesh (code commented out below pcolor call), the path doesn't get 
>> clipped by set_clip_path (but no errors are raised); in other words, the 
>> color shading fills the entire plot area. Is this a bug?
>>
>> Is there a way of making this plot work that I've overlooked?
>>
>> Thanks!
>> -Tony
>
>
> Nevermind, I found NonUniformImage after some digging. The working code is 
> attached below if anyone is interested.
>
> If anyone knows the answer, I'm still curious if the clipping behavior for 
> pcolormesh is a bug.
>
> Thanks,
> -Tony
>
>
>
> # example code
>
> import numpy as np
> import matplotlib.pyplot as plt
> from matplotlib.image import NonUniformImage
>
>
> def nonuniform_imshow(x, y, C, **kwargs):
>    """Plot image with nonuniform pixel spacing.
>
>    This function is a convenience method for calling image.NonUniformImage.
>    """
>    ax = plt.gca()
>    im = NonUniformImage(ax, **kwargs)
>    im.set_data(x, y, C)
>    ax.images.append(im)
>    return im
>
>
> def plot_filled_curve(x, y, c):
>    """Plot curve filled with linear color gradient
>
>    Parameters
>    --
>    x, y : arrays
>        points describing curve
>    c : array
>        color values underneath curve. Must match the lengths of `x` and `y`.
>    """
>    # add end points so that fill extends to the x-axis
>    x_closed = np.concatenate([x[:1], x, x[-1:]])
>    y_closed = np.concatenate([[0], y, [0]])
>    # fill between doesn't work here b/c it returns a PolyCollection, plus it
>    # adds the lower half of the plot by adding a Rect with a border
>    patch, = plt.fill(x_closed, y_closed, facecolor='none')
>    im = nonuniform_imshow(x, [0, y.max()], np.vstack((c, c)),
>                           interpolation='bilinear', cmap=plt.cm.gray)
>    im.set_clip_path(patch)
>
> if __name__ == '__main__':
>    line = np.linspace(0, 1, 6)
>    x = np.hstack((line, [1, 2]))
>    y = np.hstack((line**2, [1, 1]))
>    c = np.hstack((line, [0, 0]))
>    plot_filled_curve(x, y, c)
>    plt.show()
>
>
>
> --
> Join us December 9, 2009 for the Red Hat Virtual Experience,
> a free event focused on virtualization and cloud computing.
> Attend in-depth sessions from your desk. Your couch. Anywhere.
> http://p.sf.net/sfu/redhat-sfdev2dev
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>

--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] AxesGrid problem.

2009-12-03 Thread Ryan Neve
Thank You,
I think I have a better understanding. In my figure, there are six axes,
three for the plots: grid[i] and three for their colorbars:
grid.cbar_axes[i].
I changed my code as you suggested and got something like:
[image: UKM0g.png]
I tried all sorts of things, but finally, by setting aspect=False I got it
to work. In the documentation, the table says this defaults to True and the
explanation of aspect below says it defaults to False. Although I don't
entirely understand what is going on, I think this threw me off.
So then I had this:
[image: 84Kna.png]
... which looks much better, except that there are two sets of x and y axis
labels? This seems to have something to do with the colorbar. I've got:
label_mode = "L",
cbar_location="right",
cbar_mode="each",
cbar_size="2%",
cbar_pad="0.5%"

Now I'm trying to get scales and labels on my colorbars.
I tried:
for i,parameter in enumerate(z_dim):
ax = my_grid[i].pcolor(x_grid,y_grid,z_dim[parameter]) # This is the
pcolor plot
my_grid[i].set_ylabel('Depth') # Correctly puts a y label on every plot.
cb = my_grid.cbar_axes[i].colorbar(ax) # Puts in a colorbar for this
axes?s
cb.set_ylabel(parameter) #It would be nice if this was on the far right
next to the colorbar. I don't see it anywhere. Perhaps underneath something?
[image: DPkWz.png]
It looks like perhaps the colorbar axes is inside the ax axes rather than
besides it?
In the 
demo_grid_with_each_cbarexample,
how would you put a scale and label on the colorbar like in this
plot:?
[image: 58dFK.png]
I can put a y_label on each contour plot, but since they all have depth, I'd
like to label this only once.
Is there a way to label the entire AxesGrid (or is that subplot?)?

Thank you very much for your help,

-Ryan


On Wed, Dec 2, 2009 at 10:21 PM, Jae-Joon Lee  wrote:

> This happens because, when the AxesGrid is created, gca() is set to the
> last axes, which is the last colobar axes.
>
> If you use axes_grid toolkit, you'd better not use pyplot command that
> works on axes. Instead, use axes method directly.
>
> For example, instead of  "pyplot.pcolor(..)" , use "ax.pcolor(..)".
>
> Regards,
>
> -JJ
>
>
>
>
> On Wed, Dec 2, 2009 at 2:18 PM, Ryan Neve  wrote:
>
>> Hello,
>>
>> I'm trying to use AxesGrid but I'm running into a problem:
>> I can plot a single pcolor plot:
>> [image: 58dFK.png]
>> But when I try to use AxesGrid, my pcolor plot is ending up where I expect
>> my colorbar to be.
>> [image: mEbTA.png]
>>
>> I want to have up to 6 of these plots stacked vertically, sharing a common
>> time axis and y (depth) scale.
>>
>> I'll try to simplify my code to show what I'm doing:
>>
>> # I have arrays x_grid and y_grid for time and water depth.
>> # z_dim is a dictionary of arrays (one for each plot)
>> # In the plot above it has two arrays.
>> from matplotlib import pyplot
>> nrows = len(z_dim) # Number of rows is the number of arrays
>> My_figure = pyplot.figure(1,(8,8))
>> my_grid = AxesGrid(My_figure, 111, #Is this always 111?
>> nrows_ncols = (nrows,1), # Always one column
>> axes_pad = 0.1,
>> add_all=True,
>> share_all=True, # They all share the same time and depth
>> scales
>> label_mode = "L",
>> cbar_location="right",
>> cbar_mode="each",
>> cbar_size="7%",
>> cbar_pad="2%",
>> )
>> for row_no,parameter in enumerate(z_dim):
>> ax = my_grid[row_no]
>> ax = pyplot.pcolor(x_grid,y_grid,z_dim[parameter])
>> pyplot.draw()
>> pyplot.show()
>>
>> I eventually want to end up with something like this matlab output (which
>> I didn't generate):
>> [image: jiIaK.png]
>> but without the duplication of x scales.
>>
>> I'm new to pyplot and even after reading the documentation much of this is
>> baffling.
>>
>> -Ryan
>>
>>
>>
>> --
>> Join us December 9, 2009 for the Red Hat Virtual Experience,
>> a free event focused on virtualization and cloud computing.
>> Attend in-depth sessions from your desk. Your couch. Anywhere.
>> http://p.sf.net/sfu/redhat-sfdev2dev
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.so

[Matplotlib-users] numpy loadtxt and comments

2009-12-03 Thread Peter I. Hansen
Hi All

Not really about matplotlib, but since the load() function was removed
it seems we have to use numpy.loadtxt in stead.
I'm reading some datafiles that have comment line beginning with both
'#' and '@'. Is there a way to assign two different values to the
'comments' keyword?

Thanks, Peter

--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How to display axis numbers inside the figure area

2009-12-03 Thread Matthias Michler
Hi Angelica,

I have to admit I don't get the point of what you want to do and maybe this is 
true for others too. I tried something (see attachement), but maybe it is 
better if you could set up an small example script or draw a picture of what 
you want to see finally.

Kind regards,
Matthias

On Monday 30 November 2009 18:09:29 Pekeika wrote:
> Good morning All,
>
> I am creating figures that need to overlay with maps, so disabling the box
> around my figures is a must. (need no title, legend, etc...) I have my
> plain figure now without surroundings but now need the axis numbers "on"
> the grid inside the plot area (like latitude and longitude numbers appear
> next to the grids on maps)... I cannot find a function or an argument for
> the axis() or axes() functions that translates axes into the plot area...
> Any ideas please?
>
> Thank you so much,
> Angelica.


<>

axes_numbers.py
Description: application/python
--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Cross axis arrows

2009-12-03 Thread Jae-Joon Lee
You need to add the patch to the second axes.

patch = ConnectionPatch((.5, .5), (.7, .3), 'data', 'data',
axesA=ax1, axesB=ax2,
zorder=100, arrowstyle='fancy',
connectionstyle='Angle3',
mutation_scale=10)
ax2.add_patch(patch)

However, this does not work right out of the box currently (which
should  be bug).
As a workaround, add a following line and it will work.

patch.set_annotation_clip(False)

It would be appreciated if you file a bug report for a future reference.

http://sourceforge.net/tracker/?atid=560720&group_id=80706&func=browse


Regards,

-JJ



On Thu, Dec 3, 2009 at 9:31 AM, Stephane Raynaud
 wrote:
> Hi,
>
> how to make this arrow not disappear below the right plot?
> Here is the code :
>
> 
> from matplotlib.patches import *
> import matplotlib.pyplot as P
>
> P.figure(figsize=(5, 3))
> ax1 = P.subplot(121)
> P.plot([0, 1])
> ax2 = P.subplot(122)
> P.plot([0, 1])
>
>
> patch = ConnectionPatch((.5, .5), (.7, .3), 'data', 'data', axesA=ax1,
> axesB=ax2,
>     zorder=100, arrowstyle='fancy',clip_on=False, connectionstyle='Angle3',
> mutation_scale=100)
> ax1.add_patch(patch)
>
> P.savefig('cross_arrow.png')
> P.show()
> 
>
>
>
>
> --
> Stephane Raynaud
>
> --
> Join us December 9, 2009 for the Red Hat Virtual Experience,
> a free event focused on virtualization and cloud computing.
> Attend in-depth sessions from your desk. Your couch. Anywhere.
> http://p.sf.net/sfu/redhat-sfdev2dev
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>

--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] usetex=True and savefig(eps-file)

2009-12-03 Thread Matthias Michler
Hi Jouni,

thanks again for your advice.

I don't think that I do have 'some setting that causes temporary files to end 
up in the root directory", because my system is more or less kubuntu (8.04) 
out of the box.

But maybe you are nevertheless right, because in tmp there are ./root 
and ./lost+found, which I am not allowed to enter.
Finally this error is due to the behaviour of ps-backend and my TEX-path, 
which searches in all sub-directories.

Thanks a lot for your time and advice to locate the root of the strange  
behaviour. 

Kind regards,
Matthias 

On Thursday 03 December 2009 19:04:55 Jouni K. Seppänen wrote:
> Matthias Michler  writes:
> > Do you know why is happens only for  ps/eps-files?
>
> The ps backend uses TeX in a different way than the other backends. It
> uses psfrag and dvips to construct the final file.
>
> >> Have you set any TeX-related environment variables or edited any
> >> configuration files? What does "kpsepath tex" print?
> >
> > in my .zshrc I set
> > TEXINPUTS=~/Texte/Styles//:.//:
>
> It's probably the .// entry, which causes TeX to search all
> subdirectories of the current directory. The ps backend does something
> like
>
> cd /tmp && latex file.tex
>
> so it should just look in subdirectories of the temporary directory, but
> perhaps it somehow goes awry. Do you have some setting that causes
> temporary files to end up in the root directory?



--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] usetex=True and savefig(eps-file)

2009-12-03 Thread Jouni K . Seppänen
Matthias Michler  writes:

> Do you know why is happens only for  ps/eps-files?

The ps backend uses TeX in a different way than the other backends. It
uses psfrag and dvips to construct the final file.

>> Have you set any TeX-related environment variables or edited any
>> configuration files? What does "kpsepath tex" print?
>
> in my .zshrc I set
> TEXINPUTS=~/Texte/Styles//:.//:

It's probably the .// entry, which causes TeX to search all
subdirectories of the current directory. The ps backend does something
like

cd /tmp && latex file.tex

so it should just look in subdirectories of the temporary directory, but
perhaps it somehow goes awry. Do you have some setting that causes
temporary files to end up in the root directory?

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Cross axis arrows

2009-12-03 Thread Stephane Raynaud
Hi,

how to make this arrow not disappear below the right plot?
Here is the code :


from matplotlib.patches import *
import matplotlib.pyplot as P

P.figure(figsize=(5, 3))
ax1 = P.subplot(121)
P.plot([0, 1])
ax2 = P.subplot(122)
P.plot([0, 1])


patch = ConnectionPatch((.5, .5), (.7, .3), 'data', 'data', axesA=ax1,
axesB=ax2,
zorder=100, arrowstyle='fancy',clip_on=False, connectionstyle='Angle3',
mutation_scale=100)
ax1.add_patch(patch)

P.savefig('cross_arrow.png')
P.show()





-- 
Stephane Raynaud
<>--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Output to any vector format openoffice can use

2009-12-03 Thread gbollenbach

Inkscape's native format is svg and it exports in .odg, which OO should be
able to use.  I did a test combining a svg vector and png raster and then
saving as .odg, and it wrote the file.  But I don't have OO so I can't try
to import the result.

regards,
Gary B


marcusantonius wrote:
> 
> I am searching a way, so that I can insert my matplotlib graphs as vector
> data in openoffice. I make colormaps using pcolorfast. If I save the
> figure as emf, the colormap inside the axes vanishes, because the normal
> emf backend cannot include rasterized data. Is there any way (e.g. using a
> different backend) which gives emf/wmf files which contain the rasterized
> data?
> 
> Is there a convertor from svg to emf which can do the trick? (I tried
> uniconvertor but it also looses the rasterized data). I tried to insert
> svg/eps/pdf files into openoffice, but the results are less than promising
> 

-- 
View this message in context: 
http://old.nabble.com/Output-to-any-vector-format-openoffice-can-use-tp26589911p26619988.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Extending patches.Rectangle class

2009-12-03 Thread Jorge Scandaliaris
Jae-Joon Lee  writes:
<...>
> 
> It depends on your mileage.
> 
> However, a patch in matplotlib usually means a closed path. If you add
> additional lines, you need to be careful not to mess the filling of
> the rectangle.
> 
> I guess it would better to simply use separate artists for additional
> lines you want. You may create a container artist for patches and
> lines if you want.
> 
> Regards,
> 
> -JJ

Thanks, that's sounds like a better way indeed. I'll work in this direction.

Jorge



--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] usetex=True and savefig(eps-file)

2009-12-03 Thread Matthias Michler
Hi Jouni,

Thanks for your explaination.

On Wednesday 02 December 2009 17:20:37 Jouni K. Seppänen wrote:
> Matthias Michler  writes:
> > ./root/article.cls.tex: Permission denied
> > ./root/article.cls: Permission denied
> > ./lost+found/article.cls.tex: Permission denied
> > ./lost+found/article.cls: Permission denied
> > ./root/article.cls.tex: Permission denied
> > ./root/article.cls: Permission denied
> > ./lost+found/article.cls.tex: Permission denied
> > ./lost+found/article.cls: Permission denied
>
> That looks like a TeX configuration problem. I'm guessing that when TeX
> encounters \documentclass{article}, it asks the path-searching library
> for "article.cls", and for some reason /root and /lost+found are
> included in the path. You don't have permission as normal user to access
> these directories, so the library causes error messages to be printed.
> The path probably also includes the correct directories, so the search
> eventually succeeds, but then article.cls wants to input size10.clo,
>
> causing a new round of errors:
> > ./root/size10.clo.tex: Permission denied
> > ./root/size10.clo: Permission denied
>
> (etc)

Do you know why is happens only for  ps/eps-files?

> Have you set any TeX-related environment variables or edited any
> configuration files? What does "kpsepath tex" print?

in my .zshrc I set
TEXINPUTS=~/Texte/Styles//:.//:
export TEXINPUTS

and "$ kpsepath tex" yields
/home/michler/Texte/Styles//:.//:.:/home/michler/.texmf-config/tex/kpsewhich//:/home/michler/.texmf-var/tex/kpsewhich//:/home/michler/texmf/tex/kpsewhich//:/etc/texmf/tex/kpsewhich//:!!/var/lib/texmf/tex/kpsewhich//:!!/usr/local/share/texmf/tex/kpsewhich//:!!/usr/share/texmf/tex/kpsewhich//:!!/usr/share/texmf-texlive/tex/kpsewhich//:/home/michler/.texmf-config/tex/generic//:/home/michler/.texmf-var/tex/generic//:/home/michler/texmf/tex/generic//:/etc/texmf/tex/generic//:!!/var/lib/texmf/tex/generic//:!!/usr/local/share/texmf/tex/generic//:!!/usr/share/texmf/tex/generic//:!!/usr/share/texmf-texlive/tex/generic//:/home/michler/.texmf-config/tex///:/home/michler/.texmf-var/tex///:/home/michler/texmf/tex///:/etc/texmf/tex///:!!/var/lib/texmf/tex///:!!/usr/local/share/texmf/tex///:!!/usr/share/texmf/tex///:!!/usr/share/texmf-texlive/tex///

Furthermore I did (as root):
$ cd /root$ cd /lost+found/  and $ cd /tmp/
and
$ ls **/*tex **/*.cls
but always got
ls: cannot access **/*tex: No such file or directory
ls: cannot access **/*.cls: No such file or directory
... That means there are no tex or cls-files.

Do you have any idea what's wrong?

Kind regards,
Matthias

--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] mplot3d: plot_surface() and contour on grid?

2009-12-03 Thread Matthias Michler
Thanks a lot!

Regards,
Matthias

On Wednesday 02 December 2009 17:10:54 Reinier Heeres wrote:
> Hi Matthias,
>
> I have a similar patch lying around somewhere, and I will try to apply
> it soon. I've been terribly busy lately, but I expect some nice
> mplot3d enhancements in the very near future.
>
> Regards,
> Reinier
>
> On Wed, Dec 2, 2009 at 4:22 PM, Matthias Michler
>
>  wrote:
> > Hi Andrew,
> >
> > do you have any idea if the patch (or a part of it) may get a part of
> > matplotlib-svn some day?
> >
> > Kind regards,
> > Matthias
> >
> > On Friday 09 October 2009 23:25:28 Andrew Straw wrote:
> >> Matthias Michler wrote:
> >> > Hello list,
> >> >
> >> > I'm not an expert in axes3d, but in case the feature which Nicolas
> >> > requested is not possible in an easy manner up to now, I propose an
> >> > additional kwarg for axes3d.Axes3D.contour. Something like *offset*.
> >> > If offset is None the z-values of the contour lines corresponds to
> >> > given Z and otherwise offset is used for the z-values of the contour
> >> > lines. I attached a changed axes3d.py and a patch against current svn.
> >> > The result is illustrated in the contour3d_demo.png.
> >> >
> >> > Could any of the experts have a look at it and tell me if this could
> >> > be useful, please?
> >> >
> >> > Thanks in advance for any comments.
> >> >
> >> > Kind regards
> >> > Matthias
> >> >
> >> > On Wednesday 30 September 2009 19:22:42 Nicolas Bigaouette wrote:
> >> >> Hi,
> >> >> I have a nice plot_surface() using mplot3d (see attachement).
> >> >>
> >> >> I'd like to project the surface on the axis xoy, xoz and yoz with a
> >> >> contour, similar to this figure:
> >> >> http://homepages.ulb.ac.be/~dgonze/INFO/matlab/fig19.jpg
> >> >>
> >> >> Is it possible using matplotlib and mplot3d?
> >> >>
> >> >> Thanx!
> >>
> >> Hi Matthias,
> >>
> >> I committed your patch to a github branch of MPL, but I'll let Reinier
> >> actually commit something based on this to MPL.
> >> http://github.com/astraw/matplotlib/tree/dev/michler-3d-contourf-offsets
> >>
> >> -Andrew


--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Output to any vector format openoffice can use

2009-12-03 Thread marcusantonius

Thak you very much for pointing this out to me. I was not aware that Inkscape
is able to output to .odg. Unfortunatly export into .odg works badly. I
converted .svg files, and both were rendered totally incorrect. All the axes
labels vanished, in a lineplot it connected the end of the line to the
origin, leading to a diagonal line which should not be there, and the
rasterized image included by pcolorfast was also not included. Therefore I
fear that exporting into .odg is not a usable alternative. 
-- 
View this message in context: 
http://old.nabble.com/Output-to-any-vector-format-openoffice-can-use-tp26589911p26621731.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users