[Matplotlib-users] Latex: \color command works only with "PS" backend

2013-11-13 Thread suinonatante
Hi,

i'm trying to use "\color" command in text (setting 'text.usetex' = True and
rc('text.latex', preamble='\usepackage{color}')) to color only a part of
entire string;
it works with PS backend, with other backends font color is overwritten by
default rc color.
is it a bug? is there a way to use "\color" with other backends?

thanks in advance.



--
View this message in context: 
http://matplotlib.1069221.n5.nabble.com/Latex-color-command-works-only-with-PS-backend-tp42490.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

--
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Outline for histogram bars

2013-11-13 Thread Benjamin Root
On Tue, Nov 12, 2013 at 8:01 PM, Ted To  wrote:

> Perfect!  Many thanks!  Seems to be an undocumented feature...
>
>
Not undocumented. In the docs for hist(), it says that it accepts any
parameter that is used for Patch artists. This is also generally true for
many of the other plotting functions. They usually take any additional
keyword arguments that could be passed on to whatever the artist is that is
returned. This isn't a hard-and-fast rule, but it is true more often than
not.



> Out of curiosity, what is the rationale behind using 'dashed' and
> 'dashdot' instead of '--' and '-.'?
>
>
This is an inadvertent oversight. I noted this in
https://github.com/matplotlib/matplotlib/issues/2136

Cheers!
Ben Root
--
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] No scroll_event with Gtk3Agg Backend

2013-11-13 Thread Patrick Birnzain
Hello everyone,

so I've run into a bit of a problem while embedding a matplotlib plot
into a GTK3 application. Everything's working fine as always, except
the scroll_event seems to get stuck somewhere and my callback is never
called. The button_press_event works.

Apologies in advance if I missed something, but something somewhere
doesn't seem to be quite right. Please let me know if I need to file a
bug report?

Minimal example to demonstrate the problem: [1]
With pyplot it works just fine: [2]

Regards,
Patrick


[1] GTK3Agg minimal example
from gi.repository import Gtk, Gdk
from matplotlib.figure import Figure
from matplotlib.backends.backend_gtk3agg import FigureCanvasGTK3Agg as FigCanvas

def on_press(canvas, event):
print "press!"

def on_scroll(canvas, event):
print "scroll!"

window = Gtk.Window()
window.connect("delete-event", Gtk.main_quit)

figure = Figure(figsize=(5,4), dpi=100)
plot = figure.add_subplot(111)
plot.plot([0,0.5,2])

canvas = FigCanvas(figure)
canvas.connect('button_press_event', on_press)
canvas.connect('scroll_event', on_scroll)

window.add(canvas)
window.show_all()
Gtk.main()

[2] pyplot minimal example
import matplotlib.pyplot as plt

plt.plot([0,0.5,2])
fig = plt.gcf()

def on_click(event):
print "press!"

def on_scroll(event):
print "scroll!"

fig.canvas.mpl_connect('button_press_event', on_click)
fig.canvas.mpl_connect('scroll_event', on_scroll)

plt.show()

--
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Scatterplot c arg and NaN values, autonomous underwater vehicle

2013-11-13 Thread robertdcurrier
I've pulled my hair out for the past day trying to solve this problem and
have done extensive searches to no avail. Here's my situation:

I have data from an autonomous underwater vehicle. I have three np arrays to
plot:
1) time on the x axis
2) vehicle depth on the y axis
3) sensor reading to set the color for the scatter plot at time/depth point.

Unfortunately for me the vehicle reports sensors at different rates which
means that I might have a time and depth stamp with a 'NaN' for the sensor
value. The x/y portion of scatter deals with the NaNs with no problem, but
when I call scatter(time, depth, c=mySensorArray) and mySensorArray contains
a 'NaN'  matplotlib borks.   I have not been able to come up with a method
to allow the values of the sensor being plotted to set the color of the
scatter or skip the entry when the value is a 'NaN'.  

What complicates the matter is that we're only gathering data on the upward
profile of the vehicle. Until recently we collected data on both up and down
legs of the Yo, so I was able to simply interpolate and fill in the NaN
values with the interpolated result and achieve gorgeous scatter plots. That
doesn't work when the data stops being gathered at the top of the Yo...
interpolating simply repeats the last value all the way back down to the
bottom when data values start getting collected again. 

Thanks for any pointers... I'm really stumped.

Bob Currier



--
View this message in context: 
http://matplotlib.1069221.n5.nabble.com/Scatterplot-c-arg-and-NaN-values-autonomous-underwater-vehicle-tp42494.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

--
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Scatterplot c arg and NaN values, autonomous underwater vehicle

2013-11-13 Thread Eric Firing
On 2013/11/13 11:40 AM, robertdcurrier wrote:
> I've pulled my hair out for the past day trying to solve this problem and
> have done extensive searches to no avail. Here's my situation:
>
> I have data from an autonomous underwater vehicle. I have three np arrays to
> plot:
> 1) time on the x axis
> 2) vehicle depth on the y axis
> 3) sensor reading to set the color for the scatter plot at time/depth point.
>
> Unfortunately for me the vehicle reports sensors at different rates which
> means that I might have a time and depth stamp with a 'NaN' for the sensor
> value. The x/y portion of scatter deals with the NaNs with no problem, but
> when I call scatter(time, depth, c=mySensorArray) and mySensorArray contains
> a 'NaN'  matplotlib borks.   I have not been able to come up with a method
> to allow the values of the sensor being plotted to set the color of the
> scatter or skip the entry when the value is a 'NaN'.

mySensorArray = np.ma.masked_invalid(mySensorArray)

Eric


--
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Outline for histogram bars

2013-11-13 Thread Ted To
Thanks Ben!

I was wondering if you can help me with a related question.  How does
one change the artist for the legend?  Since I have a "step" histogram,
it would be nice to have the legend display lines rather than outlined
rectangles.

Thanks,
Ted

On 11/13/2013 09:35 AM, Benjamin Root wrote:
> 
> 
> 
> On Tue, Nov 12, 2013 at 8:01 PM, Ted To  > wrote:
> 
> Perfect!  Many thanks!  Seems to be an undocumented feature...
> 
> 
> Not undocumented. In the docs for hist(), it says that it accepts any
> parameter that is used for Patch artists. This is also generally true
> for many of the other plotting functions. They usually take any
> additional keyword arguments that could be passed on to whatever the
> artist is that is returned. This isn't a hard-and-fast rule, but it is
> true more often than not.
> 
>  
> 
> Out of curiosity, what is the rationale behind using 'dashed' and
> 'dashdot' instead of '--' and '-.'?
> 
> 
> This is an inadvertent oversight. I noted this in
> https://github.com/matplotlib/matplotlib/issues/2136
> 
> Cheers!
> Ben Root

--
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users