home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 963089887

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
963089887 MDU6SXNzdWU5NjMwODk4ODc= 5681 Complex LaTeX expressions in `long_name`s aren't rendered correctly when plotting 13205162 closed 0     5 2021-08-06T22:54:11Z 2021-11-28T17:07:18Z 2021-11-28T17:07:18Z CONTRIBUTOR      

What happened:

When I try to give a variable a long_name that's a complex latex expression and then plot that variable the expression doesn't get rendered by latex

What you expected to happen:

I expected the name to get rendered by latex

Minimal Complete Verifiable Example:

In the example below I'm plotting a variable with a complex long_name via xarray and then plotting it again (in a separate figure) using only matplotlib and manually setting xlabel(). The matplotlib-only version works fine (right), but the xarray version doesn't render (left).

```python import numpy as np from matplotlib import pyplot as plt import xarray as xr da = xr.DataArray(range(5), dims="x", coords = dict(x=range(5))) name = r"$Ra_s = \mathrm{mean}(\epsilon_k) / \mu M^2_\infty$" da.x.attrs = dict(long_name = name) da.plot()

plt.figure() plt.plot(range(5)) plt.xlabel(name) ```

Anything else we need to know?:

Environment:

Output of <tt>xr.show_versions()</tt> INSTALLED VERSIONS ------------------ commit: None python: 3.9.2 (default, Mar 3 2021, 20:02:32) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 5.10.53-1-MANJARO machine: x86_64 processor: byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: en_US.UTF-8 libhdf5: 1.10.6 libnetcdf: 4.6.1 xarray: 0.17.0 pandas: 1.2.3 numpy: 1.19.2 scipy: 1.5.3 netCDF4: 1.5.6 pydap: None h5netcdf: None h5py: None Nio: None zarr: None cftime: 1.2.1 nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: 1.3.2 dask: 2021.04.0 distributed: 2021.04.0 matplotlib: 3.3.4 cartopy: 0.18.0 seaborn: None numbagg: None pint: 0.17 setuptools: 52.0.0.post20210125 pip: 21.0.1 conda: None pytest: None IPython: 7.22.0 sphinx: None
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5681/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 1 row from issues_id in issues_labels
  • 5 rows from issue in issue_comments
Powered by Datasette · Queries took 0.515ms · About: xarray-datasette