X Tutup
Skip to content

3d: enable grid linestyle#3938

Closed
laishulu wants to merge 2 commits intomatplotlib:masterfrom
laishulu:feature/enable-grid-linestyle
Closed

3d: enable grid linestyle#3938
laishulu wants to merge 2 commits intomatplotlib:masterfrom
laishulu:feature/enable-grid-linestyle

Conversation

@laishulu
Copy link
Copy Markdown

No description provided.

@WeatherGod
Copy link
Copy Markdown
Member

This fails because the 'linestyle' entry was never made in the info dictionary. Also, I would rather not add things to this dictionary. It was only meant to be a stopgap solution while the axes class was getting normalized with regular axes. It would be nice to implement grid line styles, but not like this. I would rather it be done through the normal getters/setters (whatever they would be).

@laishulu
Copy link
Copy Markdown
Author

Yes, the original grid field does not have the linestyle sub field.

        self._axinfo.update({'label' : {'space_factor': 1.6,
                                        'va': 'center',
                                        'ha': 'center'},
                             'tick' : {'inward_factor': 0.2,
                                       'outward_factor': 0.1},
                             'ticklabel': {'space_factor': 0.7},
                             'axisline': {'linewidth': 0.75,
                                          'color': (0, 0, 0, 1)},
                             'grid' : {'color': (0.9, 0.9, 0.9, 1),
                                       'linewidth': 1.0},
                            })

But the line I insert surely works :-).
To keep consistency, I also add a default linestyle in self._axinfo.update

As far as I know from the comments in the codes, the whole _axinfo is a stopgap solution.
so my suggestion is to accept my PR to enable user customization in a dirty style just like the color/linewidth fields.
And when the whole _axinfo related codes is refactored by the main maintainer, the linestyle field related codes are also refactored together with the existing color/linewidth field

@tacaswell tacaswell added this to the unassigned milestone Dec 23, 2014
@tacaswell
Copy link
Copy Markdown
Member

I think I am with @WeatherGod, user code should not be touching _axinfo as we can change that with zero warning as it is not part of the public API.

@chenhouwu Can you also update the grid method in Axes3D to pass the kwargs through to the Axis objects?

@WeatherGod
Copy link
Copy Markdown
Member

Replaced by #5585

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

X Tutup