[matplotlib-devel] figure output a la gnuplot or Inkscape: graphic and latex text files separately

2014-01-18 Thread Mauricio Calvao
Hi

I would like to know whether it is possible to save a simple (or complex,
for that matter) figure in 2 files, such that one of them contains, for
instance, the lines or points or surfaces ("graphics") typically in pdf
format and the other contains the whole text of the figure (labels,
numbers, title, annotations, etc). This is achievable in gnuplot via its
epslatex terminal and is highly convenient, in the sense that the fonts of
the figure match exactly the fonts (size, family, etc) of the main text in
which it will be embedded; even if we resize the figure, the corresponding
text, in perfect beautiful Latex, will match the surrounding main body text
of the master document. This is also possible with Inkscape and its
PDF+Latex saving option.

Is this possible with matplotlib or are there any workarounds?

-- 
###
Prof. Mauricio Ortiz Calvao
Federal University of Rio de Janeiro
Institute of Physics, P O Box 68528
CEP 21941-972 Rio de Janeiro, RJ
Brazil

Email: [email protected]
Phone: (55)(21)25627483
Homepage: http://www.if.ufrj.br/~orca
###
--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] animation of a fill_between region

2014-02-01 Thread Mauricio Calvao
Hi there,

I have the following simple code to plot a (static)  fill_between region in
a given plot.


import numpy as np
import matplotlib. pyplot as plt

plt.figure()
ax=plt.axes()
ax.set_xlim([0,1])

x = np.linspace(6000.,7000.)
y = np.ones(np.shape(x))

plt.fill_between(x,y)


I would like now to animate this band (which is a PolyCollection object,
and not a Line2D one) so that it moves smoothly to the right up together
with being stretched, that is, to the new x positions: .7200, 8400. I saw
several animations in the matplotlib homepage, but they only looped over
line or image objects, not polycollection ones, such as fill_between... Is
this possible?

In stackoverflow there is this link:
http://stackoverflow.com/questions/16120801/matplotlib-animate-fill-between-shape,
which might solve this question but I was not able to understand it fully
in order to have a simple minmal working example. If that is the right
direction, I would appreciate immensely if someone could provide such an
example!

Thanks in advance

-- 
###
Prof. Mauricio Ortiz Calvao
Federal University of Rio de Janeiro
Institute of Physics, P O Box 68528
CEP 21941-972 Rio de Janeiro, RJ
Brazil

Email: [email protected]
Phone: (55)(21)25627483
Homepage: http://www.if.ufrj.br/~orca
###
--
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] animation of a fill_between region

2014-02-02 Thread Mauricio Calvao
Thank you Jake.

I will take a look at this example with care.

Cheers!


On Sun, Feb 2, 2014 at 2:10 PM, Jacob Vanderplas
wrote:

> Hi Mauricio,
> Patch objects are a bit more difficult to work with than line objects,
> because unlike line objects are a step removed from the input data supplied
> by the user.  There is an example similar to what you want to do here:
> http://matplotlib.org/examples/animation/histogram.html
>
> Basically, you need to modify the vertices of the path at each frame.  It
> might look something like this:
>
> from matplotlib import animation
> import numpy as np
> import matplotlib.pyplot as plt
>
> fig, ax = plt.subplots()
> ax.set_xlim([0,1])
>
> x = np.linspace(6000.,7000., 5)
> y = np.ones_like(x)
>
> collection = plt.fill_between(x, y)
>
> def animate(i):
> path = collection.get_paths()[0]
> path.vertices[:, 1] *= 0.9
>
> animation.FuncAnimation(fig, animate,
> frames=25, interval=30)
>
> Take a look at path.vertices to see how they're laid out.
> Hope that helps,
>Jake
>
>
> On Sat, Feb 1, 2014 at 7:44 AM, Mauricio Calvao wrote:
>
>> Hi there,
>>
>> I have the following simple code to plot a (static)  fill_between region
>> in a given plot.
>>
>>
>> import numpy as np
>> import matplotlib. pyplot as plt
>>
>> plt.figure()
>> ax=plt.axes()
>> ax.set_xlim([0,1])
>>
>> x = np.linspace(6000.,7000.)
>> y = np.ones(np.shape(x))
>>
>> plt.fill_between(x,y)
>>
>>
>> I would like now to animate this band (which is a PolyCollection object,
>> and not a Line2D one) so that it moves smoothly to the right up together
>> with being stretched, that is, to the new x positions: .7200, 8400. I saw
>> several animations in the matplotlib homepage, but they only looped over
>> line or image objects, not polycollection ones, such as fill_between... Is
>> this possible?
>>
>> In stackoverflow there is this link:
>> http://stackoverflow.com/questions/16120801/matplotlib-animate-fill-between-shape,
>> which might solve this question but I was not able to understand it fully
>> in order to have a simple minmal working example. If that is the right
>> direction, I would appreciate immensely if someone could provide such an
>> example!
>>
>> Thanks in advance
>>
>> --
>> ###
>> Prof. Mauricio Ortiz Calvao
>> Federal University of Rio de Janeiro
>> Institute of Physics, P O Box 68528
>> CEP 21941-972 Rio de Janeiro, RJ
>> Brazil
>>
>> Email: [email protected]
>> Phone: (55)(21)25627483
>> Homepage: http://www.if.ufrj.br/~orca
>> ###
>>
>>
>> --
>> WatchGuard Dimension instantly turns raw network data into actionable
>> security intelligence. It gives you real-time visual feedback on key
>> security issues and trends.  Skip the complicated setup - simply import
>> a virtual appliance and go from zero to informed in seconds.
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
>> ___
>> Matplotlib-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>>
>>
>


-- 
###
Prof. Mauricio Ortiz Calvao
Federal University of Rio de Janeiro
Institute of Physics, P O Box 68528
CEP 21941-972 Rio de Janeiro, RJ
Brazil

Email: [email protected]
Phone: (55)(21)25627483
Homepage: http://www.if.ufrj.br/~orca
###
--
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel