plotly django

Hello everyone! Recently I had to do some visualizations for my university project, I’ve done some googling and haven’t found any simple guides on how to put Plotly plots on an HTML page.

大家好! 最近,我不得不为我的大学项目做一些可视化处理,做了一些谷歌搜索,还没有找到任何有关如何在HTML页面上放置Plotly图的简单指南。

Before we start I assume that you have running the Django HTML page. Why Plotly? Plotly allows you to make interactive, beautifully designed plots in a matter of minutes. Despite that originally Plotly is a Python library, we won’t use any Python programming today.

在开始之前,我假设您已经运行了Django HTML页面。 为什么情节? 通过Plotly,您可以在几分钟内完成交互式 ,设计精美的绘图。 尽管Plotly最初是一个Python库,但今天我们不会使用任何Python编程。

对于那些没有太多时间的人,这里是简短指南: (For those who don’t have much time, here is the short guide:)

  • Go to Plotly Chart Studio, create your account.

    转到Plotly Chart Studio ,创建您的帐户。

  • Click on the “Create” button and choose “Chart”.
    单击“创建”按钮,然后选择“图表”。
  • Import your data and click on the “Trace” button.
    导入数据,然后单击“跟踪”按钮。
  • Choose the type of plot you want.
    选择所需的绘图类型。
  • Once you made your dream-plot, save it, setting all the settings to “Public”.
    完成梦境图后,将其保存,将所有设置都设置为“公共”。
  • Share your plot, by copying iframe code from the “Embed” tab and past it to the body of your HTML page.
    通过从“嵌入”标签复制iframe代码并将其粘贴到HTML页面的正文中,共享绘图。

Now for those who have time, let’s see in detail how we can get the same result, as you saw at the beginning.

现在,对于那些有时间的人,让我们详细了解如何获得与您一开始看到的结果相同的结果。

步骤1.创建一个帐户并上传数据。 (Step 1. Creating an account and uploading the data.)

Image by Author
图片作者

We will use Plotly Chart Studio. Once you’ve signed up, you’ll see “Create” in the upper-right corner.

我们将使用Plotly Chart Studio 。 注册后,您会在右上角看到“创建”。

To create our visualizations we have to import our data first. The data can be either CSV, single-sheet Excel file, link to a CSV file or the data got using SQL and Falcon SQL client.

要创建可视化,我们必须首先导入数据。 数据可以是CSV,单页Excel文件,链接到CSV文件或使用SQL和Falcon SQL客户端获取的数据。

Once you uploaded your data, you’ll see it in the table (red square) on the top of your screen.

上传数据后,您会在屏幕顶部的表格(红色正方形)中看到该数据。

Plotly Studio, Image by Author
Plotly Studio,作者提供的图片

步骤2.选择图的类型并跟踪数据。 (Step 2. Choosing the type of plot and tracing the data.)

Now let’s look at the blue square on the picture and trace some data.

现在,让我们看一下图片上的蓝色方块并跟踪一些数据。

Image by Author
图片作者

You can choose between different types of plots. Here I chose the Choropleth Atlas Map since it allows me to get this nice Earth visualization.

您可以在不同类型的图之间进行选择。 在这里,我选择了Choropleth Atlas地图,因为它可以使我获得很好的地球可视化效果。

步骤3.指定位置和值。 (Step 3. Specifying location and values.)

Then you have to specify columns that will be used as locations and values. You also have to choose the location format, since it can be countries’ names or abbreviations and so on.

然后,您必须指定将用作位置和值的列。 您还必须选择位置格式,因为它可以是国家或地区的名称或缩写等。

Image by Author
图片作者

Here you can see all my settings, which you can use to get the same result as mine.

在这里,您可以看到我的所有设置,可以用来获得与我相同的结果。

步骤4.保存和共享图。 (Step 4. Saving and sharing the plot.)

Image by Author
图片作者

We are almost there! Click the “Save” button and choose “Public” for Plot and Grid.

我们就快到了! 单击“保存”按钮,然后为“图和网格”选择“公共”。

Image by Author
图片作者

Finally, you click the “Share” button, choose “Embed” and copy iframe HTML code, which you can pass in the body of your HTML page.

最后,您点击“共享”按钮,选择“嵌入”并复制iframe HTML代码,您可以将其传递到HTML页面的正文中。

Thank you for reading!

感谢您的阅读!

翻译自: https://towardsdatascience.com/making-beautiful-visualizations-for-a-django-html-page-using-plotly-f4e97d3f6bc7

plotly django

http://www.taodudu.cc/news/show-995022.html

相关文章:

  • 软件工程方法学要素含义_日期时间数据的要素工程
  • 数据湖 data lake_在Data Lake中高效更新TB级数据的模式
  • ai对话机器人实现方案_显然地引入了AI —无代码机器学习解决方案
  • 图片中的暖色或冷色滤色片是否会带来更多点击? —机器学习A / B测试
  • 图卷积 节点分类_在节点分类任务上训练图卷积网络
  • 回归分析预测_使用回归分析预测心脏病。
  • aws spark_使用Spark构建AWS数据湖时的一些问题以及如何处理这些问题
  • 数据科学家编程能力需要多好_我们不需要这么多的数据科学家
  • sql优化技巧_使用这些查询优化技巧成为SQL向导
  • 物种分布模型_减少物种分布建模中的空间自相关
  • 清洁数据ploy n_清洁屋数据
  • 基于边缘计算的实时绩效_基于绩效的营销中的三大错误
  • 上凸包和下凸包_使用凸包聚类
  • 决策树有框架吗_决策框架
  • mysql那本书适合初学者_3本书适合初学者
  • 阎焱多少身价_2020年,数据科学家的身价是多少?
  • 卡尔曼滤波滤波方程_了解卡尔曼滤波器及其方程
  • 朴素贝叶斯分类器 文本分类_构建灾难响应的文本分类器
  • Seaborn:Python
  • 销货清单数据_2020年8月数据科学阅读清单
  • 米其林餐厅 盐之花_在世界范围内探索《米其林指南》
  • spotify 数据分析_我的Spotify流历史分析
  • 纹个鸡儿天才小熊猫_给熊猫用户的5个提示
  • 图像离群值_什么是离群值?
  • 数据预处理工具_数据预处理
  • 自考数据结构和数据结构导论_我跳过大学自学数据科学
  • 在PyTorch中转换数据
  • tidb数据库_异构数据库复制到TiDB
  • 刚认识女孩说不要浪费时间_不要浪费时间寻找学习数据科学的最佳方法
  • 什么是数据仓库,何时以及为什么要考虑一个

plotly django_使用Plotly为Django HTML页面进行漂亮的可视化相关推荐

  1. plotly python_使用Plotly for Python时的基本思路

    plotly python I recently worked with Plotly for data visualization on predicted outputs coming from ...

  2. django解决页面跳转问题

    django解决页面跳转问题 参考文章: (1)django解决页面跳转问题 (2)https://www.cnblogs.com/studong/p/9181524.html 备忘一下.

  3. Django3创建数据库表模型及 Django 管理页面

    前提条件 Django3创建项目及应用 查看所使用的数据库 打开test01/settings.py,查看使用的是sqlite3 DATABASES = {'default': {'ENGINE': ...

  4. Python【算法中心 02】Web框架Django管理页面使用(管理员账号创建+API使用+应用添加)GreenPlum数据库引擎及API测试

    1.SQLite管理员账号创建 SQLite 是 Django 默认的数据库体量上类似与 Apache Derby,配置信息如下: DATABASES = {'default': {'ENGINE': ...

  5. django的页面报错中出现xxxx.html (Skipped)

    完整报错如下: Using engine django: django.template.loaders.filesystem.Loader: /home/appleyuchi/桌面/Python新手 ...

  6. django新闻页面编写

    自分层结构的 Web 设计理念普及以来,选择适合的开发框架无疑是项目成功的关键.在动态语言领域,Python.Ruby.Groovy 等语言在 Web 开发中的应用日益广泛.刚刚度过两周年生日的 Py ...

  7. plotly系列| 使用plotly在地图上绘制散点图和密度图

    目录 Plotly简介 在地图上制作散点图和密度图 1 . 在python中使用pip命令安装 2 .导入包 3 .读取文件 4 . 在地图上绘制散点图 5 . 绘制密度图,其属性与绘制散点图相似 关 ...

  8. Django admin 页面添加自定义按钮 点击事件

    基于 simpleui 开发, Simple UI 一款基于vue+element-ui的django admin现代化主题 普通admin 好像实现不了, Simpleui 官网:https://s ...

  9. django ajax页面跳转,Django中的AJAX GET请求后重定向

    我是新的Django和AJAX(javascript). 最后,我可以发送一些参数到Django视图.这个视图呈现一个编辑表单. 我发送的参数和视图响应的形式与我需要的信息,但我不能重定向到从视图呈现 ...

最新文章

  1. 在某些输入上删除IE10的“清除字段”X按钮?
  2. 函数调用栈 剖析+图解
  3. Linux——快照与克隆
  4. 【单片机相关】的网站
  5. 200822C阶段一文件
  6. 关于application title一直是untitled的问题
  7. pvrect r语言 聚类_技术贴 | R语言——肠型分析:介绍、方法
  8. 记录一下这几天写专利的日子
  9. WinRAR压缩加密的做法
  10. crmeb安装教程说明
  11. 2018 UL国际皇冠杯将于10月4日-7日在仁川举行
  12. JVM 内存分配策略
  13. 如何出售自己的代码并且不让人看到自己的源码?
  14. android 耳机口充电,安卓手机没有3.5mm耳机接口,手机如何实现一边充电跟一边听歌?边充边听方案...
  15. 删除Skypee顽固病毒(AutoIt3木马)
  16. 软件测试中常用的简称
  17. 博客园使用markdown发布博客
  18. 移动设备网页中快速响应单击动作
  19. 2022-2028全球与中国磁屏蔽功率电感器市场现状及未来发展趋势
  20. root下安卓7以上添加系统信任证书

热门文章

  1. BZOJ 2844 | HYSBZ - 2844albus就是要第一个出场——线性基
  2. Linux平台上SQLite数据库教程(一)——终端使用篇
  3. 网络基础: 浅析应用层一
  4. 1091 N-自守数 (15 分)
  5. gcc编译器的整个工作过程
  6. HTML列表标签,讲的明明白白!
  7. bitmap转换为drawable
  8. strust2自定义拦截器
  9. 《SQL Server 2008从入门到精通》--20180716
  10. 作业二:个人博客作业内容:需求分析