SweetBadger76 Thanks for your detailed response. I was able to receive the graph with the layout i wanted (the left image you sent). However the problem with this approach is that when comparing two experiments it will show me two separate graph which makes it harder to compare individual bars.
hi DistressedGoat23
can you send me an example of you report your histogram ?
i managed to transpose a histogram using something like this :
` t = Task.init(project_name=project_name, task_name=task_name)
df = px.data.tips()
figV = px.histogram(df, x="total_bill", y="tip", orientation='v')
figH = px.histogram(df, x="total_bill", y="tip", orientation='h')
log = t.get_logger()
log.report_plotly(
title='Histo',
series='plotlyH',
iteration=0,
figure=figH)
log.report_plotly(
title='Histo',
series='plotlyV',
iteration=0,
figure=figV) `
Could it work for your purpose ?
DistressedGoat23 notice the last argument in report_histogram, 'extra_layout'
https://clear.ml/docs/latest/docs/references/sdk/logger#report_histogram
You can then specify the plotly histogram orientation, full details here:
https://plotly.com/javascript/reference/bar/
I'm assuming the one you are after is 'orientation '
https://plotly.com/javascript/reference/bar/#bar-orientation
Hmm let me check, because I think it should have worked
AgitatedDove14 Thanks for you help. I've opened an issue.
SweetBadger76 Thanks for your elaborate example. Its very helpful!
AgitatedDove14 Your suggestion is probably what I wanted, however it does not seem to change the orientation.
I tried adding extra_layout={"orientation":'h'}
as the last parameter to the report_histogram but I still see the "vertical" (default) orientation. Should I pass some other parameter value to extra_layout
or should i report a bug?
DistressedGoat23 you are correct, since at the end this become a plotly object the extra_layout is for general purpose layout, but this specific entry is next to the data. Bottom line, can you open a github issue, so we do not forget to fix? In the mean time you can use the general plotly reporting as SweetBadger76 suggested
In the meantime, it is also possible to create a figure that will contain +2 histo and then report it to the logger using report_plotly.
You can have a look there :
https://plotly.com/python/histograms/#overlaid-histogram
https://plotly.com/python/histograms/#stacked-histograms
` log = task.get_logger()
x0 = np.random.randn(1500)
x1 = np.random.randn(1500) - 1
fig = go.Figure()
fig.add_trace(go.Histogram(y=x0))
fig.add_trace(go.Histogram(y=x1))
fig.update_layout(barmode='overlay') # 'stack'
fig.update_traces(opacity=0.75)
log.report_plotly(
title='Overlaid Histo (T)',
series='plotly (T)',
iteration=0,
figure=fig
) `