plotnine is a python plotting package that implements a "Grammar of Graphics" . It is based on the R package ggplot2 and has an API that is similar.
Questions tagged [plotnine]
179 questions
0
votes
1 answer
"Could not evaluate the 'color' mapping" error in Plotnine
I'm having an issue with Plotnine on python everything is working fine except when I attempt to specify a color in aes I get an error saying:
PlotnineError: "Could not evaluate the 'color' mapping: 'black'
(original error: name 'black' is not…

user2676759
- 1
- 3
0
votes
1 answer
Plotnine - adding vertical lines and histograms to same chart
I'm trying to figure out how to do this in python as I'm a bit newer to it vs R.
import plotnine as p9
import pandas as pd
import numpy as np
###load the data…

runningbirds
- 6,235
- 13
- 55
- 94
0
votes
0 answers
Can't import plotnine
Getting an error when trying to import plotline; I pip installed Unicode, but still seeing the same error. Not sure what else I need to install.
import plotline as p9
ImportError: cannot import name 'unicode'

Iva
- 1
- 1
0
votes
1 answer
Multiclass plotnine geom_density graph doesn't work
I have trouble using plotnine: I can't make graphic with 3 classes in(separated by color).
import pandas as pd
import numpy as np
from plotnine import *
path =…

Vladislav Gusak
- 13
- 3
0
votes
0 answers
Tkinter crashes when trying to save plot created using plotnine
I am using Python 3.5.3 on Debian 9.
Tkinter window crashes when clicking the button "Create Plot" to save a plot created using plotnine. The plot however gets successfully saved in the working directory. The code block stated below is a simple…
0
votes
1 answer
How to put labels in a stacked bar using plotnine
I have the following dataframe
import pandas as pd
from plotnine import *
df = pd.DataFrame({
'variable': ['gender', 'gender', 'age', 'age', 'age', 'income', 'income', 'income', 'income'],
'category': ['Female', 'Male', '1-24', '25-54',…

quant
- 4,062
- 5
- 29
- 70
0
votes
1 answer
how to print quantiles using plotnine in python
I have the following dataframe:
import pandas as pd
import numpy as np
from plotnine import *
df = pd.DataFrame.from_dict({'variable': {0: 'intercept', 1: 'intercept', 2: 'intercept', 3: 'intercept', 4: 'intercept', 5: 'intercept', 6: 'intercept',…

quant
- 4,062
- 5
- 29
- 70
0
votes
0 answers
Conda install conflict with remaining packages
For some reason, I can't install any packages with my current setup. I have conda version 3.7 and python 3.4. I've tried the following:
conda install -c conda-forge rdkit
conda install -c rdkit rdkit
conda install -c conda-forge plotnine
and in…

chemdatafarmer
- 333
- 2
- 3
- 11
0
votes
1 answer
Deleting blank lines in faceted plot produced using geom_tile function from plotnine
Hi I'm trying to produce a facetted plot using the geom_tile function of the plotnine Python library. I'm getting stuck with blank lines that appear in classes A,B and C (see example below). I would like to delete these blank lines while preserving…

dputhier
- 734
- 1
- 7
- 23
0
votes
1 answer
Plotting a function with 4 arguments in a grid of heatmaps
I am using plotnine in python 2 (but would be happy for a solution using matplotlib or any other plotting package). I have a function (slightly simplified below) with 4 arguments. I want to plot a grid of heatmaps, with "super axes" varying two of…

LangeHaare
- 2,776
- 2
- 17
- 25
0
votes
1 answer
How to find what can be tuned in theme()
New to python, I'm trying to fine tuning the plotnine graph, and explore what can be done in the theme() function. I'm just wondering what is the general way to find out what else is available for me to play with.
theme(plot_title =…

xappppp
- 481
- 7
- 18
-1
votes
1 answer
module 'plotnine' has no attribute 'ggplot_build'
p3 = (p9.ggplot(data = df, mapping = p9.aes(x = 'gross_power', y = 'temp_drop_a',show_legend=False, alpha = 0.7))
+ p9.geom_jitter()
+ p9.geom_smooth(se= 'F',method="lm", colour = 'red'))
mygg_data = p9.ggplot_build(p3).data[[2]]

Heidi
- 11
- 2
-1
votes
1 answer
How to plot a 2 dimensional density / heatmap in plotnine?
I am trying to recreate the following graph in plotnine. It's asking me for more details but I don't want to distract from the example. I think it's pretty obvious what I'm trying to do. I have been given a function by a colleague. I'm not…

Jay Bundy
- 19
- 2
-1
votes
1 answer
plotnine - jupyter lab -- adds x and y values in margins
I have imported plotnine and run the following code.
The examples run, but when I run a plot like the one below I get all the x and y values printed in the margin. Anyone else r
x = np.arange(-5.,5.,0.25,dtype=float)
gamma = 5.
y =…

bill fite
- 43
- 5