Re: [Matplotlib-users] problem with usetex \color

2009-05-12 Thread Matthias Michler
Hello list,

I'm not sure that following problem also occurs for Sebastian, but if I use 
PS-backend in the below script I get the attached output, where the upper 
part of the b is somehow hidden (matplotlib-version 0.98.6svn).
Is this a problem of matplotlib or did I miss something in the tex-handling?

best regards Matthias

 
from matplotlib import use, rc
use('PS')
from pylab import figure, savefig

rc('text', usetex=True)
rc('text.latex', preamble=\usepackage{color})

f = figure()
f.text(0.5, 0.5, r{\color[rgb]{0,1,0} a } b {\color{blue} $\nu, \mu, \tau$})

savefig('test_tex_color.ps')
 

On Monday 11 May 2009 20:36:58 Jae-Joon Lee wrote:
  The resulting graph is not colored -- but in the directory
  ~/.matplotlib/tex.cache/ the text is green, both in the dvi and the png
  file!
 
  It therefore seems to me that this is not completely hopeless but I
  cannot figure out how to proceed.

 As far as I know, in matplotlib, all the tex png output is treated as
 grey  internally (the only exception I know of is ps backend, e.g.,
 your example will show you a correct color if you save it as ps). I
 guess this may have been a design decision.
 As far as I can see, MPL currently does not support texts with varying
 font properties (size, color, font).
 One possible workaround for this could be using the latex typesetting
 as you tried. However, supporting this within the current text
 framework of matplotlib would be difficult and may not be a good idea.


 However, I guess there are a few workarounds you may consider to use
 (but unfortunately I think none of them are easy to work with). So, if
 you describe where you intend to use multi-color text, I'll try to
 give some example appropriate for your situation. Multi-color text in
 figure title or simple annotation would be relatively simple.
 Multi-color text in legend label seems to be more difficult, but
 should be doable.

 -JJ

 ---
--- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
 production scanning environment may not be a perfect world - but thanks to
 Kodak, there's a perfect scanner to get the job done! With the NEW KODAK
 i700 Series Scanner you'll get full speed at 300 dpi even with all image
 processing features enabled. http://p.sf.net/sfu/kodak-com
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


attachment: test_tex_color.eps

test_tex_color.ps
Description: PostScript document
--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] problem with usetex \color

2009-05-12 Thread Sebastian Busch
Hey Jae-Joon!

Thank you for your answer!


Jae-Joon Lee wrote:
 ...your example will show you a correct color if you save it as ps...

Indeed the ps output is colored! That's great  :)

 ... describe where you intend to use multi-color text ...

OK, you got me -- actually, this was already a hack. My problem is that
I have labels which read something like

d = 12m

where the number varies within ]0, 20[. I would have liked to get an
aligned legend, like

d =  9m
d = 10m

In order to achieve that, i was trying to print a white (=invisible) 1
whenever the number was smaller than 10 as spaceholder (I do not want to
use a monospaced font). Obviously, this doesn't work any more as soon as
you reach 20...



Thanks again for the help -- I'm happy for the moment, but if you (or
someone else) can show me how to align the legend, it would be great.

Best wishes,
Sebastian.





signature.asc
Description: OpenPGP digital signature
--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] problem with usetex \color

2009-05-12 Thread Sebastian Busch
Hey Matthias!

Thanks for working on that!

Matthias Michler wrote:
 ... I'm not sure that following problem also occurs for Sebastian, ...

it does.

 ... PS-backend ... the upper part of the b is somehow hidden ...
 f.text(0.5, 0.5, r{\color[rgb]{0,1,0} a } b {\color{blue} $\nu, \mu, \tau$})

In addition to that, I have the strange behaviour that the b is not
displayed at all when using

f.text(0.5, 0.5, r{\color[rgb]{0,1,0} a } b)
-- gives only a green a

but it is without the color command:

f.text(0.5, 0.5, r{ a } b)
-- gives black a b


Pretty weird, isn't it?
Best,
Sebastian.



signature.asc
Description: OpenPGP digital signature
--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] contourf/colorbar logarithmic value scale

2009-05-12 Thread Christian K .

Christian K. ckk...@... writes:
 
 Hi,
 
 could someone please point me to an example which shows how to achieve a 
filled 
 contour plot with a logarithmic value scale both for the contour data and the 
 colorbar?
 
 Thanks in advance, Christian
 

I just noticed that this has been discussed recently. Sorry for not doing my 
homework.

Christian



--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] problem with usetex \color

2009-05-12 Thread Jouni K . Seppänen
Sebastian Busch webmas...@thamnos.de writes:

 I would have liked to get an aligned legend, like

 d =  9m
 d = 10m

 In order to achieve that, i was trying to print a white (=invisible) 1
 whenever the number was smaller than 10 as spaceholder (I do not want to
 use a monospaced font). 

Does the \phantom trick work? I.e., r'd = \phantom{1}9m' or something
like that?

 Obviously, this doesn't work any more as soon as you reach 20...

Even if your font is not monospaced, it might have tabular figures:

http://www.fonts.com/aboutfonts/articles/fyti/propvstabfigures.htm

I think at least Computer Modern Roman (the default font in TeX) does
have tabular figures.

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


--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] continous colormap with 'plateau'

2009-05-12 Thread Christian K .
Hi everyone,

is it possible to map a certain range within the value-range of a image plot to 
a constant value? Currently I am overlaying a filled contour plot with just two 
contour levels on top of an image plot. This works, but I would like to display 
the plateau in the colorbar as well, so that the color changes continously over 
the whole value range but in the specified range where it should remain white. 
I guess I would need a special colormapper to achieve that.

Thanks in advance for any pointers, Christian



--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] figuresize and dpi

2009-05-12 Thread Chaitanya Krishna
Hi all,

I define the figure size as fig = plt.figure(figsize=(7,0.75*7)), then
plot the figure and save it as both a png and an eps.

If I then measure the size of the figure as displayed (displayed with
0 zoom) on the computer screen with a ruler, it does not measure 7 in.
Why is it so? Am I doing something wrong.

The reason for the post is that I would like to put a figure which
would measure 7 in. wide in a publication. I want a faithful
reproduction of how the image would look at 7 in. so that I can use
the same settings for all the other figures. But I am always getting a
size that is less that 7 in. So, when I put it in the publication at 7
in. all the fonts would be enlarged and I do not want this to happen.

Cheers,
Chaitanya

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Qt backend in QMdiArea

2009-05-12 Thread Magnus Benjes
The class matplotlib.backends.backend_qt4agg.FigureCanvasQTAgg works
well in a QWorkspace. But when I put it in a QMdiArea the resizing
slows down.

In Qt 4.5 the class QWorkspace is deprecated. The class QMdiArea
should be used instead.

In the attached code you can see the difference in the performance.

The project Simuvis (http://simuvis.de/wsb/) provides its own
implementation of FigureCanvasQTAgg the class FigureCanvasSV4
(http://svn.berlios.de/svnroot/repos/simuvis4/trunk/AdditionalPlugIns/MatPlot/MatPlot/backend_sv4agg.py).
This one works fine both in a QMdiArea and in a QWorkspace.

Regards
Magnus Benjes

import sys
from PyQt4 import QtGui, QtCore

import numpy
import matplotlib
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg

x = numpy.arange(0,10,0.1)
y = x**2

qApp = QtGui.QApplication(sys.argv)

mainWindowMdi = QtGui.QMainWindow()
mainWindowMdi.setWindowTitle(QMdiArea)
mdi = QtGui.QMdiArea()
mainWindowMdi.setCentralWidget(mdi)

c1 = FigureCanvasQTAgg(matplotlib.figure.Figure())
c1.figure.add_subplot(1,1,1).plot(x,x)
mdi.addSubWindow(c1)

c2 = FigureCanvasQTAgg(matplotlib.figure.Figure())
c2.figure.add_subplot(1,1,1).plot(x, x**2)
mdi.addSubWindow(c2)

mainWindowWorkspace = QtGui.QMainWindow()
mainWindowWorkspace.setWindowTitle(QWorkspace)
workspace = QtGui.QWorkspace()
mainWindowWorkspace.setCentralWidget(workspace)

c3 = FigureCanvasQTAgg(matplotlib.figure.Figure())
c3.figure.add_subplot(1,1,1).plot(x,x)
workspace.addWindow(c3)

c4 = FigureCanvasQTAgg(matplotlib.figure.Figure())
c4.figure.add_subplot(1,1,1).plot(x, x**2)
workspace.addWindow(c4)

mainWindowMdi.show()
mainWindowWorkspace.show()

sys.exit(qApp.exec_())

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] figuresize and dpi

2009-05-12 Thread Alan G Isaac
On 5/12/2009 9:57 AM Chaitanya Krishna apparently wrote:
 I define the figure size as fig = plt.figure(figsize=(7,0.75*7)), then
 plot the figure and save it as both a png and an eps.
 If I then measure the size of the figure as displayed (displayed with
 0 zoom) on the computer screen with a ruler, it does not measure 7 in.
 Why is it so? Am I doing something wrong.


http://matplotlib.sourceforge.net/api/api_changes.html#dpi
(Perhaps the last sentence of the first paragraph helps.)

Alan Isaac

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] figuresize and dpi

2009-05-12 Thread Jouni K . Seppänen
Chaitanya Krishna icym...@gmail.com writes:

 I define the figure size as fig = plt.figure(figsize=(7,0.75*7)), then
 plot the figure and save it as both a png and an eps.

When you save as png, you can set the dpi, and if you use e.g. 100, the
figure will be 700 pixels wide; if you use 75, it will be 525 pixels
wide. The dpi is saved in the png file, so the viewer application can in
principle know how to rescale it.

When you save as eps, which is a vector graphics format, the dpi
argument will not have much effect (with the exception of resampled
images). It is up to the viewer application to show it at the correct
size. When you print the file, it should appear at the right size,
although it is not impossible for there to be some measurable error.
Presumably a professional publisher will make sure that their printing
equipment comes as close as possible to the intended size.

 If I then measure the size of the figure as displayed (displayed with
 0 zoom) on the computer screen with a ruler, it does not measure 7 in.
 Why is it so? Am I doing something wrong.

Often, the viewer application does not know what the dpi value of the
screen is - popular guesses are 75 and 100, but this naturally depends
on the physical size of the screen. For example, a resolution of 1280 x
1024 at 15 inches or 17 inches will have a different dpi, and if the
viewer application (or the operating system, or the windowing system)
just has some default guess, you will not see the correct size on the
screen.

I think The GIMP has a dpi calibration dialog where it shows rulers and
asks you to measure them with a physical ruler. You might want to
install The GIMP, set up the dpi and use it to view your png files.

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


--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] continous colormap with 'plateau'

2009-05-12 Thread Eric Firing
Christian K. wrote:
 Hi everyone,
 
 is it possible to map a certain range within the value-range of a image plot 
 to 
 a constant value? Currently I am overlaying a filled contour plot with just 
 two 
 contour levels on top of an image plot. This works, but I would like to 
 display 
 the plateau in the colorbar as well, so that the color changes continously 
 over 
 the whole value range but in the specified range where it should remain 
 white. 
 I guess I would need a special colormapper to achieve that.

Yes. See 
http://matplotlib.sourceforge.net/examples/pylab_examples/custom_cmap.html
for an explanation of how to make one.

Actually, you can achieve what you want with either a special cmap, or 
with a special norm.  I don't think we have any examples of the latter.

Eric

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Total noob question. How to start Matplotlib

2009-05-12 Thread (_8*(l)Homer

Like the title of the post says, this is a totally noobie question.  I have
an older system running Kubuntu 7.04 with Matplotlib 0.90.0 and for the life
of me, I can't figure out how to start the program.

Any help would be apprecieated.  Once again, sorry for the Noob question of
the day.


Joe
 
-- 
View this message in context: 
http://www.nabble.com/Total-noob-question.--How-to-start-Matplotlib-tp23494234p23494234.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Total noob question. How to start Matplotlib

2009-05-12 Thread Sandro Tosi
Hello Homer (even if I would have rather called you with your proper name)

On Tue, May 12, 2009 at 02:30, (_8*(l)Homer letourneau@gmail.com wrote:
 Like the title of the post says, this is a totally noobie question.  I have
 an older system running Kubuntu 7.04 with Matplotlib 0.90.0 and for the life
 of me, I can't figure out how to start the program.

It seems you missed a little bit: matplotlib is not a program :)

Matplotlib is a library you can use while programming in python to
generate graphs.

Let me give you a very simple example (I'll be using ipython, but take
the code and put it into the python interpreter or in a script and it
will work the same):

$ ipython
Python 2.5.4 (r254:67916, Feb 18 2009, 03:00:47)
Type copyright, credits or license for more information.

IPython 0.9.1 -- An enhanced Interactive Python.
? - Introduction and overview of IPython's features.
%quickref - Quick reference.
help  - Python's own help system.
object?   - Details about 'object'. ?object also works, ?? prints more.

In [1]: import matplotlib.pyplot as plt

In [2]: import numpy as np

In [3]: x = np.arange(0,2*np.pi,.01)

In [4]: y = np.sin(x**2)*np.exp(-x)

In [5]: plt.plot(x, y)
Out[5]: [matplotlib.lines.Line2D object at 0x1ab5810]

In [6]: plt.show()


I hope you'll find it interesting, and explore more about matplotlib.

Cheers,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Autoscale embedding in gtk + dynamical update of plot + Y log scale

2009-05-12 Thread Sandro Tosi
Hi All,
I'd like to renew this request below.

I've worked-around this problem setting xlim/ylim (as min/max of the
relative axis) right before redraw the figure, but I'd like to know
for a more elegant solution.

Thanks in advance,
Sandro

On Sun, May 10, 2009 at 23:31, Sandro Tosi mo...@debian.org wrote:
 Hi All,
 I'm facing a weird problem while embedding in a gtk window made with
 glade (dunno if this might be involved in the problem, but worth
 noticing) + dynamical update of the plot.

 What I'm doing is:

 fig = Figure()
 ax = fig.add_subplot(111)
 line, = ax.plot([], [])

 then using that reference to update the plot when user click on a button:

 def update_graph(params):
    line_ref.set_data(np.array([L1, L2]))
    ax.set_yscale('log')
    fig_ref.canvas.draw()

 Sadly, the graph embedded remains unchanged, if not for the Y labels 
 ticks that changes because of the log scale.

 The data is there, becase if I explicitly set the x/ylim then the data
 are shown, but i'd like mpl to autoscale.

 I've used several tentatives to make it works:

 - ax.set_autoscale_on(True)
 - ax.autoscale_view()

 but none of them worked.

 Do you know if there's something I can do to make that graph autoscale
 at set_data time? can I force it somehow? if I can't do it handy, is
 there a workaround to obtain the same effect?

 Thanks in advance,
 --
 Sandro Tosi (aka morph, morpheus, matrixhasu)
 My website: http://matrixhasu.altervista.org/
 Me at Debian: http://wiki.debian.org/SandroTosi




-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] problem with usetex \color

2009-05-12 Thread Jae-Joon Lee
As Jouni suggested, I guess the best chance here is to use phantom
command. Here is a little example.

rc('text', usetex=True)

p1, = plot([1,2,3])
legend([p1, p1, p1, p1],
   [rd = $\phantom{0}1$ m, d = $10$ m, d = $23$ m, d = $91$ m])

-JJ


On Tue, May 12, 2009 at 6:52 AM, Jouni K. Seppänen j...@iki.fi wrote:
 Sebastian Busch webmas...@thamnos.de writes:

 I would have liked to get an aligned legend, like

 d =  9m
 d = 10m

 In order to achieve that, i was trying to print a white (=invisible) 1
 whenever the number was smaller than 10 as spaceholder (I do not want to
 use a monospaced font).

 Does the \phantom trick work? I.e., r'd = \phantom{1}9m' or something
 like that?

 Obviously, this doesn't work any more as soon as you reach 20...

 Even if your font is not monospaced, it might have tabular figures:

 http://www.fonts.com/aboutfonts/articles/fyti/propvstabfigures.htm

 I think at least Computer Modern Roman (the default font in TeX) does
 have tabular figures.

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


 --
 The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
 production scanning environment may not be a perfect world - but thanks to
 Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
 Series Scanner you'll get full speed at 300 dpi even with all image
 processing features enabled. http://p.sf.net/sfu/kodak-com
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] One more question regarding to boxplotting

2009-05-12 Thread Gökhan SEVER
Hello,

I construct my boxplots (shown in this figure:
http://img204.imageshack.us/img204/7518/boxplot2.png) using 5th, 25th, 50th,
75th, 95th percent of my data explicitly. For some reason on boxplot 3 and 5
on the figure I get fliers instead of whiskers on the lower parts.

Do you have any idea what could be the reason for this behaviour?

Gökhan
--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Autoscale embedding in gtk + dynamical update of plot + Y log scale

2009-05-12 Thread John Hunter
On Tue, May 12, 2009 at 12:11 PM, Sandro Tosi mo...@debian.org wrote:
 Hi All,
 I'd like to renew this request below.

 I've worked-around this problem setting xlim/ylim (as min/max of the
 relative axis) right before redraw the figure, but I'd like to know
 for a more elegant solution.

 Thanks in advance,
 Sandro

 On Sun, May 10, 2009 at 23:31, Sandro Tosi mo...@debian.org wrote:
 Hi All,
 I'm facing a weird problem while embedding in a gtk window made with
 glade (dunno if this might be involved in the problem, but worth
 noticing) + dynamical update of the plot.

 What I'm doing is:

 fig = Figure()
 ax = fig.add_subplot(111)
 line, = ax.plot([], [])

 then using that reference to update the plot when user click on a button:

 def update_graph(params):
line_ref.set_data(np.array([L1, L2]))
ax.set_yscale('log')
fig_ref.canvas.draw()

 Sadly, the graph embedded remains unchanged, if not for the Y labels 
 ticks that changes because of the log scale.

 The data is there, becase if I explicitly set the x/ylim then the data
 are shown, but i'd like mpl to autoscale.

 I've used several tentatives to make it works:

 - ax.set_autoscale_on(True)
 - ax.autoscale_view()

 but none of them worked.

If you change the data directly, and want mpl to autoscale, you need
to call ax.relim() before calling ax.autoscale_view().  mpl stores the
min/max of the data you add to it when you add the lines, rectangles,
etc to the figure.  When you update the data directly, there is no
internal mechanism to notify the limits to update (we could add this
but haven't).  So you must explicitly call relim, which tells mpl to
reinspect the data recalculate the limits.  It might be a better
design to have each artist store its limits, updating them when data
is updated, and then having the container artists, eg the Axes, do a
union of the child bboxes.  But this is not the design we have
currently.

Hope this helps,
JDH

JDH

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] One more question regarding to boxplotting

2009-05-12 Thread Stephen George

Why don't you perform a histogram on the data that produced that 
boxplot, .. seeing the shape of that histogram may answer your own 
question. Is it skewed or normal distribution?

Gökhan SEVER wrote:
 Hello,

 I construct my boxplots (shown in this figure: 
 http://img204.imageshack.us/img204/7518/boxplot2.png) using 5th, 25th, 
 50th, 75th, 95th percent of my data explicitly. For some reason on 
 boxplot 3 and 5 on the figure I get fliers instead of whiskers on the 
 lower parts.

 Do you have any idea what could be the reason for this behaviour?

 Gökhan
 

 --
 The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
 production scanning environment may not be a perfect world - but thanks to
 Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
 Series Scanner you'll get full speed at 300 dpi even with all image 
 processing features enabled. http://p.sf.net/sfu/kodak-com
 

 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users
   



--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] One more question regarding to boxplotting

2009-05-12 Thread Gökhan SEVER
I can't tell easily about the distribution of data points looking at
histograms, since I am calling boxplot as in following notation:

In [32]: d[2][8:]
Out[32]: array([98.2507,  99.6293,  100.0359,  100.1859,  100.4691])

Here the elements of my array are 5th, 25, 50, 75, 95th percentile of the
original data array, where these are created with a simple calculation
before boxplot command is called.

For example when I do, boxplot([5,25,50,75,95]) I get the desired effect
exactly. For some reason in my case 2 out of 12 boxplot has fliers instead
of whiskers to be drawn. Might this be related to rounding off these
numbers?

Thanks.

Gökhan


On Tue, May 12, 2009 at 5:32 PM, Stephen George
steve_...@optusnet.com.auwrote:


 Why don't you perform a histogram on the data that produced that boxplot,
 .. seeing the shape of that histogram may answer your own question. Is it
 skewed or normal distribution?

 Gökhan SEVER wrote:

 Hello,

 I construct my boxplots (shown in this figure:
 http://img204.imageshack.us/img204/7518/boxplot2.png) using 5th, 25th,
 50th, 75th, 95th percent of my data explicitly. For some reason on boxplot 3
 and 5 on the figure I get fliers instead of whiskers on the lower parts.

 Do you have any idea what could be the reason for this behaviour?

 Gökhan
 


 --
 The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
 production scanning environment may not be a perfect world - but thanks to
 Kodak, there's a perfect scanner to get the job done! With the NEW KODAK
 i700
 Series Scanner you'll get full speed at 300 dpi even with all image
 processing features enabled. http://p.sf.net/sfu/kodak-com
 

 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users





--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] thick lines on top of each other

2009-05-12 Thread Brian Lewis
Hi,

I'm trying to plot two thick lines that are separated only by a constant.

import matplotlib.pyplot as plt
import numpy as np
shift = .1
x = np.linspace(0,10,100)
y1 = np.sin(x)
y2 = y1 + shift
lw = 10
alpha = .8
plt.plot(x, y1, linewidth=lw, alpha=alpha)
plt.plot(x, y2, linewidth=lw, alpha=alpha)

Visually, the result is not desirable.  The thickness of lines seems to be
handled by drawing perpendiculars along the line, and the effect is that
when the derivative of the line is small, the lines *appear* further apart
then when the derivative is large.  When plotting a family of sine waves
separated only by constants, this definitely gives the wrong impression.  Of
course, I can try to force the lines to be right on top of each other:

plt.figure(2)
ymid = y1 + shift/2.0
yhigh = ymid + shift
ylow = ymid - shift
plt.fill_between(x,ymid,yhigh, color=(0,1,0))
plt.fill_between(x,ymid,ylow, color=(1,0,0))

But this has the undesirable effect that the thickness of the lines appears
non-uniform.

What I am after is a way to draw lines separated by constant values such
that the thickness of the lines appears constant AND such that the thickness
of the distance between the lines also appears constant.  It seems that this
could be done if the thickness of the line varied (in just the right way) as
a function of the derivative of the line.  I could also achieve this if I
doubled the line thickness and was able to color the top and bottom halves
of the thick lines different colors.

Is there a nice way to do this?
--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] One more question regarding to boxplotting

2009-05-12 Thread Josh Hemann


Gökhan SEVER-2 wrote:
 
 For some reason on boxplot 3 and 5 on the figure I get fliers instead of
 whiskers on the lower parts. 
 

When I look closely at your graphic it looks to me like the lower whiskers
are in fact being plotted, but just (essentially) overlayed on lower
quartile part of the interquartile box. What do you see if you only plot
d[2][8:] with no other boxes? Perhaps showing only one of the problem boxes
will allow the Y axis resolution to be such that you can see this effect
easier... 
-- 
View this message in context: 
http://www.nabble.com/One-more-question-regarding-to-boxplotting-tp23508395p23514606.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] One more question regarding to boxplotting

2009-05-12 Thread Gökhan SEVER
I zoomed into the plot to see if the whiskers are usually being plotted.
There seems like a vertical line plotted over lower part of the boxplot,
however not in the right place.

I am attaching the simple text file that has the quartile values in it. I
run ipython --pylab and do the following for a simple test.

d = loadtxt('tas', skiprows=2)

# for a one line testing
boxplot(d[0][8:])

# all boxplots in one plot
 boxplot([d[i][8:] for i in range(12)])


Gökhan


On Tue, May 12, 2009 at 10:05 PM, Josh Hemann jhem...@vni.com wrote:



 Gökhan SEVER-2 wrote:
 
  For some reason on boxplot 3 and 5 on the figure I get fliers instead of
  whiskers on the lower parts.
 

 When I look closely at your graphic it looks to me like the lower whiskers
 are in fact being plotted, but just (essentially) overlayed on lower
 quartile part of the interquartile box. What do you see if you only plot
 d[2][8:] with no other boxes? Perhaps showing only one of the problem boxes
 will allow the Y axis resolution to be such that you can see this effect
 easier...
 --
 View this message in context:
 http://www.nabble.com/One-more-question-regarding-to-boxplotting-tp23508395p23514606.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.



 --
 The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
 production scanning environment may not be a perfect world - but thanks to
 Kodak, there's a perfect scanner to get the job done! With the NEW KODAK
 i700
 Series Scanner you'll get full speed at 300 dpi even with all image
 processing features enabled. http://p.sf.net/sfu/kodak-com
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



tas
Description: Binary data
--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users