0
votes
0answers
3 views

matplotlib button color updates only after moving mouse

When I change the color of a button it does not update the color till I move the mouse, which for my application is quite annoying... Can this update be forced? Maybe by generating a mouse event or ...
0
votes
0answers
18 views

Overplot with double y axes with one y-axis inverted (python)

So I have been trying to plot two sets of data while invert the y-axis on MC2 Here's what I've got so far: for dof in DOFS: print "DOF = %s " %(dof) data_mc1_mean = ...
0
votes
1answer
33 views

Reading string and data from a file (Python)

I'd wanna to read time strings and data from a file but when I used loadtxt i cant read string and numbers at the same time because strings are not float. So i tried using genfromtxt and use ...
0
votes
2answers
22 views

plotting selecting pandas dataframe data using seborn

I have a pandas dataframe (al_df) that contains the population of Alabama from a recent US census. I created a cummulative function that I plot using seaborn, resulting in this chart: The code that ...
0
votes
1answer
7 views

Define the limits of my axes, but with an equal scale in both directions with matplotlib

How do I combine those statements: pyplot.axis([1234.0, 1773.0, 497.0, 1362.0]) pyplot.axis('equal') I just want to define the limits of my axes, but with an equal scale in both directions. Ps.: I ...
0
votes
0answers
20 views

Parsing a file and creating histogram with python

I have to create an histogram from a source file that I have to parse: for line in fp: data = line.split('__') if(len(data)==3 and data[2]!='\n' and data[1]!=''): ...
2
votes
1answer
32 views

Python: subplots with different total sizes

Original Post I need to make several subplots with different sizes. I have simulation areas of the size (x y) 35x6µm to 39x2µm and I want to plot them in one figure. All subplots have the same ...
0
votes
0answers
17 views

Upgrading matplotlib fails

Running sudo pip install --upgrade matplotlib I get Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/matplotlib I am using Phython3 on Linux under ...
0
votes
1answer
16 views

matplotlib multiple xticklabel for bar graph

I've a set of data as shown below, is it possible to label each bar graph with their own index? For eg, for the first group of 3 bar graphs, the xticklabel should be [data1a, data1b, data1c] for ...
0
votes
1answer
19 views

how to include updated library in python code without root access?

I am working remotely on university systems.I wanted to include python's matplotlib1.1 and university system has matplotlib 0.98. I did according to this post How to install python modules without ...
0
votes
1answer
8 views

How to resolve unknown Python reference to dependency 'mpl_toolkits' in PyCharm?

UPDATE: When i run it without the cmap=cm.hsv call i get an empty plot with the error: .../lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.py:1673: RuntimeWarning: invalid value encountered ...
0
votes
1answer
15 views

How to plot a boxplot using matplotlib with discontinuous y intervals on the y-axis?

I have the following data set for which I need to generate the boxplot using matplotlib: ...
0
votes
0answers
21 views

Plotting error bars on barplots with multiple series in pandas

I can plot error bars on single series barplots like so: import pandas as pd df = pd.DataFrame([[4,6,1,3], [5,7,5,2]], columns = ['mean1', 'mean2', 'std1', 'std2'], index=['A', 'B']) print(df) ...
0
votes
2answers
16 views

Wrong colorbar positioning when using subplots (matplotlib)

I want to create a figure consisting of nine subplots. I really hated the fact that I needed to create ax1 to ax9 separately so I created a for loop to do so. However, when I want to include a ...
1
vote
0answers
26 views

Stacked horizonal bar charts aligned in one figure with matplotlib

I have lists of data indicating responses to likert questions with a one (very unhappy) to five (very happy) scale. I would like to create a page of plots showing these lists as skewed stacked ...
1
vote
1answer
18 views

difference between plt.draw() and plt.show() in matplotlib

I was wondering why some people put a plt.draw() into their code before the plt.show(). For my code, the behavior of the plt.draw() didn't seem to change anything about the output. I did a search on ...
2
votes
1answer
14 views

Dates in the xaxis for a matplotlib plot with imshow

So I am new to programming with matplotlib. I have created a color plot using imshow() and an array. At first the axis were just the row and column number of my array. I used extent = ...
0
votes
1answer
19 views

Matplotlib boolean coloring

I would like to graph a 3d plot of a sphere, which colors sections differently according to some function of the theta, phi coordinates. I could graph two separate graphs, one of each color, but I'm ...
0
votes
1answer
17 views

VTK to Maplotlib using Numpy

I want to extract some data (e.g. scalars) from a VTK file along with their coordinates on the grid then process it in Matplotlib. The problem is I dont know how to grab the point/cell data from the ...
0
votes
1answer
16 views

Matplotlib: get and set axes position

In matlab, it's straightforward to get and set the position of an existing axes on the figure: pos = get(gca(), 'position') set(gca(), 'position', pos) How do I do this in Matplotlib? I need ...
-1
votes
0answers
9 views

matplotlib: filter to produce a antialiased image

I have a low resolution image that I want to scale up and display in a figure. As you might expect, the image looks a bit pixelated, so I would like to do some filtering on it. Matplotlib has ...
1
vote
3answers
37 views

Can a matplotlib chart be interactive?

I'd like to know if a matplotlib chart be interactive, ie when you right click on a graph bar, a context menu opens, then you click one of the menu items and change the value of y value or you drag ...
1
vote
1answer
23 views

plotting 3d vectors (arrays) in python

Using numpy Packet i produced vectors (arrays) contain x,y,z-coordinates of several atoms in a protein. I would like to plot these vectors. Does anybody know how to do this? Since I could't plot the ...
0
votes
1answer
29 views

Pyplot - How can I plot in needle/histogram style?

I want to make a plot with a needle symbol, which is like in R: x = 1:10 y = rnorm(10) plot(x,y,type ='h') Does anyone know how to plot such figure in Python? Not a histogram, just x-y plot ...
0
votes
0answers
16 views

How to use matplotlib.collections effeciently?

I have a large number of lines want to plot by matplotlib (about 3x,xxx lines). I wish this process to be fast so I look for a way of efficient plotting in matplotlib, and finally go to the ...
0
votes
1answer
19 views

Change pandas plot backgournd color

Is it possible to change the background in a pandas chart? I would like to change the background from white and the line to orange but i cannot find any documentation to do that. I am using the ...
0
votes
1answer
18 views

How to take user input in matplotlib?

Is there any way of getting some input from a user in matplotlib? For example, a drop down list or a text box? What alternatives are there? If there isn't anything, what would be the easiest way of ...
1
vote
2answers
43 views

Long Boundary Detection in a Noisy Image

I'm trying to extract a single long boundary from a rather noisy image (forgive the green, the image is converted to grayscale in any case). I've tried running various edge detection and threshold ...
0
votes
1answer
20 views

pyplot.imshow() data selection

i am using pyplot.imshow() to plot the color map of a galaxy, the data is a 50x50 array (2500 spectral pixels) for a data cube, but the galaxy itself only spans a small portion of the frame at an ...
1
vote
1answer
21 views

Precision plotting in time axis

I have a trouble plotting data, I only want plot HH:MM:SS but the plot shows HH:MM:SS.sssss or HH:MM:SS.%f. Below i gonna detail what I did (matplotlib, numpy are already imported ) Method I Loading ...
1
vote
2answers
39 views

Matplotlib : how to label points individually?

With maptplotlib, I plot some points with the scatter method (see code below). I would like to label each point individually. This code will label every point with the labels array, but I would like ...
0
votes
1answer
26 views

How to do curve_fit in python

I need to curve fit a set of data using y = x / (a + x), where a is the parameter that I am required to get from this excercise. import numpy as np import matplotlib.pyplot as plt from ...
0
votes
0answers
14 views

matplotlib fails with dateutil

I believe I installed matplotlib correctly with 2.7: $ pip install matplotlib Requirement already satisfied (use --upgrade to upgrade): matplotlib in /usr/local/lib/python2.7/site-packages ...
0
votes
1answer
13 views

autopct cant be added to axis.pie :: error: too many values

In the following code, i'm just printing the label on the console whenever mouse clicks on the pie chart. The problem is i cant add autopct to the ax.pie() because of the wedges thing, i don't know ...
0
votes
1answer
18 views

Trying to plot multivariate Gaussian dist. in a 3D plot matplotlib returns an empty figure

I am trying to plot a Gaussian distribution via matplotlib, but all I get back is an empty figure: When I searched the internet, I understood that three arguments are required for the ...
-1
votes
1answer
45 views

Running infinite loops using threads in python

My program is designed in the following way: First part of the program takes real time values from a sensor and plots it using Matplotlib. This has to be done for long durations. And also, it logs ...
1
vote
2answers
42 views

matplotlib says it needs libpng15, but I have libpng16

The problem is likely a configuration issue, because getting the installation correct on Macs seems to be tricky. I'm running Mavericks and matplotlib 1.4.x, yet when I open a Python 2.7.5 shell and ...
0
votes
1answer
26 views

Align rectangles on date axis

I would like to draw a rectangle to indicate a range within the x axis. I can use locators for setting ticks and labels, but I don't seem to succeed using them to draw the rectangle. How could I go ...
1
vote
1answer
35 views

Solving for zeroes in interpolated data in numpy/matplotlib

I have some data over a 2D range that I am interested in analyzing. These data were originally in lists x,y, and z where z[i] was the value for the point located at (x[i],y[i]). I then interpolated ...
0
votes
1answer
25 views

Plot multiple data on 3d scatter plot

I'm having trouble plotting multiple sets of data onto a single 3D scatter plot. What I'm doing is I have a system of three equations and I'm calculating the zeros of the equations using linalg. I'm ...
2
votes
1answer
21 views

python plot 3d color map

I have 3 1-D arrays, for the X values, Y values and Z values. I want to make a 2-d plot with X vs Y and have Z in color. However every time I try I run I get AttributeError: 'list' object has no ...
0
votes
2answers
25 views

Matplotlib - 2 problems. Common colorbar / labels not showing up

I finally forced the 3 plots I want into one plot with 3 subplots...now I need to add a common colorbar, preferably horizontally oriented. Also, now that I have them as subplots, I have lost the ...
0
votes
3answers
25 views

matplotlib colorbar not working (due to garbage collection?)

I have a plotting function similar to this one def fct(): f=figure() ax=f.add_subplot(111) x,y=mgrid[0:5,0:5] z=sin(x**2+y**2) ax.pcolormesh(x,y,z) When I define the function ...
0
votes
1answer
19 views

Custom Matplotlib ColorBar for Scatterplot

I current have a few scatter plots each in their own sub plot. The way the data is formatted is: ID, X, Y, Colors, Area 0, x1, y1, r, 1 1, x2, y2, g, 1 2, x3, y3, r, 3 3, x4, y4, b, 4 .... n, xn, yn, ...
1
vote
0answers
30 views

python matplotlib: how to automatically save figures in .fig format?

With python matplotlib module, we can use pylab.savefig() function to save figures. However it seems that this function can't be used to save figures in .fig format. The .fig format is matlab figure ...
2
votes
2answers
20 views

Formatting datetime xlabels in matplotlib (pandas df.plot() method)

I can't figure out how to change the format of these x-labels. Ideally, I'd like to call strftime('%Y-%m-%d') on them. I've tried things like set_major_formatter but was unsuccessful. import pandas ...
0
votes
1answer
16 views

How to update axes limits when embedding matplotlib figure?

I have embedded a matplotlib figure in a PySide app. I'm trying to expose some of the functionality to the user (via gui buttons etc) to help them customise the figure. I'm having trouble to get the ...
2
votes
0answers
20 views

Save a movie or animation with python in an fast way

I want to creat a movie or an animation using lots of 2D plots. I have tried it in two different ways, one by using the matplotlib.animation and [...] for i in xrange(imagdat+start,lendata-imagdat, ...
0
votes
1answer
16 views

Unusual behaviour of pick_event in a matplotlib

When fig.canvas.draw() is used in onclick function, it doesn't wait for onclick event, and it comes out of the function. How to make it work continuously, so that label can be displayed every time ...
2
votes
1answer
58 views

semi-transparent overlays using matplotlib produce gray instead of color

I want to make a color overlay using two gray value images, each showing a single "signal peak". In order to only have the peak appear in the overlay and not the background, I created a blue color map ...