Tagged Questions
0
votes
1answer
7 views
unable to join markers
I require my plot - actually 4 plots in one - to show markers and a line joining the markers.
I am familiar with the command to achieve this - here are 2 of the plots
for i in range(30):
...
0
votes
0answers
7 views
Spacing between bars in matplotlib hist() with thousands of bins
I'm making histograms using matplotlib's hist() function or bar(), and I want to use >10,000 bins (one bin to represent the counts at each coordinate of a large entity). Is there any way to create ...
0
votes
0answers
10 views
how to present different colors in contourf
I want to present a 2D matrix, like in below for example:
2 3 4 5 6 3
1 2 2 4 5 5
1 2 2 2 2 4
I use contourf in matplotlib,to do the work,
cmap = ...
0
votes
1answer
14 views
Python show legend for iterations in for loop
I have a function inside a for loop. The function outputs two graphs y and z which are plotted in different figures. I want to create a legend where each value in np.arange(0,20,5) is shown in both y ...
0
votes
0answers
14 views
matplotlib legend that is ordered by the last Y values, and have lines from the last plot point to the legend
I'm probably not describing this well in the title, but can someone post an example of how to do a legend as in the these graphs:
Requirements:
Legend text is sorted by the last values of the ...
3
votes
1answer
13 views
How can I use seaborn without changing the matplotlib defaults?
I am trying to use seaborn, because of its distplot function. But I prefer the default matplotlib settings. When I import seaborn, it changes automatically the appearance of my figure.
How can I use ...
1
vote
1answer
14 views
timestamps passed to matplotlib.date2num: 'str' object has no attribute 'toordinal'
Have an array with timestamps (format %Y-%M-%D %H:%M:%S) collected from a textfile. I want to plot these in a subplot with matplotlib. But I can't get it to work. I was thinking of this:
import numpy ...
0
votes
1answer
37 views
ValueError: x and y must have same first dimension when plotting
I am trying to plot an array of x and y values and keep getting this error.
ValueError: x and y must have same first dimension
I can't figure out what's going on...can anyone help? This is the ...
0
votes
1answer
18 views
Changing the fontsize of a graph
I'm trying to change the fontsize of a graph, but it does not seem to be working.I see in the api that it has a property called fontsize, but it does not seem to be working.
def generate_graph(d):
...
0
votes
1answer
13 views
matplotlib.pyplot.subplots() - how to set the name of the figure?
When I create a single plot using the figure()-function of PyPlot, I can set the name of the appearing window using a string as argument:
import matplotlib.pyplot as plt
figure = plt.figure('MyName')
...
1
vote
0answers
59 views
Pandas Plotting with Multi-Index
After performing a groupby.sum() on a dataframe I'm having some trouble trying to create my intended plot.
How can I create a subplot (kind='bar') for each 'Code', where the x-axis is the 'Month' ...
1
vote
1answer
26 views
Python real time varying heat map plotting
I have a 2D grid 50*50. For each location I have an intensity value(i.e data is like (x,y,intensity) for each of those 50*50 locations). I would like to visualize the data as a heatmap.
The twist is ...
0
votes
0answers
12 views
Pyplot in notebook - chart does not update on events
I am trying to use notebook in a browser to run python code(pyplot, matplotlib) to generate charts that should update automatically on mouse movement, mouse click and timer. However, once I hit ...
1
vote
1answer
15 views
Matplotlib Annotation not working
I have not used matplotlib before- i have downloaded the libary and read the documentation. I am trying to display the value on top of the bar using the code below. However, the value does not display
...
0
votes
1answer
13 views
how to project new sets of data onto a pca space in matplotlib?
I have got a data set with 68 dimensions * 100 observations to create a pca space using matplotlib in python.
Now I have got another set of data (x) with 6 dimensions * 100 observations. Is it ...
0
votes
0answers
11 views
how to get pydev autocomplete work for matplotlib, opencv, etc?
the object from some packages such as matplotlib or opencv, does not have any content assistant in pydev.
for example:
if you do fig=plt.figure(), then there is no member function/object hint for ...
4
votes
1answer
45 views
Find holes in a union of rectangles?
I have a number of random rectangles (black) in and around a unit square (red) and need to extract all the polygonal regions inside the unit square that are not covered by any rectangle.
It looks ...
2
votes
1answer
21 views
Matplotlib 3d Wire Frame plot not plotting as expected
I am running simulations with 2 variables: P and Q.
Both P and Q vary from [0.2, 0.4, 0.6, 0.8]
Each combination of P and Q produce an output which I call NB_Means.
nb_means is produced by ...
0
votes
0answers
45 views
Python - plotting a 5000 by 5000 matrix [on hold]
I need to plot a large 2D array of points(dim approx 5000 by 5000). I have used matplotlib's plotting options, but they crash my program. Any recommendations on how to plot this efficiently? thanks!
2
votes
1answer
23 views
Pyplot connect to timer event?
The same way I now have plt.connect('button_press_event', self.on_click)
I would like to have something like plt.connect('each_five_seconds_event', self.on_timer)
How can I achieve this in a way ...
1
vote
0answers
15 views
Plot .tif GDAL raster using matplotlib Basemap
I have a bit of code from here that I am using for plotting a geotiff image (Landsat):
from mpl_toolkits.basemap import Basemap
from osgeo import osr, gdal
import matplotlib.pyplot as plt
import ...
1
vote
0answers
26 views
Matplotlib - Annotations overlapping on chart, how do I evenly distribute them vertically?
I have a chart, with 95% confidence intervals as patches. Naturally some of the data points overlap. Because of this, I need the point labels to be dynamically spaced so they are human readable. I ...
1
vote
0answers
23 views
Improve ticking and grid using matplotlib
I have the following code:
import datetime
from matplotlib.ticker import FormatStrFormatter
from pylab import *
hits=array([100,250,130,290])
misses=array([13,18,105,15])
X = np.arange(len(hits))
...
1
vote
1answer
16 views
Plotting 'vectors' with different colors in matplotlib
My data are :
import matplotlib.pyplot as plt
from datetime import *
import matplotlib
my_vectors =[['120819152800063',10,189, 8],
['120819152800063', 10,184, 8],
['120819152800063', 0,190, 43],
...
1
vote
1answer
12 views
Matplotlib imshow displays blank plot
I figured this should be simple but I guess not.
from scipy import misc
import matplotlib.pyplot as plt
img = misc.imread("Alyson.jpg")
plt.imshow(img)
plt.show()
It draws a blank canvas. ...
1
vote
1answer
18 views
Force use of scientific style for basemap colorbar labels
String formatting can by used to specify scientific notation for matplotlib.basemap colorbar labels:
cb = m.colorbar(cs, ax=ax1, format='%.4e')
But then each label is scientifically notated with ...
0
votes
1answer
32 views
Plotting Pandas Time Data
My data is a pandas dataframe called 'T':
A B C
Date
2001-11-13 30.1 2 3
2007-02-23 12.0 1 7
The result of T.index is
<class ...
0
votes
1answer
19 views
Major and minor grid lines and ticks using matplotlib
I have two big intergers
min=round(raw_min,-5) # a negative number
max=round(raw_max,-5)
from which I get a range of interesting ticks:
xticks=np.arange(min,max,500000)
On the x-axis, I want to ...
0
votes
0answers
14 views
How to import matplotlib in django?
I need to import matplotlib's pyplot to my django project and need to show the graphs in the HTML page.When I try to import matplotlib it raises this error.
Unresolved import: matplotlib.pyplot ...
1
vote
1answer
34 views
Matplotlib - Chart using patch circles with size equivalent to error bars. Scaling issue. Circles are squashed?
I am trying to produce a chart using patches. From the code below, does anyone know why these would end up being squashed and not circular, like I want? Unfortunately I do not have enough rep to ...
0
votes
0answers
18 views
Setting xticks and yticks for scatter plot matrix with pandas [duplicate]
I'm using Pandas to create a scatterplot matrix visualization. But I only want to show three ticks for the x axis and y axis. I want to show the ticks at [0.0, 0.5, 0.1] because I have so many ...
1
vote
1answer
31 views
Change FaceColor and EdgeColor of Matplotlib Streamplot Arrows
I have some data in grid and I plot the streamlines with streamplot with color and width related to the speed. How can I change the color of the arrows, or just the edgecolors?
My goal is to emphasis ...
1
vote
1answer
18 views
Matplotlib polar bar-plot legend
I have some data from a questionnaire that provides answers in 6 "dimensions" (each answer represents a value from 0-4). I'm trying to plot the averages for each of the 6 "dimensions" in a polar bar ...
2
votes
0answers
18 views
Matplotlib: Drag n Drop and blitting
I have created a FigureCanvaswhich allows drag and drop on all Textinstances. This works great for text within the axes, but for text outside the axes (such s axis labels), when the text is being ...
0
votes
1answer
22 views
How to plot time as moving backwards as you move up the y axis?
I am trying to create a waterfall plot using matplotlib's pcolormesh. I want to have frequency on the x axis, time on the y axis, and intensity as the color of each pixel. Right now, I have the ...
1
vote
0answers
22 views
Inverse Gnomonic Projections of Plane
I have a spin-2 field namely the shape distortion of galaxies with:
γ=γ1+iγ2=|γ|exp(−2iϕ)
where ϕ is the orientation angle.
If this quantity has been measured on the sky coordinate which is a ...
-2
votes
0answers
10 views
matplotlib.animation: GNU/Linux safe animation writers? [on hold]
I'd like to save a matplotlib generated animation file as some sort of a video file. On a GNU/Linux OS, I have some issues doing so with the ffmpeg writer (see: matplotlib.animation: script works ...
0
votes
1answer
17 views
matplotlib.pyplot issue with subplot, np.ones and np.arange?
I am plotting several data types which share the x axis so I am using the matplotlib.pylot subplots command
The shared x axis is time (in years AD). The last subplot I have is the number of ...
1
vote
1answer
20 views
How do I manipulate datetime (tick labels and limits) on a plot axis in Python?
I have a plot created within a for loop with a list of datetimes as the x values. The x ticks are labeled as dates, but I would like to display the hour (i.e. 6, 12, 18, 24 repeating). I would also ...
1
vote
1answer
75 views
matplotlib.animation: script works under Windows, and works under Linux for short animations, but hangs indefinitely for longer animations?
Here is the relevant code snippet:
ani = animation.FuncAnimation(fig, animate, outputFiles, blit=True, interval=25)
print "Starting to write animation file..."
# Set up formatting for the movie ...
2
votes
1answer
26 views
Choosing a point in matplotlib embedded in wxPython
I'm trying to select and display data about a point in matplotlib embedded in wxPython.
I've written a minimal example which plots random data. The code is below.
import numpy as np
import wx
...
-1
votes
1answer
37 views
Technology for visualization of geographical data. Python, matlab, Java [on hold]
I am new to geographical data visualization, so I would like to ask if someone could recommend me some tool for easy visualization of data on map.
Particularly I have data from one European city and ...
0
votes
2answers
48 views
python 2.7: cannot pip on windows “bash: pip: command not found”
I am trying to install the SciPy stack located at scipy(dot)org/stackspec(dot)html [I am only allowed 2 links; trying to use them wisely]. I realize that there are much easier ways to do this, but I ...
0
votes
1answer
26 views
Plotting multiple points instead of just one in Python
Hey all I am plotting the tweets of users locations using Tweepy and MatPlotLib and for some reason my program is only printing the last user's location that tweeted. I would like to capture all of ...
0
votes
1answer
19 views
How to hidden some values in my x-axe of my plot?
my plot works fine but i have too many values and it is very hard to read clearly.
How can i modify my axe to display less value? I want to plot all values in listoflists, but not to display each ...
0
votes
0answers
22 views
matplotlib backend_tkagg TclError
I used the matplotlib sample to show a figure in tkinter, Win7 and Python 3.4, but it turned out error like this:
Traceback (most recent call last):
File "<ipython-input-7-7482c0850da6>", ...
2
votes
1answer
18 views
Using Tweepy to grab grab coordinates and plot them
I am using tweepy to grab the tweets of users. Take their coordinates and then plot them on a map. Unfortunately I am new to Python and I am not sure why my program is not working. I got it to ...
0
votes
1answer
46 views
Plotting a histogram in Pandas with very heavy-tailed data
I am often working with data that has a very 'long tail'. I want to plot histograms to summarize the distribution, but when I try to using pandas I wind up with a bar graph that has one giant visible ...
0
votes
0answers
25 views
Odd Errors for Python installation library
I am trying to install MatPlotlib.org for my Python program. More specifically trying to do what this guy is doing here ...
0
votes
1answer
38 views
How do I plot a really large heatmap using Python's pylab.figure?
I am using pylab.figure to plot a heatmap. Nothing unusual about that and I get good results for smaller heatmap dimensions.
Problem: I want to plot a heatmap with about 30 rows and nearly 2000 ...