![]() Why does my plot freeze/not show in matplotlib outside of Spyder.Labels += ] + ] # SKIP 1ST AND 3RD ITEMS (LEGEND TITLE, 'period')įull Code Legend Plot (colors/palette need adjustment)īar and Line Plot (colors/palette need adjustment) Handles += ] + ] # SKIP 1ST AND 3RD ITEMS (LEGEND TITLE, 'period') Temp_handles, temp_labels = temperature_ax.get_legend_handles_labels() Historic_handles, historic_labels = historic_ax.get_legend_handles_labels() Handles, labels = current_ax.get_legend_handles_labels() Temperature_ax.tick_params(axis='y', color=historic_color) Temperature_ax = sns.lineplot(x=time_label, y=temp_label, hue='period', data=historic_data_frame, sort=False, palette=) Temperature_ax.tick_params(axis='y', color=current_color) Temperature_ax = sns.lineplot(x=time_label, y=temp_label, hue='period', data=current_data_frame, sort=False, palette=) get_legend().remove() to remove from original plot) temperature_ax.set_ylabel(f'Temperature ', fontsize=16,) ![]() Historic_ax = sns.barplot(ax=historic_ax, x=time_label, y=unit, hue='period', data=historic_data_frame, palette=historic_palette, color=historic_color, alpha=.7) get_legend().remove() to remove from original plot) current_ax = sns.barplot(ax=current_ax, x=time_label, y=unit, hue='period', data=current_data_frame, palette=current_palette, color=current_color, )Ĭurrent_ax.t_color('red')Ĭurrent_ax.t_alpha(0.3) Historic_data_frame = pd.DataFrame(historic_data).assign(period='historic')īarplot (call. Adjust process with understanding of above hue and mpatches labels issues.ĭata (add period column for hue argument) current_data_frame = pd.DataFrame(current_data).assign(period='current') Additionally, while the mpatches section populates handles, you keep labels empty and not being equal in length, no legend is rendered in final.Ĭonsider adjustments to your current code by sections (full code in link at bottom). Therefore, your handles and labels originate empty.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |