Skip to content
Advertisement

Tag: legend

Add two legends in the same plot

I’ve a x and y. Both are flattened 2D arrays. I’ve two similar arrays, one for determining the colour of datapoint, another for determining detection method (“transit” or “radial”), which is used for determining the marker shape. Since there can be only one type of marker in a scatterplot and I have two types of markers, I call the scatterplot

How to customize plotly legend order?

I want to change the ordering of legend in my boxplot from 1-12, or perhaps even renaming them to Jan, Feb, etc. Any idea how could I do it? Answer px.box is plotting your data in the order that it’s reading through your DataFrame df, so you can pass a sorted DataFrame to px.box instead: If you want the names

How to have a poligon in the legend

I have a chart with 4 elements: blue square,blue triangle, red square and red triangle, I’m tryng to add these 4 items to the legend. when I add a polygon patch to the legend, it is displayed as a rectangle, even though the patch is of a triangle How can I get it to work? Answer You could use line

Python SymPy’s plotting legend when using multiple ranges

I am using SymPy’s plotting module, but legends stop working when I start having multiple lines with different ranges (to plot a function f(x) whose definition depend on x like in the following example). I actually haven’t seen any example of this anywhere : Here the legend is ignored. I also tried instead of specifying plt[0] but Python says The

Position the legend outside the plot area with Bokeh

I am making a plot following the example found here Unfortunately, I have 17 curves I need to display, and the legend overlaps them. I know I can create a legend object that can be displayed outside the plot area like here, but I have 17 curves so using a loop is much more convenient. Do you know how to

Advertisement