-
-
Notifications
You must be signed in to change notification settings - Fork 402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed title formatter in GenericElementPlot #4061
Conversation
This is great! I was about to use |
Hm, I didn't check actually. (I wanted to wait for feedback on whether we should simplify the |
So the idea was that |
Ok I'm having a look at combining the two. |
Done @philippjfr. MWE to play around with it:
|
Thanks! Looking much better to me. Any chance of adding some tests? |
Oh I'm also happy to start adding a deprecation warning for |
I'll look at the tests later. I guess we'd need some for a simple Element, a Layout, and an Overlay, and for all backends? (The code should not depend on backend so one could get away with only one I guess.) |
That seems fine. |
I've added tests for the bokeh backend. |
* fixed indentation mistake * moved general part of _format_title into DimensionedPlot * add deprecation warning * friendlier deprecation warning * tests for NdLayout and Element
Before:
After:
This said, I would also like to point out that the
_format_title
methods ofGenericElementPlot
andGenericCompositePlot
look pretty similar, and both classes directly derive fromDimensionedPlot
, yet when bothtitle
andtitle_format
are set, one falls back totitle
, the other one totitle_format
. I don't know if there was a special reason why the two classes have separate implementations but I think the code could potentially be clearer.