0
votes
1answer
17 views

Create loglog plot of histogram data in xy style - python matplotlib

I have a list of values (integers) and I want to show on a graph how many times each value in it occurs. I have created a dictionary of values and corresponding frequencies from the list as after ...
0
votes
2answers
11 views

calling colours in python pylab

So when I use pyplot I know how to use the colours blue and red dots, 'bo' and 'ro' respectively. However I cannot find the respective colour codes for orange, yellow, green, indigo and violet (Yup ...
0
votes
1answer
22 views

Python Pandas plotting title name passing string

How do I make the title name display 'AAPL Stock Price' without converting all my pandas data to matplotlib and numpy. import time from pylab import * import pandas as pd import numpy as np import ...
1
vote
1answer
23 views

Reversing colormaps or specifying colors in a matplotlib/pandas plot

I am following some examples from the book Python for Data Analysis, and came across an interesting problem. I was wondering if there is a way to "reverse" of a colormap, for example from a blue ...
2
votes
1answer
20 views

Flask matplotlib graphics in template

I have a pretty beginner-question. Is it possible to display dynamically processed matplotlib images (as shown in https://gist.github.com/wilsaj/862153 or https://gist.github.com/rduplain/1641344) ...
1
vote
2answers
30 views

Basic Matplotlib Scatter Plot From Pandas DataFrame

How to make a basic scatter plot of column in a DataFrame vs the index of that DataFrame? Im using python 2.7. import numpy as np import pandas as pd import matplotlib.pyplot as plt ...
0
votes
1answer
24 views

Connecting two sankey diagrams in matplotlib

I'm trying to represent a country's gas balance using matplotlib. The idea is that there are three sources of imported gas which I want to plot using one sankey and connect it to another sankey which ...
0
votes
0answers
12 views

Matplotlib in a Client Server Architecture

My application has a Client server architecture. Server handles data processing on an homebrew cluster. client (wxpython) connects to the server over a network (10 GB, 1GB network) and plots the ...
0
votes
1answer
22 views

Remove the x-axis ticks while keeping the grids (matplotlib)

I want to remove the ticks on the x-axis but keep the vertical girds. When I do the following I lose both x-axis ticks as well as the grid. import matplotlib.pyplot as plt fig = plt.figure() figr = ...
0
votes
1answer
24 views

matplotlib fails to output EPS figure with usetex = True

I am trying to output (savefig) matplotlib figures as EPS; however, it seems there is a conflict when using the LaTeX rendering AND saving EPS figures. For example, the following code produces a good ...
0
votes
1answer
18 views

matplotlib not displaying intersection of 3D planes correctly

I want to plot two planes and find their intersection line, but I get this result, where it's impossible to tell where they intersect, because one plane overlays the other. A 3D projection should ...
1
vote
0answers
29 views

IPython Interactive Matplotlib Widgets Remote Server?

I am running an ipython server (for the notebook) on a remote linux machine. I have setup a profile that listens on the remote machine such that I can access locally using: https://myserver:9999 ...
0
votes
1answer
27 views

matplotlib close does not close the window

I have noticed that when I run: import pylab as pl pl.ion() # Plot something pl.show() pl.close() The last statement does not fully close the Figure. The figure goes dark, and the contents go away, ...
0
votes
1answer
33 views

How to get smooth filled contour in matplotlib?

Hi iam trying to plot a filled contour of uneven data. which is in a three lists. My problem here is i can't able to get smooth filled contour. what i did is first i changed my data from a irregular ...
0
votes
2answers
26 views

physically stretch plot in horizontal direction in python

I want a simple x,y plot created with matplotlib stretched physically in x-direction. The intention is to get a result were it is easier for me to detect features in the signal. So I don't want to ...
0
votes
1answer
27 views

matplotlib: displaying certain labels in different color

I am trying to plot certain values, and I need to display certain xlabels in different color than the rest. I am able to set the color of all labels using "plt.xticks(color = 'r')", but I need ...
0
votes
1answer
16 views

Use annotate by giving list python matplotlib

I have a function call draw. I have 2 lists, one with x coordinates an second with y coordinates. I'm making a plot, and I want to write in the plot the x,y coordinates. I see that annotate may be the ...
0
votes
0answers
23 views

Matplotlib: how to set ticks of twinned axis in log plot

In my plot, a secondary x axis is used to display the value of another variable for some data. Now, the original axis is log scaled. Unfortunaltely, the twinned axis puts the ticks (and the labels) ...
0
votes
2answers
49 views

Pandas + Matplotlib, Make one color in barplot stand out

I have a barplot with different colors. I would like to make one bar stand out with brighter colors and the others faded. My guess is to use the keyword alpha on the bars to fade them, but I can not ...
0
votes
1answer
16 views

Convert negative y axis to positive (matplotlib)

I want to plot bar chart for some parameters for men and women. I have done like this: I want to show the frequency for mean in upper side (positive y axis) and for women in lower side (negative ...
2
votes
1answer
30 views

how to remove the unecessay straight line in the plot?

The data in the array freq below is not sorted. Is there any convenient way to remove the the unecessay straight line from left to right in my plot? import pylab as pl import numpy as np ...
0
votes
1answer
17 views

graphing scatter for ranges in python's matplotlib

I have this graph so far, it's kind of ugly. Each type of marker is an accuracy for a type of algorithm. There are two problems with this: I'd like there to be space between the content and the ...
1
vote
1answer
28 views

How to Embed Cartopy in a Python Tkinter GUI?

I'd like to embed a Cartopy module map in a Python (2.7) Tkinter GUI app (on a Windows 7 PC), but I need help figuring out how. As far as I understand, the Cartopy module simply enables matplotlib ...
0
votes
0answers
41 views

Python skipping 'zero' values when plotting a series

I'm trying to make a plot which summarizes data by location. The script reads in 10+ government files and plots them correctly. The issue I'm having is that if one of that stations does not contain ...
0
votes
0answers
15 views

Removing nonuinform width in matplotlib bar plots

I have following code snippet: import matplotlib.pyplot as plt l = 50 plt.bar(range(l), [1]*l, edgecolor='none',color='r', linewidth=0) plt.bar(range(l), [-1]*l, edgecolor='none',color='r', ...
0
votes
1answer
25 views

How to write values of coordinates on plot in python

I have this function: def draw(LuxCoordinates, finalPix, verName, GraphNum): plt.axes([0.2, 0.2, 0.7, 0.6]); plt.xlim(0,3500); plt.ylim(0,100); if GraphNum == 1: ...
2
votes
1answer
37 views

Draw several graphs in matplotlib, python

I need to draw graphs in python matplotlib. For each graph I do some calculates before and then draw the graphe. Here is some of the code: import matplotlib.pyplot as plt def draw(LuxCoordinates, ...
0
votes
1answer
19 views

Plotting two ranges on one colorbar

Is it possible to get one colorbar to have two ranges? Basically I have two plots (created separatly and pasted into a blank image). They use the same colormap (hot), but the color is over a ...
0
votes
1answer
36 views
+50

calculate latitude and longitude from a geotiff image

How can I calculate mean latitude and mean longitude of each block from a geotiff image separating it into regular blocks (say, 50 by 50 pixels). The input data is just the imagery,for example as ...
1
vote
1answer
18 views

how to make a grouped boxplot graph in matplotlib

I have three algorithms, A, B, and C. I've run them on different datasets and would like to graph their runtimes on each as a grouped boxplot in Python. As a visual example of what I want, I made a ...
1
vote
0answers
17 views

zorder value to force grid to background [duplicate]

I'm looking for a way to force a given part of the image to background without having to also change the rest of the parts that compose that image. Example: I have an image made of a grid, a few ...
1
vote
1answer
23 views

how to plot a text on basemap, python

I was thinking to put a text on my map, like the satellite imagery. import numpy as np, matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap m = ...
1
vote
1answer
29 views

How to reduce size of a plot, keeping numbers axis the same?

I made a histogram plot with matplotlib, but the histogram occupies all space on the plot, I would like to add more space around. How can I scale down the histogram, but keep number on the axis the ...
0
votes
1answer
41 views

Matplotlib: Colour multiple twinx() axes

I'm currently using matplotlib within Sage to plot some data. I have made it possible to add multiple y axes using this example: from mpl_toolkits.axes_grid1 import host_subplot import ...
0
votes
2answers
40 views

The best plot for lists of bits in matplotlib

I have a nominal data with two values (0 and 1) of 400 values. I have an actual and a predicted data of this type. My need is that I want to plot these nominal values of both actual and predicted ones ...
0
votes
1answer
19 views

Why does Matplotlib savefig images overlap?

I have built a GUI app in python which uses Tkinter. This app produces and displays an image when a button is clicked. The image is produced with matplotlib savefig("displayimage.png") in same ...
0
votes
2answers
26 views

Remove first and last ticks label of each y-axis subplot

To create 5 subplots I used: `ax = plt.subplots(5, sharex=True)` Then, I want to remove the first and the last label tick of each y-axis subplot (because they overplot each other), I used: ...
1
vote
2answers
44 views

Divide a GeoTIFF image into regular grids and compute mean values

How can I subset a GeoTIFF (single band) image (say, 1000 by 1000 pixels) into regular square grids (say, 50 by 50 pixels; 400 grid objects in total); and calculate mean latitude, mean longitude, and ...
0
votes
1answer
23 views

Matplotlib double bar chart: Bars not properly drawn

I am trying to plot two different data columns of a frame ("n" and "m") for each data set as two differently colored bars next to each other. def graphPlot(data, size=None): pos = ...
-1
votes
2answers
51 views

Histogram bars overlapping matplotlib

I am able to build the histogram I need. However, the bars overlap over one another. As you can see I changed the width of the bars to 0.2 but it still overlaps. What is the mistake I am doing? from ...
0
votes
1answer
40 views

Python numpy polynomial fit: How to draw region of uncertainty curve?

I have data that I fit a curve to but which I want to also draw the points, the polynomial through the points; but also a "region of uncertainty" around the fitted line - if it were a 0 degree ...
-2
votes
1answer
44 views

Generating a wind vector diagram

I am trying to create a wind vector diagram through which I can visualize the direction and velocity of winds. My raw data consists of 50'000 consecutive measures of wind speed at 1'000 different ...
0
votes
1answer
28 views

Get xtick labels in matplotlib returns empty array?

For the following code: ax = plt.gca() ticks = ax.get_xticklabels(True) ax.set_xticklabels(labels,True) plt.show() The set_xticklabels is working and the plot is shown as expected . But the ...
0
votes
1answer
25 views

How do I run python 2.7.5 through sublime text 2?

My sublime REPL is currently running python 2.6.1, I have no idea how seeing as I have never downloaded it. I am trying to install matplotlib and keep getting this error: Traceback (most recent call ...
0
votes
3answers
31 views

Adding error bars to graph using matplotlib

So right now, I'm trying to add error bars to an existing graph but I keep running into some errors when I run my code. Below is the code when it works (without the error bars) with my additions ...
3
votes
1answer
44 views

Cleanest way to hide every nth tick label in matplotlib colorbar?

The labels on my horizontal colorbar are too close together and I don't want to reduce text size further: cbar = plt.colorbar(shrink=0.8, orientation='horizontal', extend='both', pad=0.02) ...
1
vote
1answer
24 views

Matplotlib Stackplot legend Error

I am trying to include a legend for my stackplot. I know that you cannot do it in the normal way so I followed the instructions from this similar post however there is still an error. x=data[:,-1] ...
1
vote
1answer
30 views

matplotlib plot set x_ticks

How would I set the x_axis labels at the indices 1,2,3....n to be something different. lam_beta = [(lam1,beta1),(lam1,beta2),(lam1,beta3),....(lam_n,beta_n)] chunks = [chunk1,chunk2,...chunk_n] ...
1
vote
2answers
32 views

Using dictionary as parameter in matplotlib in python

how can i use dictionary key or value in matplotlib instead of tuple tuple=(1,2,3,4) rects1 = ax.bar(ind, tuple, width, color='r') but i want to do it like this dic={'1':1,'2':2,'3':3,'4':4} ...
0
votes
1answer
37 views

How to set xlim in pythom matplotlib pyplot?

I have this code: import matplotlib.pyplot as pl pl.plot(np.log(alphas_lasso),coefs_lasso.T) #this generate a plot which xlim=[-8,-2] for alpha in alpha_min: pl.axvline(np.log(alpha),0,1) #add ...

15 30 50 per page