All Questions
20
questions
4
votes
1
answer
3k
views
How to create a legend separated by color and linestyle
I'm generating a figure that has 4 curves (for example), divided into 2 types - Type1 and Type2 (2 curves of each type). I'm drawing Type1 as a solid line while Type2 is dashed. To not overload the ...
1
vote
2
answers
604
views
Left aligning markers in legend with legend title using matplotlib
I'm trying to make a plot with Matplotlib, and I would look to have the legend on the top left. Without a legend title this is working fine with the code below, but when I add a legend title which is ...
0
votes
1
answer
236
views
Remove points from a plot legend
I have this code that shows the Lagrange interpolation between set of points(x,y cordination). Using matplotlib:
import numpy as np
from scipy.interpolate import lagrange
import matplotlib.pyplot as ...
1
vote
1
answer
571
views
Set manual location of legend with matplotlib and GetDistTool
I try to set manually the location for the main legend of a main plot produced by Getdist tool.
The plot below represents the 1/2 sigma confidence levels coming from a covariance matrix with joint ...
1
vote
1
answer
186
views
Displaying row sum in a secondary colorbar while plotting matrix
I'm plotting a matrix using matshow. I have an array
sum = np.sum(A, axis=0)
I'd like to display the values stored in sum as a secondary legend.
import numpy as np
import matplotlib.pyplot as plt
...
1
vote
1
answer
360
views
How to plot an unstructured numpy array with a legend?
Is it possible, when plotting an n-dimensional unstructured array with matplotlib, to produce a legend label for each dimension?
The solution of a system of ODEs, when using scipy.integrate.odeint, ...
0
votes
0
answers
105
views
How to plot legends for all (only 4) types of value in a 2D array using matplotlib?
I have a 2-D array where each value is either of 0,1,2,3 and I am plotting it like:
array = two_d_array #two_d_array is a numpy 2-D array
plt.imshow(array)
This gives me a plot where each pixel is ...
-1
votes
1
answer
62
views
Adding legends into a Graph made using Matplotlib and Numpy (multiple plots from a txt file)
I had some really good help from here when I asked a question before so I thought I'd jump on again to get some help, here's my code so far:
import numpy as np
import matplotlib.pyplot as plt
import ...
0
votes
2
answers
2k
views
How to stop matplotlib legend text overlapping?
I am using python-3.x and I would like to find a way to stop legend in the right of the line overlapping as you can see from the following image:
I am trying to make it look similar to the following ...
2
votes
2
answers
1k
views
How to create a basic legend to a multicolored line?
I am currently finishing a bigger project and the last part is to add a simple legend to a plot of a multicolored line. The line only contains two different colors.
The following image shows the plot ...
3
votes
1
answer
3k
views
Legend for colour and for marker
I want to plot the values of two matrices in a scatter plot. For each of the points of the scatterplot, I want to see in which column and which row they are. For the different rows, I use different ...
0
votes
1
answer
3k
views
how to display legend iterating over list of values
I'm trying to plot a dummy graph with several lines and a legend in which each of the values in the list "label" will be displayed once for each of the corresponding lines.
In the following MWE, each ...
1
vote
1
answer
76
views
Plotting a legend with matplotlib: error
I am trying to add a legend to my graph in matplotlib. instead of creating a legend it puts the full list of all mylabels in the legend.
My graph looks like this:
The legend is cut off and i cant ...
1
vote
1
answer
3k
views
Plotting legend for 2D numpy array
I like to create a legend based on certain numbers using Numpy and Matplotlib but to no avail. So I started to play around with a test function to get it right before transferring this to my main ...
1
vote
1
answer
3k
views
Multiple legends and multiple colors/shapes matplotlib
I want to plot data from about 20+ files at same time. I am trying to plot each set of data from each file in different color and each with different legend. I have seen some examples and also the ...