retentioneering / retentioneering-tools

Retentioneering: product analytics, data-driven CJM optimization, marketing analytics, web analytics, transaction analytics, graph visualization, process mining, and behavioral segmentation in Python. Predictive analytics over clickstream, AB tests, machine learning, and Markov Chain simulations.
https://doc.retentioneering.com/stable/doc/index.html
Other
798 stars 122 forks source link

Plot titles and output to .png #60

Closed john-graves-les-mills closed 1 year ago

john-graves-les-mills commented 1 year ago

To support the use case of sharing plots OUTSIDE of Jupyter (such as in a PowerPoint deck), have been looking at tweaks to the Quick Start plot examples:

title = 'Sankey' fig = stream.step_sankey(max_steps=6, threshold=0.05, show_plot=False).plot() fig.update_layout(title=title) fig.write_image(f"{title}.png")

title = 'Clusters' from retentioneering.tooling.clusters import Clusters clusters = Clusters(stream) X = clusters.extract_features(feature_type='tfidf', ngram_range=(1, 2)) clusters.fit(method='kmeans', n_clusters=8, X=X) fig = clusters.plot(targets=['payment_done', 'cart']) fig.title.set_text(title) fig.get_figure().savefig(f"{title}.png", bbox_inches='tight')

title = 'Funnel' fig = stream.funnel(stages=['catalog', 'cart', 'payment_done'], show_plot=False).plot() fig.update_layout(title=title) fig.write_image(f"{title}.png")

title = 'Heatmap' fig = stream.cohorts( cohort_start_unit='M', cohort_period=(1, 'M'), average=False, show_plot=False ).heatmap() fig.title.set_text(title) fig.get_figure().savefig(f"{title}.png")

Any suggestions for similar programmatic (.png) outputs for Transition Graph and Step Matrix would be appreciated.

ChernyshovAnton commented 1 year ago
  1. The transition graph interface currently has an export feature for svg and html. Try it, it works outside of the Jupyter environment. Export to png will be added in the next library update. image

  2. We'll add a method for exporting the step matrix to png into our backlog. It's likely that we'll implement it when we roll out the interactive step matrix.

Thank you for your feedback. Were my responses helpful?

VladislavYak commented 6 months ago

any updates here?

  1. The transition graph interface currently has an export feature for svg and html. Try it, it works outside of the Jupyter environment. Export to png will be added in the next library update. image
  2. We'll add a method for exporting the step matrix to png into our backlog. It's likely that we'll implement it when we roll out the interactive step matrix.

Thank you for your feedback. Were my responses helpful?