Questions tagged [python-ggplot]

A python plotting library emulating R's ggplot2.

A python plotting library emulating R's ggplot2. https://github.com/yhat/ggpy

205 questions
3
votes
0 answers

matplotlib and ggplot - face_grid text size label

I am using ggplot's facet_grid function on date. p = ggplot(aes(x='meh',weight='mah',fill='type'),data=plot_df) + geom_bar(stat='identity') + facet_grid('date',scales='fixed') + ggtitle(title) I am using the following arguments to edit the legend…
LearningSlowly
  • 8,641
  • 19
  • 55
  • 78
3
votes
1 answer

geom_smooth option missing ggplot from python

I am trying to make plot using ggplot in python. When I try to run, I get an error" ggplot(data,aes(x='Average Credit Card Transaction',y='response'))+\ geom_smooth(se=False,span=0.2)+xlab("Average Credit Card…
user3922546
  • 187
  • 1
  • 6
  • 16
3
votes
1 answer

Plotting event density in Python with ggplot and pandas

I am trying to visualize data of this form: timestamp senderId 0 735217 106758968942084595234 1 735217 114647222927547413607 2 735217 106758968942084595234 3 735217 106758968942084595234 4 735217 …
MasterScrat
  • 7,090
  • 14
  • 48
  • 80
3
votes
0 answers

Not able to plot with ggplot in python

I am trying to get started with the ggplot library in python. I am using V 2.7.6 in Enthought Canopy. When I try to run the simple script from ggplot import * print ggplot(mtcars, aes('mpg', 'qsec')) + \ geom_point(colour='steelblue') + \ …
Wave Man
  • 33
  • 3
3
votes
1 answer

ggplot multiple plots in one object

I've created a script to create multiple plots in one object. The results I am looking for are two plots one over the other such that each plot has different y axis scale but x axis is fixed - dates. However, only one of the plots (the top) is…
OAK
  • 2,994
  • 9
  • 36
  • 49
3
votes
3 answers

Python, Roc curves and ggplot?

I followed a tutorial for displaying the roc curves and the corresponding auc; I never used the ggplot library, thus I cannot understand where is my error. Here the code below: from sklearn import metrics import pandas as pd from ggplot…
ElenaPhys
  • 443
  • 2
  • 5
  • 16
3
votes
3 answers

Group Bar Chart with Seaborn/Matplotlib

My goal is to create a grouped bar chart like the one below, using a pandas DataFrame that is grouped by two variables "Alpha" and "Beta." xl2 = xl.groupby(['Alpha','Beta']).median() When I tried this, a KeyError was thrown on 'Alpha' import…
NumenorForLife
  • 1,736
  • 8
  • 27
  • 55
3
votes
2 answers

Python ggplot: Is it possible to turn off the GUI displayed? and get a command-line ("non-interactive plotting"/"batch")

When plotting with Python ggplot, every single plot command causes a GUI pane to be displayed and suspend execution ("interactive plotting"). But I want to: avoid/ turn off this GUI and save the plot object some where in runtime (I will be…
Ramkumar
  • 444
  • 1
  • 7
  • 22
3
votes
0 answers

using factor in ggplot for python

I'm having trouble using factor in ggplot for python. Here is the R code that I want to re-create in python. library('ggplot2') head(iris) ggplot(iris, aes(Sepal.Length,Sepal.Width)) + geom_point(aes(colour=factor(Species))) In python I do the…
itjcms18
  • 3,993
  • 7
  • 26
  • 45
3
votes
1 answer

What do I need to do using IPython and ggplot to get legends on multiple time-series plot?

I am trying to learn how to use the ggplot library in python. In familiarizing myself with some of the examples, I noticed that to get a time series plot of several series, it seems to be necessary to pandas.melt() the data into long form. Using Is…
Fred Mitchell
  • 2,145
  • 2
  • 21
  • 29
3
votes
0 answers

Changing the legend position when ploting using python-ggplot

Is it possible to change the position of the Legend when plotting using python-ggplot? For example, from left to top? I have tried ppb1Lp+theme_bw(legend.position="top") where ppb1Lp is a ggplot object. But it gives an error: SyntaxError: keyword…
alexQch
  • 31
  • 2
3
votes
2 answers

Is it possible to plot multiline chart on Python ggplot?

I need to plot 3 columns of a Pandas dataframe on python ggplot, with the same index. Is that possible? Thank you
Hugo
  • 1,558
  • 12
  • 35
  • 68
3
votes
1 answer

Matplotlib equivalent to ggplot geom_ribbon?

I would like to reproduce the ggplot style of showing a confidence interval around a value with a ribbon, like geom_ribbon or geom_smooth. I tried calculating the confidence interval separately and plotting with fill_between() which is close but…
Alex I
  • 19,689
  • 9
  • 86
  • 158
3
votes
1 answer

How do I format the x-axis on Python Ggplot?

I need to format dates on a x-axis ggplot for python bar chart. How can I do it?
Hugo
  • 1,558
  • 12
  • 35
  • 68
3
votes
1 answer

Facet wrap loses datetime format on x axis

When trying to facet wrap dataframe with dates on the x axis and values on the y axis, the dates all lose format. The relevant code below produces the attached graph. Any workarounds or solutions would be greatly appreciated. Thanks! Updated: I've…
BCR
  • 960
  • 11
  • 27
1 2
3
13 14