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 ...
-1
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).
...
0
votes
0answers
8 views
changing the portion of the window covered in 3d axis
In pylab, when we use a 2D picture and want to insert an axis within this figure, we can do the following:
pl.figure(figsize=(4,3))
pl.axes([0.25, 0.25, 0.74, 0.74 ])
This allows is to place the ...
0
votes
0answers
12 views
pylab 3d axis log scale issue
So I am creaitng a 3d plot using matplotlib. The essential code snippet si shown below:
xScl, zScl = 'linear', 'linear'
data1, data2 = map(np.array, [data1, data2])
# Figure out the right scaling ...
0
votes
2answers
21 views
Matplotlib saving state between different uses of io.bytesIo
I have a function that returns the raw contents of a .png:
import matplotlib.pyplot as plt
def plotVoltage(dbc,imei,sMonth,sDay,sYear):
...
plt.figure(1)
ax = plt.subplot(111)
...
0
votes
1answer
17 views
How to display all label values in matlibplot?
I have two lists, when I plot with the following code, the x axis only shows up to 12 (max is 15). May I know how can I show all of the values in x list to the x axis? Thanks in advance.
x = ...
0
votes
2answers
12 views
matplotlib get ylim values
I'm using matplotlib to plot data (using plot and errorbar functions) from Python. I have to plot a set of totally separate and independent plots, and then adjust they're ylim values so they can be ...
0
votes
0answers
9 views
how to change pyplot changing scale unit [duplicate]
I would like to change the scale unit to 10^5 so that I don't need to see all those zeros in x-axis values. How do I do that?
ax = plt.subplot(222)
plt.title('small set')
k = 62.95
b = 0.455
...
0
votes
0answers
13 views
pyplot twinx share y-axis zero [duplicate]
I can use matplotlib.pyplot.twinx to plot 2 data sets that share x-values. How can I force the y-coordinate of the value zero to be the same on both y-axes?
In my situation, the sets of y-values ...
0
votes
1answer
12 views
GraphicsContextBase instance has no attribute 'get_sketch_params'
Quite new to python and programming and tried to search for answers to matplotlib plots, but couldn't find answers to my question.
I use Spyder and have anaconda installed. Installed matplotlib but ...
0
votes
0answers
26 views
dynamic python plot with matplotlib and ROS callback
import matplotlib.pyplot as plt
import rospy
def callback1: //replot subplot(221)
def callback2: //replot subplot(222)
def callback3: //replot subplot(223)
def callback4: //replot subplot(224)
...
0
votes
0answers
20 views
matplotlib python3.4.1 win7
I am using python3.4.1 in win7
And I wana use matplotlib.
but this error code has occured.
Could you help me?
>>> text4.dispersion_plot(["citizens", "democracy", "freedom", "duties", ...
-4
votes
1answer
48 views
how to perform a linear approximation and get linear equation from an array of data in python
I want to know how is it possible to perform a linear approximation and get the linear equation from the array of data in python.
i.e. It would be something like
...
1
vote
2answers
14 views
How can I get the matplotlib rgb color, given the colormap name, BoundryNorm, and 'c='?
How can I get the matplotlib rgb value for a number, NUM, given:
A colormap ('autumn_r' which is yellow-to-red in the example below)
BoundryNorm values("2 to 10" in the example below)
The number NUM
...
0
votes
0answers
20 views
Drawing a 3D triangle with matplotlib [duplicate]
I'm trying to draw a 3D triangle using matplotlib. I have 3 points, say (0,0.,0),(1,0,0) and (0,1,0). How would I draw a plane that passes (and is bounded,i.e. I'd rather not have the plane extend ...
0
votes
0answers
32 views
ImportError: No module named matplotlib.pyplot with matplotlib installed
I am running Python 2.7, and it's giving me
Kristin$ python get_fb_friends_boyerkr.py
Traceback (most recent call last):
File "myfile.py", line 5, in <module>
import matplotlib.pyplot ...
0
votes
2answers
29 views
Pandas plot subplots of a 'group by' result
I struggle with my (poor) Pandas knowledge, as I try to get a bar plot on a hierachial index by a group by operation.
My data look like this
id, val, cat1, cat2
Then I create a hierachical index:
...
2
votes
1answer
18 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 ...
0
votes
1answer
23 views
Select starting color in matplotlib colormap
I have the figure shown below. Presently the figure's colorscheme uses the entire range of the colormap (mpl.cm.Paired). What I want to do, and have been unable to figure out, is how to limit ...
1
vote
1answer
14 views
Fixing ylabel location in a colorbar in matplotlib
I'm using matplotlib in python to create a covariance plot using color bar. But the problem is that ylabel is drawn over the color bar axis. I'm unable to find how to solve this.
Here's an example:
...
0
votes
0answers
7 views
matplotlib FuncAnimation issue
I'm currently trying to display dynamically the result of a genetic fitting I'm running (so that I can decide when to stop). The code is pretty much the following:
#vars stands for a bunch of ...