我有一个图表,它在4个不同的y轴刻度上显示多行。当我向侧面添加第二个y轴时,仅显示第一个轴的标签。如何显示第二轴标签?
示例:
from bokeh.models import Range1d, LinearAxis
from bokeh.plotting import figure
from bokeh.io import show, output_notebook
output_notebook()
fig = figure()
# Define x-axis
fig.xaxis.axis_label = 'Date'
# Define 1st LHS y-axis
fig.yaxis.axis_label = 'Pressure [barg]'
fig.y_range = Range1d(start=0, end=200)
# Create 2nd LHS y-axis
fig.extra_y_ranges['temp'] = Range1d(start=0, end=50)
fig.add_layout(LinearAxis(y_range_name='temp', axis_label='Temperature [°C]'), 'left')
# Create 1st RHS y-axis
fig.extra_y_ranges['lflow'] = Range1d(start=0, end=50000)
fig.add_layout(LinearAxis(y_range_name='lflow', axis_label='Liquid Flowrate [bbl/day]'), 'right')
# Create 2nd RHS y-axis
fig.extra_y_ranges['gflow'] = Range1d(start=0, end=50)
fig.add_layout(LinearAxis(y_range_name='gflow', axis_label='Gas Flowrate [MMscf/day]'), 'right')
fig.line(
x = [0,1,2,3,4,5],
y = [80,88,87,70,77,82],
legend = 'Pressure',
color = 'purple'
)
fig.line(
x = [0,1,2,3,4,5],
y = [5,6,5,5,5,4],
legend = 'Temperature',
y_range_name = 'temp',
color = 'red'
)
fig.line(
x = [0,1,2,3,4,5],
y = [10000,10100,10000,10150,9990,10000],
legend = 'Liquid Flowrate',
y_range_name = 'lflow',
color = 'orange'
)
fig.line(
x = [0,1,2,3,4,5],
y = [35,37,40,41,40,36],
legend = 'Gas Flowrate',
y_range_name = 'gflow',
color = 'green'
)
fig.toolbar_location = 'above'
show(fig)
从上面的示例中,仅显示压力和液体流量轴标签。如何显示温度和气体流量轴标签?