Docstring
(price_by_date)
| 1084 | |
| 1085 | @_print_source |
| 1086 | def _second_axis_example(price_by_date): |
| 1087 | """Docstring""" |
| 1088 | # Initialize chart with second_y_axis=True |
| 1089 | ch = chartify.Chart( |
| 1090 | blank_labels=True, |
| 1091 | x_axis_type="datetime", |
| 1092 | y_axis_type="linear", |
| 1093 | second_y_axis=True, |
| 1094 | ) |
| 1095 | ch.set_title("Second Y axis") |
| 1096 | # Plot the first axis |
| 1097 | ch.plot.line(data_frame=price_by_date, x_column="date", y_column="total_price") |
| 1098 | ch.axes.set_yaxis_range(0, 50) |
| 1099 | ch.axes.set_yaxis_label("First axis label") |
| 1100 | ch.axes.set_yaxis_tick_format("0a") |
| 1101 | |
| 1102 | # Plot the second axis |
| 1103 | ch.second_axis.axes.set_yaxis_range(0, 80) |
| 1104 | ch.second_axis.axes.set_yaxis_label("Second axis label") |
| 1105 | ch.second_axis.plot.line( |
| 1106 | # Data must be sorted by x column |
| 1107 | data_frame=price_by_date, |
| 1108 | x_column="date", |
| 1109 | y_column="triple_total_price", |
| 1110 | ) |
| 1111 | ch.second_axis.axes.set_yaxis_tick_format("0.0") |
| 1112 | ch.show(_OUTPUT_FORMAT) |
| 1113 | |
| 1114 | |
| 1115 | @_print_source |
no test coverage detected