trelliscopejs icon indicating copy to clipboard operation
trelliscopejs copied to clipboard

When axis limits are "same", only show axes on the margins

Open hafen opened this issue 9 years ago • 6 comments

For the sake of screen real-estate, it would be nice to be able to not repeat axes across panels in a grid when it is not necessary (when all axes are the same). To do this, we would need whatever plotting mechanism to be able to save out the rendered axes separately and then save the panels with axes removed. Then an update in TrelliscopeJS would need to be made to accommodate this.

This should be possible with ggplot2 and rbokeh at a minimum - we should be able to figure out how to extract and store the axes separately and then remove axes from the panels with these packages.

hafen avatar Nov 03 '16 18:11 hafen

@schloerke, how difficult would it be to add an internal function for ggplot2 plots, extract_axes(), that pulls out the red and blue parts of the example plot shown below and saves them out, along with a function, extract_plot_content(), that extracts the green part? extract_axes() would only need to be pulled out once per Trelliscope display, and then we would use extract_plot_content() for each individual panel.

trs_axis

hafen avatar Jan 02 '17 20:01 hafen

I have them written in GGally. I'll make them functions in here as well to avoid depends

schloerke avatar Jan 02 '17 20:01 schloerke

I guess I need plot size (or viewport size) to make the final saves. Otherwise, I can't tell how tall or wide to save the components.

schloerke avatar Jan 02 '17 22:01 schloerke

These will be called from facet_trelliscope() which requires width and height. These are the dimensions at which the plots are saved (the viewer takes care of scaling based on layout). So we can use these dimensions.

hafen avatar Jan 02 '17 22:01 hafen

helper methods added in #20 . They are not integrated, but an example is there.

schloerke avatar Jan 02 '17 22:01 schloerke

I should have this finished up by today

schloerke avatar Jan 04 '17 17:01 schloerke