Skip to content

Issue with 3D scatter plot #229

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

Closed
crowoy opened this issue Apr 7, 2018 · 3 comments
Closed

Issue with 3D scatter plot #229

crowoy opened this issue Apr 7, 2018 · 3 comments

Comments

@crowoy
Copy link

crowoy commented Apr 7, 2018

I'm currently using GridSpec to plot several 3D scatter plots, with a shared colorbar on the side. The figure looks like this:

download

The figure runs, displays, and saves to PNG without error. I've attempted to save it with matplotlib2tikz and get the following output:

-----------------------------
AssertionErrorTraceback (most recent call last)
<ipython-input-15-f74e745fd30a> in <module>()
----> 1 plot_3d('rmse_test_close', 'RMSE', 'low')

<ipython-input-14-d24942c6990d> in plot_3d(metric, metric_name, best_dir)
     58 
     59     plt.savefig(dir_results + metric_name + '.png')
---> 60     tikz_save(dir_results + metric_name + '.tex')
     61     plt.show()

/Users/xxx/anaconda/lib/python2.7/site-packages/matplotlib2tikz/save.pyc in save(*args, **kwargs)
    195     '''
    196     encoding = kwargs.pop('encoding', None)
--> 197     code = get_tikz_code(*args, **kwargs)
    198     file_handle = codecs.open(args[0], 'w', encoding)
    199     try:

/Users/xxx/anaconda/lib/python2.7/site-packages/matplotlib2tikz/save.pyc in get_tikz_code(filepath, figure, figurewidth, figureheight, textsize, tex_relative_path_to_data, strict, wrap, axis_environment, extra_axis_parameters, extra_tikzpicture_parameters, dpi, show_info)
    158 
    159     # gather the file content
--> 160     data, content = _recurse(data, figure)
    161 
    162     # Check if there is still an open groupplot environment. This occurs if not

/Users/xxx/anaconda/lib/python2.7/site-packages/matplotlib2tikz/save.pyc in _recurse(data, obj)
    278                 data['extra axis options [base]'].copy()
    279 
--> 280             ax = axes.Axes(data, child)
    281             if not ax.is_colorbar:
    282                 # Run through the child objects, gather the content.

/Users/xxx/anaconda/lib/python2.7/site-packages/matplotlib2tikz/axes.pyc in __init__(self, data, obj)
    148             pass
    149         else:
--> 150             assert yaxis_pos == 'right'
    151             self.axis_options.append('axis y line=right')
    152 

AssertionError: 
@nschloe
Copy link
Owner

nschloe commented Apr 7, 2018

3D plots aren't supported; see #119. This is because of an issue in mpl, see matplotlib/matplotlib#7243.

@nschloe nschloe closed this as completed Apr 7, 2018
@strpeter
Copy link

strpeter commented Oct 2, 2018

Can you please write in the readme or wiki that you don't support 3d plots? It took me a while of debugging to find it out. Thanks! ;)

@nschloe
Copy link
Owner

nschloe commented Oct 2, 2018

@strpeter Will do for the next release.

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

3 participants