Skip to content
New issue

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

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

Already on GitHub? # to your account

Subplots are messed up #155

Open
DavidNemeskey opened this issue Apr 5, 2017 · 1 comment
Open

Subplots are messed up #155

DavidNemeskey opened this issue Apr 5, 2017 · 1 comment

Comments

@DavidNemeskey
Copy link

I tried to convert a plot with 4x2 subplots into tikz, but the output is not very faithful to what I see with plt.show(). I attached both the image generated by matplotlib and the pdf file generated by xelatex. It does nothing but import the figure.

The problems:

  • the x axes are shared (sharex=True in plt.subplots()), yet the tick labels are put on all of them
  • the subplot titles overlap with said tick labels. This is like that in matplotlib too, but there at least I could
    • fig.subplots_adjust(hspace=.5)
    • plt.tight_layout()
      None of these seem to have any effect in the generated pdf, even though the former does change some numbers in the file.
  • the points in the middle of the error bars are huge in tikz, compared to the original plot

This is what it should look like:
plt_show
This is what it looks like:
xelatex.pdf
Without subplots_adjust:
test.tikz.txt
With subplots_adjust:
test_adjust.tikz.txt
The Python file:
plotit.py.txt

@mladenivkovic
Copy link

mladenivkovic commented Jul 13, 2018

For the overlapping axes, a quick workaround is to add vertical sep=2cm [or some other value] to the line beginning with \begin{groupplot}. In your specific case, replace \begin{groupplot}[group style={group size=2 by 4}] with \begin{groupplot}[group style={group size=2 by 4, vertical sep=2cm}].

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants