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

2D Segment and Text Scatterplot types #407

Merged
merged 11 commits into from
Jun 7, 2019
Merged

Conversation

corranwebster
Copy link
Contributor

I got a bit bored on a long weekend.

screen shot 2018-05-07 at 9 15 27 pm

This PR adds a general segment plot, which is a collection of (disconnected) line segments specified by start and end points. Segments can be mapped by width and color as well as position.

screen shot 2018-05-07 at 9 17 38 pm

Also added a plot which draws text at specified x and y locations, similar to the 1d text plot that already exists.

@corranwebster corranwebster changed the title [WIP] 2D Segment and Text Scatterplot types 2D Segment and Text Scatterplot types Jul 20, 2018
@corranwebster corranwebster requested a review from jvkersch July 20, 2018 16:13
Copy link
Contributor

@jvkersch jvkersch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really cool! LGTM -- I've left a few nitpicks, but nothing major.

def _render_orthogonal(self, gc, starts, ends, colors, widths):
""" Render orthogonal lines connecting the start point and end point.

Draw the orthogonal line in the direction determined by
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing sentence part.

def _render_quad(self, gc, starts, ends, colors, widths):
""" Render quadratic Bezier curves connecting the start and end points.

Draw the orthogonal line in the direction determined by
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here too

def _render_cubic(self, gc, starts, ends, colors, widths):
""" Render quadratic Bezier curves connecting the start and end points.

Draw the orthogonal line in the direction determined by
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here :)


def test_segment(self):
self.assertEqual(self.segment_plot.origin, 'bottom left')
self.assertEqual(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be a self.assertIs?

temp_plot.x_grid = None
temp_plot.x_axis = None
temp_plot.y_axis.orientation = 'right'
temp_plot.y_axis.title = u'Temp (°C)'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was looking at this on Wikipedia (https://en.wikipedia.org/wiki/French_invasion_of_Russia#/media/File:Minard.png), and it looks like the temperature may be in degrees Reaumur.

@jvkersch
Copy link
Contributor

jvkersch commented Jun 7, 2019

LGTM (x2) -- can't wait to use this!

@jvkersch jvkersch merged commit 3cf73a0 into master Jun 7, 2019
@jvkersch jvkersch deleted the feature/new-plot-types branch June 7, 2019 21:22
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

Successfully merging this pull request may close these issues.

2 participants