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
Tag: legend
Lineplot – plot a single legend for uneven number of subplots
I’m working on the following graph where I’d like to plot is single legend that applies to all, essentially this would be a small box where blue color line is AB=0 and green line is AB = 1. Moreover, I’m using plt.subplot(… since it is possible that might have to deal with uneven number of columns to plot. I tried
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
Adjusting global legend (labels) of a plot with subplots (which currently overlaps with the plot) – matplotlib, python
I am trying to add a global legend to a plot, the code below does that but the legend then overlaps with the given plot (I’ll add the plot below). Is there a way to adjust the legends? The other StackOverflow answers are focused on a single plot and are not working with subplots (or maybe I am doing something
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
How to label the line from transform_regression using Altair?
The code below creates a regression line; however, the legend defaults to labeling the line as “undefined.” How can this regression line be labeled in the legend as “reg-line”? Answer Simply add .transform_fold([“reg-line”], as_=[“Regression”, “y”]).encode(alt.Color(“Regression:N”)) after mark line Code should look like
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
How to change color of text in plotly scatter and different marker?
I want use plot.ly to plot iris dataset. It has an color parameter in scatter data work like hue in seabron but it only change the color of marker and cant change the color of text and i cant find any why to change the marker type for each group of color. the code is : I want the text
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
seaborn pointplot and boxplot in one plot but shifted on the x-axis
I want to plot both a boxplot and the mean in one figure. So far my plot looks like this using these lines of code: I would like to shift my mean ‘x’ markers a bit to the right so that the errorbars don’t overlap with the whiskers from the boxplot. Any idea how to do that? A bonus question: