Jae-Joon Lee | 1 Jun 2011 06:02
Picon
Gravatar

Re: bug in mpl_toolkits.axes_grid1.AxesGrid?

Using AxesGrid does not mean that color scales are shared. It only
takes care of axes placement. And it is your responsibility to sync
colorbars of multiple images.

One option is to use *norm* attribute of images.

   norm = matplotlib.colors.Normalize()

   for i in range(3):
       im = grid[i].imshow(Z, extent=extent, interpolation="nearest",
                           norm=norm)
   im = grid[3].imshow(1000 * Z, extent=extent, interpolation="nearest",
                       norm=norm)

Regards,

-JJ

On Wed, May 25, 2011 at 11:05 AM, Paul Anton Letnes
<paul.anton.letnes <at> gmail.com> wrote:
> Hi!
>
> I am wondering if there is a bug in:
> mpl_toolkits.axes_grid1.AxesGrid
>
> I am trying to run this example (I am of course working on something else, but I am trying to build a minimal
example of my problem):
> http://matplotlib.sourceforge.net/examples/axes_grid/demo_axes_grid.html
> This would be a very compact and nice way of showing my results, and I am beginning to love it. There is one
thing, though. Given the code attached at the end of this message, the two versions produce figures that
(Continue reading)

Jae-Joon Lee | 1 Jun 2011 06:23
Picon
Gravatar

Re: eps and useTex: tick labels drawn over legend box

I'm not 100% sure on this but it seems that this is a limitation of
"psfrag" that the ps backend relies on. The ps backend first produces
an eps file without TeX labels, and these TeX labels are put on the
eps file with latex+psfrag. And it seems  these TeX labels are always
above the contents of the eps file.

Unfortunately, I don't think this can be easily fixed.
Regards,

-JJ

On Wed, Jun 1, 2011 at 6:34 AM, Brannon <giltirn@...> wrote:
>
> Hi,
>
> I am having trouble with matplotlib 1.0.1 drawing the axis tick labels over
> the legend box in the eps output when useTex is set to true. The plot shown
> after calling plt.show() looks fine, as does the output in pdf, png, svg
> etc. Only the postscript appears to be affected.
>
> The following simple example produces the png and eps files given at the
> bottom of this post:
>
> import matplotlib as mpl
> import matplotlib.pyplot as plt
> from matplotlib import rc
>
> rc('text', usetex=True)
>
> g1 = plt.plot([1,2,3,4],[500,600,700,800])
(Continue reading)

Jae-Joon Lee | 1 Jun 2011 06:24
Picon
Gravatar

Re: eps and useTex: tick labels drawn over legend box

Just in case, I have opened a git issue on this.

https://github.com/matplotlib/matplotlib/issues/131

-JJ

On Wed, Jun 1, 2011 at 1:23 PM, Jae-Joon Lee <lee.j.joon <at> gmail.com> wrote:
> I'm not 100% sure on this but it seems that this is a limitation of
> "psfrag" that the ps backend relies on. The ps backend first produces
> an eps file without TeX labels, and these TeX labels are put on the
> eps file with latex+psfrag. And it seems  these TeX labels are always
> above the contents of the eps file.
>
> Unfortunately, I don't think this can be easily fixed.
> Regards,
>
> -JJ
>
>
> On Wed, Jun 1, 2011 at 6:34 AM, Brannon <giltirn <at> gmail.com> wrote:
>>
>> Hi,
>>
>> I am having trouble with matplotlib 1.0.1 drawing the axis tick labels over
>> the legend box in the eps output when useTex is set to true. The plot shown
>> after calling plt.show() looks fine, as does the output in pdf, png, svg
>> etc. Only the postscript appears to be affected.
>>
>> The following simple example produces the png and eps files given at the
>> bottom of this post:
(Continue reading)

Eric O LEBIGOT (EOL | 1 Jun 2011 11:49
Favicon

Re: Exact semantics of ion()??


Thank you for these precisions.

I think I'm starting to see more clearly what the
interactive/non-interactive modes do with pyplot commands (plot(), draw(),
show(),…), and with draw() methods.

There is only one thing that I'm not sure about: if we look at your script
and leave the ion() were you left it, shouldn't an ax.draw() be called just
before the ion()?  (I indeed understand from your last post that one "should
not rely" on "pyplot.figure()" sending a delayed draw() request to the GUI.)

So, to summarize the whole discussion:

* Interactive mode:

- Graph elements plotted with *pyplot* commands (not Matplotlib object
methods) are displayed without the need to use draw() or show().

- However, plots done through Matplotlib objects (like Axes) are normally
not displayed (even though they may be, with some backends).  The actual
display of such plots is done through their draw() method (or possibly
pyplot.draw()).  This feature might be used for optimization purposes (a
graph can be refreshed on screen once even though multiple updates were
performed on it through Matplotlib object method calls).

- show(), if used, is non-blocking.  It displays everything that was drawn()
(for instance figures that were created in non-interactive mode).  Things
that were not drawn() might be displayed by some backends, but one should
not rely on this.
(Continue reading)

Eric O LEBIGOT (EOL | 1 Jun 2011 11:52
Favicon

Re: Exact semantics of ion()??


PS: One could add to the non-interactive mode part that "pyplot.draw()" has
the same effect as drawing() everything (normally, this does not display
anything, but is necessary so that show() displays the drawn() elements). 
Right?
--

-- 
View this message in context: http://old.nabble.com/Exact-semantics-of-ion%28%29---tp31728909p31748078.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger. 
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today. 
http://p.sf.net/sfu/quest-sfdev2dev
Juan Luis Cano | 1 Jun 2011 10:44
Picon
Gravatar

gnuplot epslatex functionality in matplotlib

Hello everyone. I am used to plot data with gnuplot, so I can easily
put the figures in a LaTeX document, using the epslatex terminal. For
example:

    file = "data.dat"

    set terminal epslatex
    set output "figure1.tex"

    plot file

http://gnuplot-tricks.blogspot.com/2009/05/gnuplot-tricks-many-say-that-it-is.html#epslatex-terminal
http://www.gnuplotting.org/introduction/output-terminals/#epslatex

This way, two files are generated: one .eps file, which contains the
graphics, and one .tex file, which contains the text. The great
advantage of this is that text is rendered by LaTeX, so the tics,
labels, etc. have the same font as the rest of the document (using the
appropiate packages).

Now I am starting with matplotlib, which has a much nicer API, is more
scriptable and, well, is Python. But, even though I can make
matplotlib render the text with LaTeX, it gets embedded into the image
and I cannot achieve the same advantages I had with gnuplot.

Is there any way I can emulate the epslatex terminal in matplotlib?

Thank you very much!

------------------------------------------------------------------------------
(Continue reading)

madplot | 1 Jun 2011 13:12
Picon

Mapping colorbar to data


I'd really appreciate help on this, even though I'm new to matplotlib and
Nabble.

Consider the following lists:
[1537, 1686, 1858, 2113, 2832]
[1328, 2168]
with max value = 2850

For a colorbar with range 0 to max value and a colour gradient of blue,
green and red, I'd like to show green at y-axis values from the first list
and red at y-axis values from the second list. At any other value the bar
would be blue. Values from one list never occur in the other.

How would I go about accomplishing this?
--

-- 
View this message in context: http://old.nabble.com/Mapping-colorbar-to-data-tp31748555p31748555.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger. 
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today. 
http://p.sf.net/sfu/quest-sfdev2dev
Brannon | 1 Jun 2011 18:55
Picon

Re: eps and useTex: tick labels drawn over legend box


Hi Jae-Joon,

Thank you for your help. For the time being, I have discovered that using
pdf output and converting to eps using pdf2ps and ps2eps avoids this
problem.

Best,
Bran

Jae-Joon Lee wrote:
> 
> Just in case, I have opened a git issue on this.
> 
> https://github.com/matplotlib/matplotlib/issues/131
> 
> -JJ
> 
> 
> 
> On Wed, Jun 1, 2011 at 1:23 PM, Jae-Joon Lee <lee.j.joon <at> gmail.com> wrote:
>> I'm not 100% sure on this but it seems that this is a limitation of
>> "psfrag" that the ps backend relies on. The ps backend first produces
>> an eps file without TeX labels, and these TeX labels are put on the
>> eps file with latex+psfrag. And it seems  these TeX labels are always
>> above the contents of the eps file.
>>
>> Unfortunately, I don't think this can be easily fixed.
>> Regards,
>>
(Continue reading)

htaunay | 1 Jun 2011 20:41
Picon

Independent Legends


Is there anyway to set/create legends independent of what I am plotting?
Simply manually create, position and show legends, that not necessarily are
directly linked to the graph.

To be specific, I am plotting several points, in a scatter form,
individually, and depending on the given attributes, I manually set what
colour and marker each point will present. My intention is to create legends
that specify the categories of my data, in a way that I can manually define
what colour/marker they are linked to.

Thanks in advance for any help!
--

-- 
View this message in context: http://old.nabble.com/Independent-Legends-tp31752112p31752112.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger. 
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today. 
http://p.sf.net/sfu/quest-sfdev2dev
Juan Luis Cano | 2 Jun 2011 21:35
Picon
Gravatar

PSfrag support broken

Hi everyone, 


Yesterday I published a message when I still was a non-member asking about a way of get the same functionality in Matplotlib as with gnuplot epslatex terminal. After some exhaustive research, I found in the Cookbook (http://www.scipy.org/Cookbook/Matplotlib/LaTeX_Examples#head-b255327f7b89bb0fee34c3be7d2f6966ddc72739) that I could let LaTeX render the text using the PSfrag package. However, when I tried to reproduce the example, I discovered that it didn't work: after some more research, I stumbled upon a question in this mailing list (http://sourceforge.net/mailarchive/message.php?msg_id=27216075) where it became clear that, with some changes made to the output of PS files, PSfrag could not read the labels anymore. 

My questions are, assuming I am not doing anythinkg wrong (only copy&paste, I promise): Is there anyone working on this? Should I file a bug somewhere? Is there anything I can do?

Thank you in advance
------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Gmane