Use theme font also for LaTeX
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- matplotlib, python
- Área
- data-visualization
Línea de trabajo
Comienza con el ejemplo reproducible de plotnine e inspecciona cómo se aplican las fuentes de texto del theme junto con la configuración de LaTeX y mathtext de matplotlib. Rastrea el manejo de las fuentes del theme y determina la configuración relevante de matplotlib; el trabajo estará terminado cuando las labels renderizadas en LaTeX utilicen la font family especificada por el theme sin requerir rcParams globales separados.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Apparently, matplotlib uses different rcParams for controlling the font used in LaTeX environments vs outside (see https://stackoverflow.com/a/27697390). This causes behaviour which is IMO inconsistent, where the font family specified in the theme is not used within LaTeX environments.
Reproducible example to show what I mean:
from plotnine import ggplot, geom_point, aes, theme, labs, element_text
from plotnine.data import penguins
(ggplot(penguins, aes(x="bill_length_mm", y="bill_depth_mm"))
+ labs(x="l_bill", y=r"$d_\text{bill}$")
+ theme(text = element_text(family="Noto Serif"), figure_size=(3,2))
+ geom_point()
)
yields this:
where the LaTeX in the y axis label does not use the serif font which I specified in the theme
Prepending this:
import matplotlib
matplotlib.rcParams['mathtext.fontset'] = 'custom'
matplotlib.rcParams['mathtext.rm'] = 'Noto Serif'
matplotlib.rcParams['mathtext.it'] = 'Noto Serif:italic'
achieves the desired result in this case, but of course, the theme information is no longer stored in the theme.
Is it possible to change the behaviour such that the LaTeX font follows the theme font?
- Lenguaje dominante
- Python
- Estrellas
- 4.8k
- Forks
- 260
- Merge medio
- 2 d 12 h
- PR fusionados (30 d)
- 4
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de has2k1/plotnine
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
-
Enhancement
Dificultad 3/5 Medio día Aptitud para principiantes 55/100
has2k1/plotnine#1141 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
has2k1/plotnine#1081 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Discussion
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
has2k1/plotnine#1047 · 15 comentarios · 3 reacciones ·
Los mantenedores suelen responder en 1 día
-
Documentation Plot Composition Question
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
has2k1/plotnine#1036 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de has2k1/plotnine
Issues similares
-
`destroy` sans terminal répond « Aborted. » au lieu de réclamer `--yes` comme `clean` et `reset`Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
stephrobert/dsoxlab#354 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
jasonacox/pypowerwall#472 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: DoubleMLRDDData accepts a score_col that is no data column (as in its docstring example); the running variable then becomes a covariate and RDFlex failsPosiblemente ocupada @vrjdev la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
DoubleML/doubleml-for-py#455 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: Python mod.Box[T] annotation gets a false generic_arg edge that replaces the parameter_type one ('is' on tree-sitter nodes)Posiblemente ocupada @rohit-jsfreaky la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Graphify-Labs/graphify#5110 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
assafelovic/gpt-researcher#2277 ·
Los mantenedores suelen responder en 10 días