全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 LATEX论坛
1565 0
2016-10-18
1. MATLAB plotting with LaTeX

First, here’s an example using Plotly’s MATLAB API. This is a visualization of Bessel Functions of the first kind, solutions for a differential equation. It’s a useful function for studying and understanding heat conduction, how waves travel, and more. The MATLAB code below creates our plot.


复制代码


The code generates a web-based version of our plot. We can apply a theme to change the colors, layouts, and fonts.



Then, we can share the plot in an iframe, as seen below.

The x axis contains the following formula. Plotly renders the LaTeX version of it.

$x^2 frac{d^2 y}{dx^2} + x frac{dy}{dx} + (x^2 – alpha^2)y = 0$

The plot is saved at a URL: https://plot.ly/~MattSundquist/2135. The URL contains the data, plot and code to translate the plot between MATLAB, R, Python, Julia, and JavaScript.

2. Python and matplotlib plotting with LaTeX

We can make matplotlib and Python plots into web-based plots. This is an example using Plotly’s Python API. Here we’re using a Gaussian distribution to study random variables and see where they fall on what is sometimes called a “bell curve.” We can add the standard deviation formula to our plot.

复制代码
复制代码


Here is our plot:

The annotation looks like this in the GUI:



3. R plotting with LaTeX

We can make plots with R. Here’s an example using the Plotly R API.

复制代码



The title was added in the GUI, and is written as ‘$LaTeX$’. We embed with this snippet; every Plotly graph can similarly be embedded in websites, blogs, and notebooks.

<iframe width="500" height="500" frameborder="0" seamless="seamless" scrolling="no" src="https://plot.ly/~MattSundquist/2138.embed?width=500&height=500"></iframe>
4. Mathematica plotting with LaTeX

A user-contributed Mathematica API is in the works, which lets us turn our Mathematica plots into D3, web-based plots. Here is our code:

复制代码


And our plot:

Plotly is free for public projects, entirely online, and you own your data. Learn more on our site.


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群