pascal-schetelat / slope Goto Github PK
View Code? Open in Web Editor NEWE. Tufte slope graph implementation in Python
License: MIT License
E. Tufte slope graph implementation in Python
License: MIT License
Line 264 breaks on import to python 3.4
Needs to be:
print('fail')
Hello,
I'm not sure if Slope could work with Python 3.5, but I just tried the Random Data Example and the plotting is not as expected.
Code:
import pandas as pd
import numpy as np
from slope.plotSlope import slope
df = pd.DataFrame( np.random.normal(loc=np.ones(shape=[20,30])*np.arange(30)))
df.rename(columns = lambda el : str(el),index =lambda el : str(el),inplace=True)
f = slope(df.T,width =10,height= 8,kind='ordinal',savename='t.png',dpi=200,color={'10':'red','27':'blue'},marker=None)
This code will produce this graph:
These warnings are shown, but from what I understood they are not related to the plotting:
C:\path\to\plotSlope.py:170: FutureWarning: sort is deprecated, use sort_values(inplace=True) for INPLACE sorting
yMark_L.sort(ascending=False)
C:\path\to\plotSlope.py:171: FutureWarning: sort is deprecated, use sort_values(inplace=True) for INPLACE sorting
yMark_R.sort(ascending=False)
C:\path\to\plotSlope.py:178: FutureWarning: sort(columns=....) is deprecated, use sort_values(by=.....)
yPos_L.sort(cols[i], inplace=True)
C:\path\to\plotSlope.py:179: FutureWarning: sort(columns=....) is deprecated, use sort_values(by=.....)
yPos_R.sort(cols[i + 1], inplace=True)
C:\Python\Python35\lib\site-packages\matplotlib\font_manager.py:1288: UserWarning: findfont: Font family ['GillSans'] not found. Falling back to Bitstream Vera Sans
(prop.get_family(), self.defaultFamily[fontext]))
with pandas (0.18.1), numpy (1.11.0), and matplotlib (1.5.1)
Hi Pascal,
I stumbled upon your great IPython Notebook for the Slope module, but by trying it myself I have issues with the plotting of the labels. The line is continuous where in your results they aren't and show a white background. See this example:
Is there any quick hack to solve this? I tried it on a windows and Linux version resulting in both the same issue.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.