Skip to content

Commit e99e6dc

Browse files
committed
Set usetex=False by default
1 parent 16f0f9f commit e99e6dc

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/maxplotlib/backends/matplotlib/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
from mpl_toolkits.mplot3d.art3d import Line3DCollection, Poly3DCollection
1616

1717

18-
def setup_tex_fonts(fontsize=14):
18+
def setup_tex_fonts(fontsize=14, usetex=False):
1919
"""
2020
Sets up LaTeX fonts for plotting.
2121
"""
2222
tex_fonts = {
23-
"text.usetex": True,
23+
"text.usetex": usetex,
2424
"font.family": "serif",
2525
"pgf.rcfonts": False,
2626
"axes.labelsize": fontsize,

src/maxplotlib/canvas/canvas.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def plot(self, backend="matplotlib", show=True, savefig=False, layers=None):
158158
elif backend == "plotly":
159159
self.plot_plotly(show=show, savefig=savefig)
160160

161-
def plot_matplotlib(self, show=True, savefig=False, layers=None):
161+
def plot_matplotlib(self, show=True, savefig=False, layers=None, usetex=False):
162162
"""
163163
Generate and optionally display the subplots.
164164
@@ -167,7 +167,7 @@ def plot_matplotlib(self, show=True, savefig=False, layers=None):
167167
show (bool): Whether to display the plot.
168168
"""
169169

170-
tex_fonts = plt_utils.setup_tex_fonts(fontsize=self.fontsize)
170+
tex_fonts = plt_utils.setup_tex_fonts(fontsize=self.fontsize, usetex=usetex)
171171

172172
plt_utils.setup_plotstyle(
173173
tex_fonts=tex_fonts,
@@ -210,7 +210,7 @@ def plot_matplotlib(self, show=True, savefig=False, layers=None):
210210
# plt.close()
211211
return fig, axes
212212

213-
def plot_plotly(self, show=True, savefig=None):
213+
def plot_plotly(self, show=True, savefig=None, usetex=False):
214214
"""
215215
Generate and optionally display the subplots using Plotly.
216216
@@ -220,7 +220,8 @@ def plot_plotly(self, show=True, savefig=None):
220220
"""
221221

222222
tex_fonts = plt_utils.setup_tex_fonts(
223-
fontsize=self.fontsize
223+
fontsize=self.fontsize,
224+
usetex=usetex,
224225
) # adjust or redefine for Plotly if needed
225226

226227
# Set default width and height if not specified

0 commit comments

Comments
 (0)