grids in bokehjs

Hello, i managed to actually customize the axis labels but alas the grid is gone now, and i do not know how to reenable the grid.

This is my code:

plot = Bokeh.Plotting.make_plot([{type:‘line’},{type:‘line’}], [{x:[1,2],y:[4,5]},{x:[1,4],y:[2,5]}], {xaxes:false,yaxes:false})

below = plot.get(‘below’);

console.log(below)

Collections = Bokeh.Collections;

xaxis = Collections(‘LinearAxis’).create({

axis_label: ‘custom x label’,

xgrid:true,

plot: plot

});

below = plot.get(‘below’);

console.log(‘below:’)

console.log(below)

console.log(’/below’)

below.push(xaxis);

plot.set(‘below’, below);

yaxis = Collections(‘LinearAxis’).create({

axis_label: ‘custom y label’,

plot: plot,

majorgrid: true

});

left = plot.get(‘left’);

left.push(yaxis);

plot.set(‘left’, left);

plot.add_renderers([xaxis, yaxis]);

Bokeh.Plotting.show(

plot

,’.mydivcontainer’);

How do i add a grid to that plot?

What version of BokehJS are you using?

Note that the javascript Bokeh.plotting.make_plot interface was never intended to be a long term supported interface, and is probably broken in Bokeh 0.7, about to come out. We would very much like to have a better, supported, documented JS interface for Bokeh, but it is a matter of time and resources (or getting new contributors interested in helping).

Bryan

···

On Dec 5, 2014, at 5:21 PM, [email protected] wrote:

Hello, i managed to actually customize the axis labels but alas the grid is gone now, and i do not know how to reenable the grid.

This is my code:

plot = Bokeh.Plotting.make_plot([{type:'line'},{type:'line'}], [{x:[1,2],y:[4,5]},{x:[1,4],y:[2,5]}], {xaxes:false,yaxes:false})
below = plot.get('below');
console.log(below)

Collections = Bokeh.Collections;
xaxis = Collections('LinearAxis').create({
    axis_label: 'custom x label',
    xgrid:true,
    plot: plot
  });
  below = plot.get('below');
console.log('below:')
  console.log(below)
  console.log('/below')
  below.push(xaxis);
  plot.set('below', below);
  yaxis = Collections('LinearAxis').create({
    axis_label: 'custom y label',
    plot: plot,
      majorgrid: true
  });
  left = plot.get('left');
  left.push(yaxis);
  plot.set('left', left);
  plot.add_renderers([xaxis, yaxis]);

Bokeh.Plotting.show(
plot
      ,'.mydivcontainer');

How do i add a grid to that plot?

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/aff74d16-1102-4901-be4d-49fcf49dd543%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Hi Bryan
Aha i understand. I am actually using 0.6, i have a fiddle here: Edit fiddle - JSFiddle - Code Playground

I would very much like to contribute, and most likely in time i will - but right now im completely stretched at work :confused:

I agree that a better, supported and documented JS interface for Bokeh would be absolutely amazing. I think for making production code, people will tend to use the JS interface rather than any of the backend interfaces because of the much better integration possibilites there is in the js interface. How are the priorities regarding what features to be put into bokeh in the near future?

Is there any chance that this js snippet i produced can have a grid as well, such that i can use this plot for now and change it later once there is a better bokehjs interface?

Best regards

···

On Saturday, December 6, 2014 1:45:26 AM UTC+1, Bryan Van de ven wrote:

What version of BokehJS are you using?

Note that the javascript Bokeh.plotting.make_plot interface was never intended to be a long term supported interface, and is probably broken in Bokeh 0.7, about to come out. We would very much like to have a better, supported, documented JS interface for Bokeh, but it is a matter of time and resources (or getting new contributors interested in helping).

Bryan

On Dec 5, 2014, at 5:21 PM, [email protected] wrote:

Hello, i managed to actually customize the axis labels but alas the grid is gone now, and i do not know how to reenable the grid.

This is my code:

plot = Bokeh.Plotting.make_plot([{type:‘line’},{type:‘line’}], [{x:[1,2],y:[4,5]},{x:[1,4],y:[2,5]}], {xaxes:false,yaxes:false})

below = plot.get(‘below’);

console.log(below)

Collections = Bokeh.Collections;

xaxis = Collections(‘LinearAxis’).create({

axis_label: 'custom x label',
xgrid:true,
plot: plot

});

below = plot.get(‘below’);

console.log(‘below:’)

console.log(below)

console.log(‘/below’)

below.push(xaxis);

plot.set(‘below’, below);

yaxis = Collections(‘LinearAxis’).create({

axis_label: 'custom y label',
plot: plot,
  majorgrid: true

});

left = plot.get(‘left’);

left.push(yaxis);

plot.set(‘left’, left);

plot.add_renderers([xaxis, yaxis]);

Bokeh.Plotting.show(

plot

  ,'.mydivcontainer');

How do i add a grid to that plot?


You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/aff74d16-1102-4901-be4d-49fcf49dd543%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hi Hille,

One thing I should mention first that I forgot to mention before. It's possible to use the non-JS language bindings to create the JSON for the plot, and then throw the original non-JS code away. If you have set plots that you just need to update the data or visual attributes of, this might be a possible immediate solution until there is a better JS interface. You can see an example similar to this here:

  https://github.com/bokeh/bokeh/tree/master/examples/embed/spectrogram

In this a Flask server is running the python code to generate the JSON every time, then a small JS program takes over to update the plot data directly in JS, from AJAX calls. But, you could just as easily run the python code once, and save the JSON output to use directly in a JS web app. If this sounds like it might be useful to you, let me know I am happy to provide any additional information I can.

Regarding Bokeh roadmap, contributions, etc. First, if you do ever have the time to contribute, it will be very welcome! Right now it is still true that the major contributors are affiliated with Continuum in one way or another. There have been lots of small outside contributions, and a handful of more sizable ones. There's also some folks working on other language bindings (Scala, R, Julia) at their own paces. I would very much like to have more contributors, making feature pushes in independent directions. Obviously for Continuum contributors, priorities are always informed to some measure by 1) products we intend to build on top of our open-source efforts, and 2) requirements driven by customer engagements. My hope is that soon some outside folks will become motivated enough to scratch whatever itches they have regarding Bokeh features that we aren't able to get to fast enough!

Lastly, I wanted to say that I was not especially happy that we did not have the time/resources to fix Bokeh.plotting back up for 0.7 after the "glyphspec refactor". However, I do intend to have some part of a JS interface ready for 0.7.1 in early 2015.

Thanks,

Bryan

···

On Dec 6, 2014, at 12:05 AM, [email protected] wrote:

Hi Bryan
Aha i understand. I am actually using 0.6, i have a fiddle here: Edit fiddle - JSFiddle - Code Playground
I would very much like to contribute, and most likely in time i will - but right now im completely stretched at work :confused:
I agree that a better, supported and documented JS interface for Bokeh would be absolutely amazing. I think for making production code, people will tend to use the JS interface rather than any of the backend interfaces because of the much better integration possibilites there is in the js interface. How are the priorities regarding what features to be put into bokeh in the near future?

Is there any chance that this js snippet i produced can have a grid as well, such that i can use this plot for now and change it later once there is a better bokehjs interface?

Best regards

On Saturday, December 6, 2014 1:45:26 AM UTC+1, Bryan Van de ven wrote:
What version of BokehJS are you using?

Note that the javascript Bokeh.plotting.make_plot interface was never intended to be a long term supported interface, and is probably broken in Bokeh 0.7, about to come out. We would very much like to have a better, supported, documented JS interface for Bokeh, but it is a matter of time and resources (or getting new contributors interested in helping).

Bryan

> On Dec 5, 2014, at 5:21 PM, hilleb...@gmail.com wrote:
>
> Hello, i managed to actually customize the axis labels but alas the grid is gone now, and i do not know how to reenable the grid.
>
> This is my code:
>
>
> plot = Bokeh.Plotting.make_plot([{type:'line'},{type:'line'}], [{x:[1,2],y:[4,5]},{x:[1,4],y:[2,5]}], {xaxes:false,yaxes:false})
> below = plot.get('below');
> console.log(below)
>
> Collections = Bokeh.Collections;
> xaxis = Collections('LinearAxis').create({
> axis_label: 'custom x label',
> xgrid:true,
> plot: plot
> });
> below = plot.get('below');
> console.log('below:')
> console.log(below)
> console.log('/below')
> below.push(xaxis);
> plot.set('below', below);
> yaxis = Collections('LinearAxis').create({
> axis_label: 'custom y label',
> plot: plot,
> majorgrid: true
> });
> left = plot.get('left');
> left.push(yaxis);
> plot.set('left', left);
> plot.add_renderers([xaxis, yaxis]);
>
> Bokeh.Plotting.show(
> plot
> ,'.mydivcontainer');
>
>
>
> How do i add a grid to that plot?
>
> --
> You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+un...@continuum.io.
> To post to this group, send email to bo...@continuum.io.
> To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/aff74d16-1102-4901-be4d-49fcf49dd543%40continuum.io\.
> For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/d542806f-70e8-4dd7-a1d5-ff44ab857980%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.