@@ -153,10 +153,16 @@ def open_axes(self, ax, props):
153153self .axis_ct += 1
154154# set defaults in axes
155155xaxis = go .layout .XAxis (
156- anchor = "y{0}" .format (self .axis_ct ),zeroline = False ,ticks = "inside" ,linecolor = "black"
156+ anchor = "y{0}" .format (self .axis_ct ),
157+ zeroline = False ,
158+ ticks = "inside" ,
159+ linecolor = "black" ,
157160 )
158161yaxis = go .layout .YAxis (
159- anchor = "x{0}" .format (self .axis_ct ),zeroline = False ,ticks = "inside" ,linecolor = "black"
162+ anchor = "x{0}" .format (self .axis_ct ),
163+ zeroline = False ,
164+ ticks = "inside" ,
165+ linecolor = "black" ,
160166 )
161167# update defaults with things set in mpl
162168mpl_xaxis ,mpl_yaxis = mpltools .prep_xy_axis (
@@ -199,7 +205,6 @@ def close_axes(self, ax):
199205self .x_is_mpl_date = False
200206
201207def draw_bars (self ,bars ):
202-
203208# sort bars according to bar containers
204209mpl_traces = []
205210for container in self .bar_containers :
@@ -300,7 +305,7 @@ def draw_bar(self, coll):
300305 )# TODO ditto
301306if len (bar ["x" ])> 1 :
302307self .msg += " Heck yeah, I drew that bar chart\n "
303- self .plotly_fig .add_trace (bar ),
308+ self .plotly_fig .add_trace (bar )
304309if bar_gap is not None :
305310self .plotly_fig ["layout" ]["bargap" ]= bar_gap
306311else :
@@ -498,13 +503,13 @@ def draw_marked_line(self, **props):
498503marked_line ["x" ]= mpltools .mpl_dates_to_datestrings (
499504marked_line ["x" ],formatter
500505 )
501- self .plotly_fig .add_trace (marked_line ),
506+ self .plotly_fig .add_trace (marked_line )
502507self .msg += " Heck yeah, I drew that line\n "
503508elif props ["coordinates" ]== "axes" :
504509# dealing with legend graphical elements
505510self .draw_legend_shapes (mode = mode ,shape = shape ,** props )
506511else :
507- self .msg += " Line didn't have 'data' coordinates," " not drawing\n "
512+ self .msg += " Line didn't have 'data' coordinates, not drawing\n "
508513warnings .warn (
509514"Bummer! Plotly can currently only draw Line2D "
510515"objects from matplotlib that are in 'data' "
@@ -568,7 +573,7 @@ def draw_path_collection(self, **props):
568573self .msg += " Drawing path collection as markers\n "
569574self .draw_marked_line (** scatter_props )
570575else :
571- self .msg += " Path collection not linked to 'data'," " not drawing\n "
576+ self .msg += " Path collection not linked to 'data', not drawing\n "
572577warnings .warn (
573578"Dang! That path collection is out of this "
574579"world. I totally don't know what to do with "
@@ -669,9 +674,7 @@ def draw_text(self, **props):
669674else :# just a regular text annotation...
670675self .msg += " Text object is a normal annotation\n "
671676if props ["coordinates" ]!= "data" :
672- self .msg += (
673- " Text object isn't linked to 'data' " "coordinates\n "
674- )
677+ self .msg += " Text object isn't linked to 'data' coordinates\n "
675678x_px ,y_px = (
676679props ["mplobj" ].get_transform ().transform (props ["position" ])
677680 )
@@ -681,7 +684,7 @@ def draw_text(self, **props):
681684xanchor = props ["style" ]["halign" ]# no difference here!
682685yanchor = mpltools .convert_va (props ["style" ]["valign" ])
683686else :
684- self .msg += " Text object is linked to 'data'" " coordinates\n "
687+ self .msg += " Text object is linked to 'data' coordinates\n "
685688x ,y = props ["position" ]
686689axis_ct = self .axis_ct
687690xaxis = self .plotly_fig ["layout" ]["xaxis{0}" .format (axis_ct )]
@@ -757,9 +760,7 @@ def draw_title(self, **props):
757760 """
758761self .msg += " Attempting to draw a title\n "
759762if len (self .mpl_fig .axes )> 1 :
760- self .msg += (
761- " More than one subplot, adding title as " "annotation\n "
762- )
763+ self .msg += " More than one subplot, adding title as annotation\n "
763764x_px ,y_px = props ["mplobj" ].get_transform ().transform (props ["position" ])
764765x ,y = mpltools .display_to_paper (x_px ,y_px ,self .plotly_fig ["layout" ])
765766annotation = go .layout .Annotation (
@@ -777,9 +778,7 @@ def draw_title(self, **props):
777778 )
778779self .plotly_fig ["layout" ]["annotations" ]+= (annotation ,)
779780else :
780- self .msg += (
781- " Only one subplot found, adding as a " "plotly title\n "
782- )
781+ self .msg += " Only one subplot found, adding as a plotly title\n "
783782self .plotly_fig ["layout" ]["title" ]= props ["text" ]
784783title_font = dict (
785784size = props ["style" ]["fontsize" ],color = props ["style" ]["color" ]