Tagged Questions
0
votes
0answers
32 views
making a logarithmic scaled color plot
I have a surface density map in matplotlib for which I want the scale of the colorbar to be logarithmic.
Ideally using the LogNorm function should do the trick, but there are negative and null ...
1
vote
1answer
23 views
add vertical line intersecting 3 different axes in a figure in matplotlib
i have to plot eeg data of 3 different channels in my graph. I would like to plot of all of them in one figure seperated by horozintal lines. X axis common to all the channels.
I can do this easily ...
-1
votes
0answers
22 views
Python: Using sympy.simplify with cplot (avoiding eval)
I'd like to avoid using eval() and replace it with sympy.simplify() like this
from cmath import *
import sympy
from mpmath import arg, cplot
fhandle = "exp(sin(z))"
# Draws a colorful plot, but is ...
0
votes
1answer
57 views
python: submit variable to main program
I have a program as below:
first,I plot a picture:
fig=plt.figure(figsize=(7,6))
ax = fig.add_subplot(111)
ax.plot(x,y,'ro')
ax.set_title('click on points')
plt.show()
then when I right-click the ...
1
vote
1answer
24 views
cursor tracking using matplotlib and twinx
I would like to track the coordinates of the mouse with respect to data coordinates on two axes simultaneously. I can track the mouse position with respect to one axis just fine. The problem is: when ...
0
votes
1answer
41 views
python: how can I double left click to get a point in python
I have a map ,and now I want to double left click to zoom-in the map and left click to get a point.How should I do? I know 'ginput' command but it seems can't work with double-left-click.
...
0
votes
0answers
19 views
pyplot 3D bar legend
I'm trying to add legend to a 3d bar, but with no success.
I'm getting the error:
AttributeError: 'Patch3D' object has no attribute '_facecolor2d'
A minimal code for reproducing:
from ...
1
vote
1answer
27 views
Difference between plt.close() and plt.clf()
I am running a loop where at the end of each iteration I am producing a figure and saving the plot. On first couple tries the plot was retaining the old figures in every subsequent plot. Now ...
1
vote
1answer
32 views
Python: Can a 3d plot made from a list of data points have a gradient color scheme?
I have a list of points that are plotted in 3d, and I would like to have a gradient color scheme for the plot. Is this possible? If so, how can it be done? I tried some of the examples on the ...
0
votes
1answer
24 views
Colormap issue using animation in matplotlib
I use matplotlib.animation to animate data in a 3D array named arr. I read data from a h5 file using h5py library and everything is OK. But when using animation, the colormap got stuck in first frame ...
2
votes
1answer
33 views
Equivalent to matlab's imagesc in matplotlib?
I am coming to Python and numpy and matplotlib from a Matlab background. One function in matlab that I use all the time is imagesc. Is there an exact equivalent to this somewhere in matplotlib? I ...
1
vote
3answers
42 views
Horizontal stacked bar chart in Matplotlib
I'm trying to create a horizontal stacked bar chart using matplotlib but I can't see how to make the bars actually stack rather than all start on the y-axis.
Here's my testing code.
fig = ...
0
votes
1answer
18 views
Matplotlib surface plot of precomputed values
I trying to plot a grid of values obtained via finite differencing. Hence all the examples which show me how to make a mesh-grid output xx, yy then feed these into f to generate a grid-evaluation ...
1
vote
3answers
31 views
python plot and powerlaw fit
I have the following list:
[6, 4, 0, 0, 0, 0, 0, 1, 3, 1, 0, 3, 3, 0, 0, 0, 0, 1, 1, 0, 0, 0, 3, 2, 3, 3, 2, 5, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 2, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 2, 0, 0, 0, 2, ...
0
votes
1answer
33 views
Refresh the data in bar chart in matplotlib
The idea is that I want to refresh the data in the bar chart, not to update the previous data. Is there any method used to wipe out the previous data of the chart and apply the new one?
I have the ...
1
vote
1answer
42 views
Unicode character render
I can't find a way to render the unicode characters in the matlibplot chart:
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
from numpy.random import normal
from itertools import count
...
0
votes
1answer
31 views
Pyplot bar chart does not match table columns position with all bars
I'm building a bar graph with a table using the code example.
Everything looks good when I have up to 10 columns, but above 10 columns the bars are shifted to the left and do not match the position ...
1
vote
1answer
60 views
Ploting a spectrogram of a pure sinus with matplotlib
I'm trying to get a spectogram plot of a pure sine function. Together with that i want to show a plot of the fft of that whole signal. I'm expecting the peaks to be on the same frequency since were ...
-2
votes
1answer
43 views
Is there a good solution for space efficiently showing multiple images in pylab/matplotlib? [closed]
I am looking for a montage.m equivalent.
It takes some images and displays them in a nice and space-efficient manner.
I am mainly looking for something that is more space-efficient than subplots and ...
0
votes
1answer
34 views
matplotlib savefig doesn't work when run with crontab
I'm trying to run a python script with crontab that uses matplotlib to save a plot png. The script runs fine when run normally/not by cron.
My crontab file is:
SHELL=/bin/bash
...
0
votes
1answer
29 views
Legend using PathCollections in matplotlib
I'm plotting groups of circles using collections and I am not able to generate the legend of the three categories. I want:
Cat 1: red circles
Cat 2: blue circles
Cat 3: yellow circles
import ...
6
votes
1answer
222 views
using arctan / arctan2 to plot a from 0 to 2π
I am trying to replicate a plot in Orbital Mechanics by Curtis but I just can't quite get it. However, I have made head way by switching to np.arctan2 from np.arctan.
Maybe I am implementing arctan2 ...
0
votes
1answer
21 views
Demonstration of Forward Time Central Space in Python's matplotlib animation package
I want to create a simple animation of how bad the Forward Time Central Space (FTCS) solves the flux conservation equation for a Gaussian velocity distribution ("Physics... yeah!"). I have written a ...
0
votes
1answer
29 views
Extracting subplot coordinates in Python
I am new to Python and I am actually trying to plot a figure over a subplot.
The difficult thing is that I need the axes property which is a string I can obtain by simply printing the subplot ...
2
votes
0answers
28 views
Matplotlib polar plot radial axis offset
I was wondering, is it possible to offset the start of the radial axis or move it outside of the graph.
This is what I'm hoping to achieve:
And this is what I have for now.
I have read the ...
1
vote
1answer
40 views
Stop pandas plot from doing new x-axis layout
I have a problem of an automatic x-axis rescaling happening when I do the following:
plot column 1
plot column 1 where column 2 is notnull, but with different style.
The second plot keeps ...
0
votes
1answer
32 views
Standalone colorbar (matplotlib)
I'm rendering some graphics in python with matplotlib, and will include them into a LaTeX paper (using LaTex's nice tabular alignment instead of fiddling with matplotlib's ImageGrid, etc.). I would ...
1
vote
2answers
33 views
python matplotlib save plot
It must be easy but I still cant figure it out. Suppose I am reading lot of txt file with glob module.And do some processing, and later plotting them with matplotlib.
import glob
ascii = ...
2
votes
2answers
32 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 ...
0
votes
1answer
37 views
python matplotlib giving peak position value
I have two arrays which came from scripting. The two arrays are given below-
x = array([ 0.35970013, 0.36476619, 0.36983225, 0.3748983 , 0.37996435,
0.38503039, 0.39009642, 0.39516245, ...