I was making a plot of f(x,y,z) and wanted this to be displayed in a 2D-plane. To avoid cluttering my legend i decided to have different linestyles for y, different colors for z and place the two in two separate legends. I couldn't find out how to do this even after a lot of digging, so I'm posting the solution i came up with here :) If anyone has more elegant solutions I'm all ears :)
How to generate several legends for single plot matplotlib
84 Views Asked by Vegard Gjeldvik Jervell At
1
There are 1 best solutions below
Related Questions in MATPLOTLIB
- Str object is not callable in pandas
- How to throw a charged particle in a electric vector field?
- How are negative errorbar bounds transformed, when log axis scaling is applied before constructing a Seaborn lineplot?
- The kernel appears to have died. It will restart automatically. whenever i try to run the plt.imshow() and plt.show() function in jupyter notebook
- OpenGL Error [Python [OpenGL] [OpenAI Gym]
- Remove gaps between subplots_mosaic in matplotlib
- Matplotlib Fails to Update Axis Limits with ipywidgets in Jupyter Lab
- Low efficiency when plotting a large amount of contours on a single axis in python with matplotlib
- Why is countplot showing single value
- Matplotlib: Legend for marker and color in a scatterplot
- Contour plot projection not showing properly in matplotlib 3d plotting
- matplotlib sort barh by values
- loading variables from a python script in matlab
- cmap and color bar being compressed from the assigned range
- How can I position a pie chart within another plot according to x, y coordinates?
Related Questions in LEGEND
- ECharts confidence bands in legend as one item
- R's plotly ggplotly removing legend from a geom_point
- Separate Legend Entries for Individual Outlined Overlapping Bars
- How to show values next to bars in tornado chart using ggplot in R
- ggplot legend in R not recognising aesthetic changes for label category with no data points
- How to make pyplot Hatches look pretty in the legend
- Removing Duplicate Legend Entries using VBA
- Is there a way to move the legend in a trackViewer lollipopPlot and/or change its orientation?
- ggplot2 - how to keep the legend items with the same size, when geom_segment() has different sizes?
- Having different shapes of points for each line and making them shown on the legends
- Overlapping legend of a line plot
- How to align legend elements in the middle when they are on two rows using ggplot2?
- How do I add a legend to ggplot with two scatter plots (geom_point() )
- How to customize the legend order for a 3D scatter plot?
- Why doesn't sns.barplot legend show all values?
Related Questions in COLORMAP
- Generate smoother colormap for contour plot
- How to use a colourmap to plot multiple plots on one graph and iterate over multiple different colourmaps
- Attempting to create an image from a luminosity map
- PyQtGraph: Customized Color Map
- Using x for the value of a colormap/colorbar instead of z
- matplotlib pyplot.colormaps 'function' object is not subscriptable
- Creating a colormap in Python with a specific transition between two regions
- How to set the same color of gradient in joyploy plot fill?
- Add base map in the background to .shp layer plotted using geom_sf in R
- ParaView color map varies between frames, sequential video frames flicker
- How to set a Matplotlib axis as a colormap
- TinyMCE Custom Colors adds in grey when it's not in the list
- How to fix a colormap so that it is not relative?
- Is there a colorblind friendly alternative to the tab colormaps?
- How to read indexed / paletted image pixels in ImageMagick 7 / Magick++
Related Questions in LINESTYLE
- Specify the linetype for one line in a multiline plot
- python histogram line styles
- How to make a barplot not based of labels?
- Python plot dataframe with multiple lines and two different styles
- can I make a custom linestyle in matplotlib for plot made up of multiple parallel lines
- VBA Conditional Formatting of specific Borders
- More line styles in Matlab - without markers?
- Not able to change linestyle in Seaborn plot
- Remove part of the border of a table excel VBA
- How to plotting line graph with different linestyle using matplotlib
- Different linestyle in same label matplotlib
- Obtain lists of plot marker and line styles in Octave
- Matplotlib: contour plot line style with markers
- Plotly: How to change line style using px.line?
- How to generate several legends for single plot matplotlib
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Basically the solution was to make three plots, set two of them to have size (0,0) and place those two where i wanted the legends. It feels like an ugly way to do it, but it gave a nice plot and i didn't find any other way :) The resulting plot looks like this: