question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

title for adjoint layouts is applied to each element

See original GitHub issue
x_vals = .3*np.random.normal(size=500)+5
y_vals = np.random.normal(size=500)
h=\
hv.Scatter((x_vals,y_vals)).redim.range(x=(0,10))<<\
hv.Distribution( y_vals, 'y').options(width=150)<<\
hv.Distribution( x_vals, 'x').options(height=150)
h.relabel('Title')

results in the title to be applied to each hv Element in the plot

Adding a Div to insert a title runs into width/height issues: The Div below does not start at the same left hand side as the plot, and there appears to be an additional element off to the top right:

x_vals = .3*np.random.normal(size=500)+5
y_vals = np.random.normal(size=500)

def plot():
    if hv.Store.current_backend == 'matplotlib':
        o_rgt = {'aspect':0.5}
        o_top = {'aspect':2.5}
        h1=\
        (hv.Scatter((x_vals,y_vals)).redim.range(x=(0,10))<<\
        hv.Distribution( y_vals, 'y').options(**o_rgt)<<\
        hv.Distribution( x_vals, 'x').options(**o_top))
    else:
        o_rgt = {'width' :150}
        o_top = {'height':150}
        h1=\
        hv.Div('<div style=\"color:black;background-color:#88FF88;text-align:center;font-size:20px">Overall Title</div>').options(height=10,width=450)+\
        (hv.Scatter((x_vals,y_vals)).redim.range(x=(0,10))<<\
        hv.Distribution( y_vals, 'y').options(**o_rgt)<<\
        hv.Distribution( x_vals, 'x').options(**o_top))
        h1 = h1.cols(1)
    return h1.relabel('PLOT')

print('BOKEH')
renderer = hv.Store.renderers['bokeh'].instance(fig='png', holomap='auto')
renderer.save(plot(),'/tmp/aaa')
hv.Store.current_backend='matplotlib'
print('MATPLOTLIB')
renderer = hv.Store.renderers['matplotlib'].instance(fig='svg', holomap='gif')
renderer.save(plot(),'/tmp/bbb')
print('BOKEH in the notebook')
hv.Store.current_backend='bokeh'
plot()

Relabeling the topmost plot does work in bokeh; note the layout problems when viewed with say eog in Linux

aaa

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
TomBugnoncommented, Nov 30, 2018

Any activity on this? I can’t figure out how set a title on an AdjointLayout. Calling adjointlayout.relabel or adjointlayout.opts(...) throws TypeError: __init__() got an unexpected keyword argument 'cdims' Help would be much appreciated

0reactions
wmaynercommented, Nov 21, 2019

I’m having the same problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

title for adjoint layouts is applied to each element #2816 - GitHub
Any activity on this? I can't figure out how set a title on an AdjointLayout. Calling adjointlayout.relabel or adjointlayout.opts(...) throws ...
Read more >
Lie groups and Lie algebras: The adjoint representation
We introduce the adjoint representation and find the weight diagrams for the adjoint representations of sl(2,C) and sl(3,C).
Read more >
Expansion of the Nodal-Adjoint Method for Simple and ... - NCBI
The paper focuses on the calculation of the Jacobian matrix as an expansion of the nodal adjoint technique with respect to its accuracy...
Read more >
The Adjoint Variable Method for Computational ... - MDPI
On the one hand, The continuous approach aims to compute the derivatives from the partial differential equations (PDE) defining the physical system; the ......
Read more >
How do you identify a title element in ArcGIS Pro layouts?
I used this in ArcGIS Desktop: , but since there are many layouts per project in ArcGIS Pro, this doesn't work, and there...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found