AttributeError: 'AxesSubplot' object has no attribute 'set_ylable'

Hi, All

I am trying to add ylable to:

ax1 = plt.subplot2grid((1,3), (0,0), colspan=2)

But got the following error: no ‘set_ylable’;

Here is my code:

import matplotlib.pyplot as plt

import numpy as np

ax1 = plt.subplot2grid((1,3), (0,0), colspan=2)

ax2 = plt.subplot2grid((1,3), (0,2), colspan=1)

N = 2

Spot = (6.29, 3.47)

Avg = (20.11,18.47)

Ody = (6.39,3.98)

Medium = (6.7,6.12)

ind = np.arange(N)+0.10 # the x locations for the groups

width = 0.15 # the width of the bars

ax1.bar(ind, Spot, width, color=‘0.35’,hatch="\")

ax1.bar(ind+width, Avg, width, color=‘0.55’,hatch="//")

ax1.bar(ind+2*width, Ody, width, color=‘0.75’,hatch="+")

ax1.bar(ind+3*width, Medium, width, color=‘0.15’,hatch=".")

ax1.set_xticks(ind+2*width)

ax1.set_xticklabels((‘Static’, ‘Dynamic’))

#ax1.set_ylable(“Incorrect Decision Ratio (%)”)

Regards!
Yu

lable --> label

Fix that, and it will work.

Ben Root

···

On Tuesday, November 15, 2011, Y.Wu <ywu198@…287…> wrote:

Hi, All
I am trying to add ylable to:
ax1 = plt.subplot2grid((1,3), (0,0), colspan=2)

But got the following error: no ‘set_ylable’;
Here is my code:
import matplotlib.pyplot as plt
import numpy as np
ax1 = plt.subplot2grid((1,3), (0,0), colspan=2)
ax2 = plt.subplot2grid((1,3), (0,2), colspan=1)

N = 2
Spot = (6.29, 3.47)
Avg = (20.11,18.47)
Ody = (6.39,3.98)
Medium = (6.7,6.12)
ind = np.arange(N)+0.10 # the x locations for the groups
width = 0.15 # the width of the bars

ax1.bar(ind, Spot, width, color=‘0.35’,hatch="\")
ax1.bar(ind+width, Avg, width, color=‘0.55’,hatch="//")
ax1.bar(ind+2*width, Ody, width, color=‘0.75’,hatch="+")

ax1.bar(ind+3width, Medium, width, color=‘0.15’,hatch=".")
ax1.set_xticks(ind+2
width)
ax1.set_xticklabels((‘Static’, ‘Dynamic’))
#ax1.set_ylable(“Incorrect Decision Ratio (%)”)

Regards!
Yu

Much appreciated!

It works!

Regards!
Yu

···

On Tue, Nov 15, 2011 at 10:13 PM, Benjamin Root <ben.root@…1304…> wrote:

On Tuesday, November 15, 2011, Y.Wu <ywu198@…120…287…> wrote:

Hi, All
I am trying to add ylable to:

ax1 = plt.subplot2grid((1,3), (0,0), colspan=2)

But got the following error: no ‘set_ylable’;
Here is my code:
import matplotlib.pyplot as plt
import numpy as np
ax1 = plt.subplot2grid((1,3), (0,0), colspan=2)
ax2 = plt.subplot2grid((1,3), (0,2), colspan=1)

N = 2
Spot = (6.29, 3.47)
Avg = (20.11,18.47)
Ody = (6.39,3.98)
Medium = (6.7,6.12)
ind = np.arange(N)+0.10 # the x locations for the groups
width = 0.15 # the width of the bars

ax1.bar(ind, Spot, width, color=‘0.35’,hatch="\")
ax1.bar(ind+width, Avg, width, color=‘0.55’,hatch="//")
ax1.bar(ind+2*width, Ody, width, color=‘0.75’,hatch="+")

ax1.bar(ind+3width, Medium, width, color=‘0.15’,hatch=".")
ax1.set_xticks(ind+2
width)
ax1.set_xticklabels((‘Static’, ‘Dynamic’))
#ax1.set_ylable(“Incorrect Decision Ratio (%)”)

Regards!
Yu

lable --> label

Fix that, and it will work.

Ben Root