XanaduAI / QMLT

The Quantum Machine Learning Toolbox (QMLT) is a Strawberry Fields application that simplifies the optimization of variational quantum circuits (also known as parametrized quantum circuits).
https://qmlt.readthedocs.io
Apache License 2.0
114 stars 23 forks source link

Plots scaling #3

Closed mstechly closed 6 years ago

mstechly commented 6 years ago

For some reason today my plots from QMLT started to look like this:

plot_version_1

I wasn't able to fix it, so I hacked it - in plot.py, _plot method I just changed ax.set_ylabel(ylabel) into ax.set_title(ylabel).

plot_version_2

Which actually is much easier to read than this rotated y_label - especially in the case of the long parameter names.

josh146 commented 6 years ago

Hi @mstechly, that's a good solution - it didn't show up in our testing because our parameter names were never large enough! Since you have already made the change your end, feel free to submit a small pull request with the change.

Another thing that comes to mind - at the moment, all default variables will be plotted against the step on the x axis. Originally, the plotting module was written to be more general - hence why 'global_step' is used for all x-axis labels. Do you think it would still be clear if this axis label was removed?

mstechly commented 6 years ago

Ok, I will do the PR - it will require some refactoring because this argument is called "y_label" and not "title" - I will come up with an appropriate solution.

Also, I wanted to point out that it worked properly with such long names earlier - I have no idea why it broke just today.

I think it will be clear, however, I'm not 100% sure. I will try to ask someone not involved for the opinion.