We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8983cdd commit 0fb2f19Copy full SHA for 0fb2f19
python/rsgislib/tools/plotting.py
@@ -727,13 +727,15 @@ def plot_vec_fields(
727
feat_y_vals = y_vals
728
729
if plt_line:
730
- ax.plot(feat_x_vals, feat_y_vals)
+ ax.plot(feat_x_vals, feat_y_vals, label=f"Feature {feat_id}")
731
else:
732
- ax.scatter(feat_x_vals, feat_y_vals)
+ ax.scatter(feat_x_vals, feat_y_vals, label=f"Feature {feat_id}")
733
734
ax.set_xlabel(x_lbl)
735
ax.set_ylabel(y_lbl)
736
ax.set_title(title)
737
+ if feat_id_field is not None:
738
+ plt.legend()
739
fig.tight_layout()
740
plt.savefig(out_plot_file)
741
0 commit comments