Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xtick for pgfplots #342

Open
OliverFaust opened this issue Nov 19, 2021 · 0 comments
Open

xtick for pgfplots #342

OliverFaust opened this issue Nov 19, 2021 · 0 comments

Comments

@OliverFaust
Copy link

Dear experts,

Including 'xtick={-1, 0, 1}' in the plot options for Axis creates xtick={{-}1, 0, 1} in the latex code.
How do I generate the correct latex code: xtick={-1, 0, 1}?

Minimum example to reproduce the error:

from pylatex import Document, Axis, Plot, TikZ
import os
if __name__ == '__main__':
    image_filename = os.path.join(os.path.dirname(__file__), 'kitten.jpg')
    geometry_options = {"tmargin": "1cm", "lmargin": "10cm"}
    doc = Document(geometry_options=geometry_options)
    plot_options = 'height=4cm, width=6cm, grid=major, xtick={-1, 0, 1}'
    with doc.create(TikZ()):
        with doc.create(Axis(options=plot_options)) as plot:
            plot.append(Plot(name='model', func='-x^5 - 242'))
    
            coordinates = [
                (-4.77778, 2027.60977),
                (-3.55556, 347.84069),
                (-2.33333, 22.58953),
                (-1.11111, -493.50066),
                (0.11111, 46.66082),
                (1.33333, -205.56286),
                (2.55556, -341.40638),
                (3.77778, -1169.24780),
                (5.00000, -3269.56775),
            ]
        plot.append(Plot(name='estimate', coordinates=coordinates))
    doc.generate_pdf('full', clean_tex=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant