Multiple Plots Layout Weird Behavior
See original GitHub issueI have created a plot using multiple curves. Individual plots work fine. But when I try to display side by side it just mixes everything.
def get_line_chart(plot_data, agg, agg_by, variable_col, direction):
curves_list = []
xaix = sorted(plot_data[agg].dropna().drop_duplicates())
for turnDirection, data in plot_data.groupby([variable_col]):
curve = hv.Curve((data[agg], data[agg_by]), name=str(turnDirection), label=str(turnDirection)) \
.opts(xlabel=agg, xrotation=90, ylabel=agg_by)
curves_list.append(curve)
from functools import reduce
return reduce(lambda x, y: x * y, curves_list).opts(title=direction, width=700)
def create_plot(df1, maxIntersections, agg_present, agg_by, variable_col, outputFolder):
plots = []
for direction in ['East', 'West', 'North', 'South']:
filtered_data = df1[df1["inboundDir"] == direction]
plots.append(get_line_chart(filtered_data, agg_present[1], agg_by, variable_col, direction))
from functools import reduce
plot = hv.Layout(reduce(lambda x, y: x + y, plots)).cols(2)
hv.save(plot, outputFolder + 'WorstIntersectionsAreaPlot{0}.html'.format(variable_col))
This is normal NORTH plot
This is normal SOUTH plot
When I try to merge in a single view using + operator suddenly the second plot mixed up.
If I add multiple plots, 1st one behaves normally, all others are mixed up.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
[BUG] Strange behavior when plotting the same subplot ...
This specific case produce f1 and f2 just once each, on the diagonal. In more complex cases, we see highly irregular behavior.
Read more >r - Strange behaviour with actionButton, when I try to display multiple ...
However strangely I saw that, when User clicks actionButton , only one plot is displaying over the screen. However at the time of...
Read more >weird behavior of plot - Mathematica Stack Exchange
Sometimes I'm lazy or the code is temporary, and the constant is a number that appears in several places. In that case, I...
Read more >Odd Plotting Behavior with lymphGate flowStats
I believe this is just a plotting problem. The positive population in the workFlow appears to be the correct one, despite the median...
Read more >Problem with Plots or Graphics Device in the RStudio IDE
When legends, lines, text, or points are missing or "incorrectly" placed, this is often the result of R condensing the plot to fit...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’d also expect that using hvPlot all of your code reduces to some variation of:
As a separate note, this bit can be simplified from:
to:
and similarly you can just do: