Skip to content

2D Segment and Text Scatterplot types#407

Merged
jvkersch merged 11 commits into
masterfrom
feature/new-plot-types
Jun 7, 2019
Merged

2D Segment and Text Scatterplot types#407
jvkersch merged 11 commits into
masterfrom
feature/new-plot-types

Conversation

@corranwebster
Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread chaco/plot.py
Comment thread chaco/plot.py
Comment thread chaco/segment_plot.py
Comment thread chaco/segment_plot.py
Comment thread chaco/segment_plot.py Outdated
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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Missing sentence part.

Comment thread chaco/segment_plot.py Outdated
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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

here too

Comment thread chaco/segment_plot.py Outdated
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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

and here :)

Comment thread chaco/tests/segment_plot_test_case.py Outdated

def test_segment(self):
self.assertEqual(self.segment_plot.origin, 'bottom left')
self.assertEqual(
Copy link
Copy Markdown
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?

Comment thread examples/demo/basic/minard_napoleon.py Outdated
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
Copy Markdown
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
Copy Markdown
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