multiscale / muscle3

The third major version of the MUltiScale Coupling Library and Environment
Apache License 2.0
25 stars 13 forks source link

Would it be possible to rotate the x-axis labels? #244

Closed DavidPCoster closed 11 months ago

DavidPCoster commented 1 year ago

Would it be possible to rotate the x-axis labels?

instances

As can be seen in the attached figure, understanding the x-axis is difficult ...

LourensVeen commented 1 year ago

I'm guessing these instances all run at the same time? That would lead to some overlap... :smiley:

Just kidding, you're right of course, and I think we can get matplotlib to rotate them. Maybe even add a heuristic to only rotate them when needed, although that may get tricky when zooming. Perhaps best to just always print them vertically.

DavidPCoster commented 1 year ago

I ended up with adding/changing in plot_instances:

ax.set_xlabel('Instance')
ax.tick_params(axis='x', labelrotation = 45)
for label in ax.xaxis.get_ticklabels():
    label.set_horizontalalignment('right')
ax.set_ylabel('Total time (s)')
ax.legend(loc='upper right')
plt.subplots_adjust(bottom=0.30)

to produce

instances_45deg

LourensVeen commented 1 year ago

Ah, that looks nice. Maybe I should also try to sort the instances, at least within the same component, so that they're ordered fusion_muscle3[0] to fusion_muscle3[9].

DavidPCoster commented 1 year ago

While the sorting would be nice, it is not that important to me since all of the fusion_muscle3's are equivalent in my eyes ...

DavidPCoster commented 1 year ago

Pull request created ...

LourensVeen commented 1 year ago

Merged #253, thanks!

I'm going to tag this ready for release now. I normally leave issues open until the fix has actually been released so that people can use it without extra work. We'll close it when the next release is out.

LourensVeen commented 11 months ago

Fix released with 0.7.1, please reopen if you encounter further issues.