sumo icon indicating copy to clipboard operation
sumo copied to clipboard

Feature request: `title` attribute: methods in `tools/visualization`

Open vijay-jaisankar opened this issue 3 years ago • 2 comments
trafficstars

Feature request:

  • Adding a title argument to the plotting methods that use matplotlib, by using the following code segment to enhance the plots:
plt.title(given_title)
  • For example, Linear graph in linear_graph
  • To maintain compatibility with the existing code, a default title (None) will be kept in the argument parsing routine.

If this seems like a good idea, please assign me to the same.

Thanks, Vijay

vijay-jaisankar avatar Sep 20 '22 15:09 vijay-jaisankar

the visualization helpers already have --title and plotXMLAttributes has --label. Which tools do you have in mind?

behrisch avatar Sep 21 '22 07:09 behrisch

I wish to add this in all files that use matplotlib for rendering plots, and do not use the helpers' label attributes.

More specifically, in:

  • plot_csv_bars.py (~Lines 113, 124)
  • plot_csv_timeline.py (~Line 91 - label is different to title in matplotlib)
  • plot_net_trafficLights.py (~Line 87)
  • plotXMLAttr.py (~Line 52)

vijay-jaisankar avatar Sep 21 '22 09:09 vijay-jaisankar

Maybe they could use the visualization helpers to avoid duplicate code?

behrisch avatar Sep 22 '22 10:09 behrisch

Thanks for the feedback and apologies for not working on this issue for some time. I have added a PR that corresponds to this issue, please check it out.

The Notes section of the write-up addresses your comment.

vijay-jaisankar avatar Oct 02 '22 13:10 vijay-jaisankar

Since title is available in the first three tools you mentioned and plotXMLAttr.py is deprecated and will be replaced by plotXMLAttributes, I propose to close this one as won't fix. @vijay-jaisankar Do you agree?

behrisch avatar Dec 22 '22 10:12 behrisch

Yes, I agree that this is the right step as the feature is covered in the existing code :)

Thanks for deprecating plotXMLAttr.py, it was very confusing as the functionality was very similar to that of plotXMLAttributes.py and caused a lot of confusion.

vijay-jaisankar avatar Dec 22 '22 17:12 vijay-jaisankar