Comments (5)
Hey Chris,
Currently the way to do this would be:
fig=cf.tools.figures(df,[{'kind':'bar'},{'kind':'scatter','mode':'markers','color':'red'}])
cf.iplot(fig)
cf.tools.figures takes a DataFrame and then a list of dictionaries with all the specs.
This works today. But of course it could be enhanced if you think it could be made easier. I think passing the 'kind' types in a dict is intuitive enough, the problem is when you start passing specs. That is why I went down this way, but let me know what you think.
from cufflinks.
got it! that looks like a good solution for now!
from cufflinks.
hey @santosjorge - I'm just giving this a try today. Since cf.tools.figures
returns a list of figures
, it seems like I need to merge the figures before I plot them, e.g.
df = cf.datagen.lines(2, 5)
figs = cf.tools.figures(df, [
{'kind': 'bar'},
{'kind': 'scatter', 'mode': 'markers'}
])
fig = {'data': [], 'layout': {}}
for f in figs:
fig['data'].extend(f['data'])
fig['layout'].update(f['layout'])
I'm not sure if the solution is for cf.tools.figures
to return a single, merged figure or for another cf.tools
function like cf.tools.create_figure
, or the original suggestion of letting df.iplot
accept values as an array. Thoughts?
from cufflinks.
Hey Chris,
cf.figures returns a single figure already merged. You should be able to do
df = cf.datagen.lines(2, 5)
figs = cf.tools.figures(df, [
{'kind': 'bar'},
{'kind': 'scatter', 'mode': 'markers'}
])
cf.iplot(figs)
without any issue.
But I'll work in a new function to do accept values as an array. I will try first with df.iplot
, I am just concerned about overloading it too much. I'll get back to you on this.
from cufflinks.
Hi.
I am trying to have different kind of plots with different data and with a secondary axis. But in the last step of having a different axis I have had problems. How I could solve this step?
I try adding a secondary y axis, but it doesn't work.
df = pd.DataFrame({'y1': [3, 1, 5], 'y2': [30, 50, 20], 'y3': [300, 500, 200]}, index=[1, 2, 3])
fig=cf.tools.figures(df,[{'kind':'bar','keys':['y2','y1']},
{'kind':'scatter','keys':['y3'],'mode':'markers','color':'red',
'secondary_y':['y3']}])
Version '0.17.0'
Thank you so much in advance.
from cufflinks.
Related Issues (20)
- Cufflinks is installed in Anaconda,But it says No module named 'cufflinks' HOT 1
- Make it extendable like adding custom study in QuantFig HOT 2
- Cufflinks stuck in Google Colab when plotting simple example from README.md HOT 3
- Any issue about Plotly.py 5.0.0 ? HOT 1
- Will Panel render plots made with cufflinks?
- PlotlyRequestError: Authentication credentials were not provided with PyCharm (Jetbrains) HOT 2
- bar: How to invert?
- Strange colors of bubble plot
- MACD incorrect
- why the different formats of dates in quant_figure? HOT 1
- Is there a way to plot bar and line on the same chart different axis.
- Question: Is it possible to download raw data that qf calculates
- QuantFig and iplot
- iplot('ratio') shoud sync X axis by default HOT 1
- iplot('ratio', secondary_y_title='...') position wrong
- Colorbar : Plotly vs Cufflinks Scatter Plot
- [BUG] Handling two columns with the same name on .iplot()
- rcmd
- Spread Chart Pandas Attribute Error HOT 3
- after update pandas to 2.2.0 site-packages/cufflinks/plotlytools.py:117: FutureWarning:
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cufflinks.