Tagged Questions
1
vote
3answers
45 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 = ...
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 ...
1
vote
1answer
66 views
Easy way to set the position of x-axis in pandas?
I have a chart, created in pandas, where I've set the y-axis to range from -100 to -100.
Is there an easy way to have the x-axis cross the y-axis at y=0, instead of crossing at y=-100
(or, how to ...
1
vote
2answers
72 views
Make a multiline plot from .CSV file in matplotlib
I've been trying for weeks to plot 3 sets of (x, y) data on the same plot from a .CSV file, and I'm getting nowhere. My data was originally an Excel file which I have converted to a .CSV file and have ...
1
vote
0answers
61 views
How to create bar chart with secondary_y from dataframe
I want to create a bar chart of two series (say 'A' and 'B') contained in a Pandas dataframe. If I wanted to just plot them using a different y-axis, I can use secondary_y:
df = ...
0
votes
1answer
55 views
Python pandas plot is a no-show
When I run this code
import pandas as pd
import numpy as np
def add_prop(group):
births = group.births.astype(float)
group['prop'] = births/births.sum()
return group
pieces = []
columns ...
2
votes
1answer
116 views
Pandas Plots: Separate color for weekends, pretty printing times on x axis
I created a plot which looks like
I have a few issues:
How can i specifically show the weekends. Some ways i had thought were to grab the indices corresponding to weekends and then draw transparent ...
2
votes
1answer
37 views
matplotlib “axis.invert_xaxis” crashes when using datetime
If I run the following code:
import pandas as pd
from datetime import datetime
import numpy as np
import matplotlib.pyplot as plt
#df = pd.DataFrame(np.random.randn(3,1), index=[8,9,10], ...
0
votes
0answers
66 views
Time Series plot of timestamps in monthly buckets using Python/Pandas
I have a tab separated text file data.txt that contains two columns, user id and times stamp.
id ts
84853 1345285747
84854 1345285747
84855 1345285747
84856 1345285747
How do I create ...
1
vote
1answer
131 views
Why is there so much fuzz about d3 and alike? [closed]
Sorry if this question is considered trivial but I am a bit lost:
Why is there so much discussion and efforts in working with d3 for data visualization?
In python we have matplotlib (MPL). It can to ...
0
votes
1answer
52 views
How to create five different figures with the same format in one script from a single DataFrame based on a single Excel file?
I am still very new to Python so this is likely an easy question but I have yet to locate a satisfactory answer. I have data from five different sources which I am trying to plot in one script after ...
0
votes
1answer
96 views
Getting vertical gridlines to appear in line plot in matplotlib
I want to get both horizontal and vertical grid lines on my plot but only the horizontal grid lines are appearing by default. I am using a DataFrame from an sql query in python to generate a line plot ...
0
votes
1answer
61 views
Incorrect plot from a pandas Series with datetimes indeces
When I use matplotlib to plot a pandas Series containing three float values with indices that are datetimes, I get a incorrect plot with a vertical line in the middle. It looks like this:
I've been ...
2
votes
1answer
89 views
Annotate scatterplot from a pandas dataframe
I am using pandas and matplotlib to visualize this dataframe
HDD EnergyPerSquareMeter Year
0 3333.6 23.11 1997
1 3349.6 24.30 1998
2 3319.5 24.78 1999
3 3059.1 22.01 ...
1
vote
1answer
89 views
Annotate data points while plotting from Pandas DataFrame
I would like to annotate the data points with their values next to the points on the plot. The examples I found only deal with x and y as vectors. However, I would like to do this for a pandas ...