Tagged Questions
0
votes
0answers
7 views
Color outliers in scatterplot in matplotlib?
How would I color my outliers in a scatterplot, assuming i have a list of my outlier values?
x_outliers = my_x_outliers
y_outliers = my_y_outliers
plt.scatter(x,y)
plt.show()
The default color ...
0
votes
0answers
6 views
Cannot plot Dataframe
I am trying to plot this Dataframe but it kept on giving me errors for too many indices for array. I have looked at this for hours and I still could't figure it out.
I suspect it has something to do ...
0
votes
1answer
19 views
Getting ValueError trying to plot a graph
I have an Arduino sketch that is putting time, temperature values into a loggedData.dat file. Just looking at the file using the Arduino serial monitor it looks fine. But when I try to plot a graph ...
1
vote
1answer
14 views
Inserting hyperlinks in pyplot interactive mode
I am creating a visualization of Twitter user locations as tweets come in, and so within my matplotlib code I have these three lines to create an interactive plot so the location markers can be ...
0
votes
0answers
16 views
Python 3d scatter plot X and Y axis error
def fun(mips_perf):
y = list(xrange(0,10))
x = list(xrange(0, 8))
X, Y = np.meshgrid(x, y)
temp = []
for x, y in zip(np.ravel(X), np.ravel(Y)):
print x, y
...
-1
votes
0answers
31 views
matplotlib cannot plot histogram
I am starting to use Pandas, and having some problem plotting a field of a data frame
I have 2 variables a and b, initialized as follow
import matplotlib.pyplot as plot
column_name = ...
0
votes
0answers
20 views
Plotting images (glyphs) as points in Python / matplotlib? [duplicate]
I have a set of points that I wish to plot in a scatterplot with images (glyphs) being plotted instead of points. How would I do this in Python/matplotlib?
1
vote
2answers
31 views
UnicodeDecodeError Matplotlib
I've been taking a YouTube course on how to build live-updating graphs in python. Initially, my program wouldn't run because I was missing important modules such as six or dateutil (I even installed ...
0
votes
0answers
29 views
Matplotlib Legend not showing up
I am trying this example:
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
red_patch = mpatches.Patch(color='red', label='The red data')
plt.legend(handles=[red_patch])
...
0
votes
1answer
23 views
R's gridExtra in Python?
In R, we could plot each graph independently and then arrange all or some of the graphs easily by packages like gridExtra. For example,
p1 <- ggplot(aes(x1,y1), data=df) + geom_point()
p2 <- ...
0
votes
0answers
13 views
Label axis in chart with matplotlib [duplicate]
I have a chart that I am embedding into a html page that is generated with matplotlib. Everything is working as I was hoping it would but for some reason I cannot label the axis of the chart. Every ...
0
votes
0answers
23 views
Format datetime in seaborn faceted scatter plot
I am learning python pandas + matplotlib + seaborn plotting and data visualization from a "R Lattice" perspective. I am still getting my legs. Here is a basic question that I could not get to work ...
1
vote
1answer
21 views
Matplotlib / Seaborn barplot--strings in x axis
Maybe I am too used to R's wonderful ggplot-idiom when doing faceted charts (it takes numeric and string variables without protest) but the ideal way outside ggplot has certainly eluded me for some ...
1
vote
0answers
22 views
pylab not loading in emacs using ipython
I am using Emacs 24.3 in Windows 8. Using PowerShell, ipython loads pylab without issue:
PS C:\Users\vince.forgetta> ipython --pylab
Python 3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 19:25:23) [MSC ...
0
votes
1answer
24 views
Plot matrix data with custom tick labels
C0 C5 C10 C15 C20 C25 C30 C35 C40 C45 C50
P0 47.943345 44.914156 42.376835 37.2786 39.362123 29.822127 ...
0
votes
1answer
20 views
matplotlib plot and then wait for raw input
I am trying to open a series of .png plots. I want to be able to view a plot on the screen and then get a prompt waiting for me to 'press enter'. On hitting enter, the next plot should be shown. I ...
2
votes
0answers
19 views
Plotting circular 3d bars (discs) using matplotlib
I am trying to make a graphical visualization of reaction barriers in a cyclic reaction (cf. citric acid cycle).
I have barriers for two reaction paths closing the same reaction cycle through ...
1
vote
0answers
19 views
Add text on matplotlib graph in the loc = “best” fashion (not in data coordinate) [duplicate]
Is there a way to include text on a matplotlib graph in an "empty area" in the same fashion as loc ="best" for the legend location?
Thanks!
-1
votes
2answers
45 views
How to assign colors to circles in matplotlib?
Somehow, assigning colors to circles works different from assigning colors in scatter plots:
import numpy as np
import matplotlib.pyplot as plt
fig = plt.figure(figsize=(6,6)) # give plots a ...
0
votes
1answer
15 views
Plot histogram of a large number of integers using matplotlib
I am trying to plot the frequency of integers in a large list of number in a large range. More specifically:
ints = np.random.random_integers(0,1440,15000)
ints is a long list of integers with ...
0
votes
2answers
24 views
ImportError: No module names 'matplotlib' Python 3.3
I'm new to python (started 2 days ago) and I have gotten to the point where I want to use matplotlib for my program. I am using python 3.3 and after I have followed the instructions of installing ...
0
votes
1answer
18 views
Pandas plotting options causing error in iPython [duplicate]
I am trying some of the pandas plotting stuff shown here. However whenever I try to use the following command to set style options as suggested
pd.options.display.mpl_style = 'default'
I get the ...
0
votes
0answers
12 views
matplotlib: isometric views for 3d axes
I have a 3d axes in matplotlib:
http://matplotlib.org/mpl_toolkits/mplot3d/tutorial.html
The view can be set using the keywords elev and azim. I'd like to make it easy to access the isometric view ...
3
votes
1answer
43 views
How to get XKCD font on matplotlib
I've managed to replicate the graphs in:
http://matplotlib.org/xkcd/examples/showcase/xkcd.html
However my font does not look like that. How do I change the text font to the cool xkcd font?
0
votes
0answers
17 views
Overlaying a mask onto another image with matplotlib
I have an issue, of which my trial solution is no doubt convoluted. Suppose I have two different images (call them A and B, both 166x256) with values ranging from 0 to 256. I have this region (call it ...
0
votes
0answers
16 views
Creating and graphing Hierarchical Trees in Python with pandas
So I have hierarchical information stored within a pandas DataFrame and I would like to construct and visualize a hierarchical tree based on this information.
For example, a row in my DataFrame has ...
2
votes
0answers
17 views
Matplotlib legend: labels above markers
I have a plot with multiple lines, each labelled separately. I'd like to put a legend in the plot so that individual lines can be identified. The default ordering of labels and markers looks something ...
1
vote
0answers
25 views
How to create a custom color bar - Matplotlib / Python
I'm merging to data in the same plot using Matplotlib.
With the colors, I represent the data a, and with opacity, the data b.
So, at the end, I have something like:
As can be seen, so far my color ...
0
votes
1answer
29 views
Matplotlib - set an axis label where there are no ticks
Hello Python/Matplotlib gurus,
I would like to label the y-axis at a random point where a particular horizontal line is drawn.
My Y-axis should not have any values, and only show major ticks.
To ...
0
votes
0answers
59 views
Plotting a list from a dictionary [on hold]
I am trying to plot two lists from a dictionary(updated_population), but there are no points showing in the plot itself. Dont understand why, because if i print the lists if gives the right values.
...
0
votes
0answers
24 views
A half polar plot (directivity pattern) with dB scale and negative angle values
I need for the analysis / presentation of my measurement data a directivity plot. The angle from -90° to 90° (0° has to show to north) and the rvalues should be able to be negative as well (dB scale).
...
1
vote
1answer
79 views
Using Anaconda Python with PyQt5
I have an existing PyQt5/Python3.4 application that works great, and would now like to add "real-time" data graphing to it. Since matplotlib installation specifically looks for Python 3.2, and NumPhy ...
4
votes
1answer
77 views
Best way to plot an angle between two lines in Matplotlib
I am fairly new to using matplotlib and cannot find any examples that show two lines with the angle between them plotted.
This is my current image:
And this is an example of what I want to achieve:
...
1
vote
2answers
489 views
raise LinAlgError(“SVD did not converge”) LinAlgError: SVD did not converge in matplotlib pca determination
code :
import numpy
from matplotlib.mlab import PCA
file_name = "C:/Documents and Settings/862629/My Documents/53135/programs/store1_pca_matrix.txt"
ori_data = numpy.loadtxt(file_name,dtype='float', ...
3
votes
1answer
425 views
Drawing obtuse circular arc with arrowhead in matplotlib
I am new to Python, though I do have previous programming experience. My current interest is to generate good quality schematics (and maybe later on also data graphs).
I need to draw a circlar arc ...
-2
votes
1answer
647 views
How to draw planes from a set of linear equations in Python?
I have a linear system with three equations:
x1- 2x2 + x3 = 0 2x2
- 8x3 = 8
-4x1 + 5x2 + 9x3 = -9
The solution set is (29, 16, 3), which is a point at the intersection of these planes.
...
2
votes
2answers
430 views
Displaying true-colour 2D RGB textures in a 3D plot?
I'm trying to make a 3D plot that consists of a series of 2D planes through an RGB stack, like this:
I know that it's possible to do this using mpl_toolkits.mplot3d by passing the x, y, z ...
2
votes
2answers
3k views
How to overplot a line on a scatter plot in python?
I have two vectors of data and I've put them into matplotlib.scatter(). Now I'd like to over plot a linear fit to these data. How would I do this? I've tried using scikitlearn and np.scatter.
8
votes
2answers
5k views
How to plot two columns of a pandas data frame using points?
I have a pandas data frame and would like to plot values from one column versus the values from another column. Fortunately, there is plot method associated with the data-frames that seems to do what ...
10
votes
3answers
5k views
matplotlib: Group boxplots
Is there a way to group boxplots in matplotlib?
Assume we have three groups "A", "B", and "C" and for each we want to create a boxplot for both "apples" and "oranges". If a grouping is not possible ...
13
votes
1answer
19k views
How to set xlim and ylim for a subplot in matplotlib
I would like to limit the X and Y axis in matplotlib but for a speific subplot. As I can see
subplot figure itself doesn't have any axis property. I want for example to change only the limits for the ...
11
votes
1answer
4k views
Plotting results of Pandas GroupBy
I'm starting to learn Pandas and am trying to find the most Pythonic (or panda-thonic?) ways to do certain tasks.
Suppose we have a DataFrame with columns A, B, and C.
Column A contains boolean ...
4
votes
1answer
2k views
Explain why numpy should not be imported from source directory
Disclaimer of research:
I have examined the following other stackoverflow questions:
How to import numpy in python shell
How can I use numpy without installing it?
python: import a module from a ...
37
votes
6answers
10k views
making matplotlib graphs look like R by default?
Is there a way to make matplotlib behave identically to R, or almost like R, in terms of plotting defaults? For example R treats its axes pretty differently from matplotlib. The following histogram
...
0
votes
3answers
377 views
plot qualitative data on matplotlib
I have three 1D arrays of same length. These are:
Temperature (F)
wind speed
wind direction
temperature and wind speed have all float values while wind direction has string values like 'south', ...
38
votes
1answer
14k views
Pandas timeseries plot setting x-axis major and minor ticks and labels
I want to be able to set the major and minor xticks and their labels for a time series graph plotted from a Pandas time series object.
The Pandas 0.9 "what's new" page says:
"you can either ...
2
votes
2answers
889 views
Add padding to the top and bottom of a pyplot
I am generating a pyplot using the following code:
plotCount = 1
for key in resultsDictionary:
count = 1
p1 = plt.subplot(5,1,plotCount)
plotCount+=1
for item in resultsDictionary[key]:
...
11
votes
2answers
5k views
How to plot a gradient color line in matplotlib?
To state it in a general form, I'm looking for a way to join several points with a gradient color line using matplotlib, and I'm not finding it anywhere.
To be more specific, I'm plotting a 2D random ...
2
votes
3answers
1k views
Python: clockwise polar plot
How can I make a clockwise plot? Somebody ask a similar question here: How to make the angles in a matplotlib polar plot go clockwise with 0° at the top?
But I dont understand this.
import ...
11
votes
4answers
3k views
Plotting a line over several graphs
I don't know how this thing is called, or even how to describe it, so the title may be a little bit misleading.
The first attached graph was created with pyplot. I would like to draw a straight line ...