MCPcopy Index your code
hub / github.com/plotly/plotly.py / draw_ylabel

Method draw_ylabel

plotly/matplotlylib/renderer.py:770–799  ·  view source on GitHub ↗

Add a yaxis label to the current subplot in layout dictionary. props.keys() -- [ 'text', (actual content string, not the text obj) 'position', (an x, y pair, not an mpl Bbox) 'coordinates', ('data', 'axes', 'figure', 'display') 'text_type', ('

(self, **props)

Source from the content-addressed store, hash-verified

768 self.plotly_fig["layout"][axis_key]["title_font"] = title_font
769
770 def draw_ylabel(self, **props):
771 """Add a yaxis label to the current subplot in layout dictionary.
772
773 props.keys() -- [
774 'text', (actual content string, not the text obj)
775 'position', (an x, y pair, not an mpl Bbox)
776 'coordinates', ('data', 'axes', 'figure', 'display')
777 'text_type', ('title', 'xlabel', or 'ylabel')
778 'style', (style dict, see below)
779 'mplobj' (actual mpl text object)
780 ]
781
782 props['style'].keys() -- [
783 'alpha', (opacity of text)
784 'fontsize', (size in points of text)
785 'color', (hex color)
786 'halign', (horizontal alignment, 'left', 'center', or 'right')
787 'valign', (vertical alignment, 'baseline', 'center', or 'top')
788 'rotation',
789 'zorder', (precedence of text when stacked with other objs)
790 ]
791
792 """
793 self.msg += " Adding ylabel\n"
794 axis_key = "yaxis{0}".format(self.axis_ct)
795 self.plotly_fig["layout"][axis_key]["title"] = props["text"]
796 title_font = dict(
797 size=props["style"]["fontsize"], color=props["style"]["color"]
798 )
799 self.plotly_fig["layout"][axis_key]["title_font"] = title_font
800
801 def resize(self):
802 """Revert figure layout to allow plotly to resize.

Callers 1

draw_textMethod · 0.95

Calls 1

formatMethod · 0.45

Tested by

no test coverage detected