Haven't been able to find an example of tab layouts in Bokeh that I desire.
I have something that looks like the example: http://docs.bokeh.org/en/latest/docs/user_guide/interaction/widgets.html#tab-panes
However, I'd like to have the plots be able to 'expand' with the screen, ie have something like sizing_mode = scale_width, scale_height or stretch_both. I've tried playing with the toy tabs example that I posted above but cannot seem to get the plots to change size or I get a Bokeh Error unsatisfiable constraints.
Anyone have luck on making a panel layout with full screen plots?
Related
I am currently working on a data visualization web application with DashPlotly. My goal is to create "stylized" dashboards with DBC. I have a problem with the size of the plotly figures, they are "too zoomed". Indeed, the ideal rendering for me would be the rendering provided with the browser zoomed out to 67%. I attach a GIF to illustrate my point.
I wonder then if it is possible to have a less coarse rendering of plotly figures when the browser is zoomed to 100% ?
I specify that I work on a small screen (laptop 15") and I would like the rendering of the figures to be the same for all types of screens.
For this example I applied a css zoom directly on the DBC card but this is not a viable solution in the long run.
If someone has already encountered a similar problem, I'm interested ;)
Have a good day
I finally found a solution to my problem. What happens when you zoom out with the browser is that the font size of the elements in the figure decreases. So I simply reduced the font size of my plotly figures...
fig.update_layout(
font=dict(
size=12
)
)
I'm trying to create a list of plots one below the other, on the same axes.
I want to be able to scroll through the plots, and when resizing the view I want to display more plots rather than enlarging the existing plots.
I subclasses PlotWidget and tried to manipulate resizeEvent and sizePolicy and nothing worked.
Any idea?
Thanks
Update:
This is the initial view. When changing the window's height I get this.
What I'm trying to achieve is this.
Also, I would like to add a vertical scrollbar instead of vertical panning.
Update:
Apparently pyqtgraph isn't a good fit for what I'm trying to do. I ended up implementing with QGraphicsScene and QGraphicsView.
This is a bit of a stupid problem but I'm using plotly for a 3d Scatter plot, essentially tweaking the Les Miserables plot in the docs, and I've managed to put links to the Wikipedia page for each node in the node labels.
Essentially, I'm replacing this line (in block 6 on that tutorials page): labels.append(node['name'])
with this line:
labels.append('{}'.format(node['name'], node['name']))
Works like a charm! Except that when I hover over the node, the label appears, but then when I go to click the link in the label, the label disappears (because I have oh-so-slightly hovered off of the node).
Like I said, kind of a stupid problem, but I really like the linking in the labels and this makes them almost unusable. Any ideas for how to deal with this (is there a way to set a lag for how quickly the labels disappear when you hover off? can the labels themselves trigger the hover?) would be greatly appreciated!
Here is a first draft example of what I'm working on:
https://plot.ly/~seth127/6
Thanks!
Is it possible to make the plotly legends draggable? Currently I have my legend positioned outside the graph. I want to move it inside the graph, which is covered in the documentation, but I want to be able to make it draggable.
There is no direct way to drag the legend on a Plotly chart as far as I know.
You could find a workround by creating your legend in a HTML canvas and binding the onclick() function for each legend item to the Plotly PostMessage API restyle task.
There's a live example of the PostMessage API here which you should be able to hack apart. Let me know how you get on, this sounds interesting!
You can set "editable": True in the plot config.
https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_config.js#L46-L54
I am using IPython Notebook to make some plots. For most of them I use
%matplotlib inline but for a few I change to %matplotlib notebook to be able to zoom in and stuff like that.
Now to the problem, the window displaying my plot (independent of what matplotlib setting I am using) suddenly became much smaller. Not the figure itself, just the window. I am really confused why this happened, if it was beacause I was switching between the two matplotlib settings or something else I made by mistake.
It is really annoying since I have to scroll in the window to se my whole figure unless I want to minimize it a lot. So if you have any idea how to make the plot window larger, please enlighten me.
Here you can se an example of what I mean by window: Small window. The 'window' according to me is where you can see "Figure 1" and the red button and ends where it cuts my plot.
Click to expand fully and show smaller. Double click to completely collapse it.