Adding additional axis to plot with a bokeh.client

Hi!

After multiplying a line with a constant (several orders of magnitude). I want to add another axis, set the previous line to be invisible and add another line which has the new axis affixed to it.

I try to do this by:

figure_obj.extra_y_ranges =  {"add_y": Range1d(start = np.amin(dataset["y"]),

					        end = np.amax(dataset["y"]))}

figure_obj.add_layout(LogAxis(y_range_name = “add_y”, axis_label = dataset[“y_unit”]), “right”)

line_obj.glyph.line_alpha = 0

new_line_renderer = figure_obj.line("x", "y", source = source_local, line_width = 2,

						line_color = getattr(self, attrname+"_"+dataset["sample_element"]+"color"),

						legend = dataset["sample_element"],

						name = dataset["sample_element"],

						y_range_name = "add_y")

Which runs, but does not add an additional axis.

A note is that the above is run as a callback on an .on_change trigger in a document hosted by a bokeh server.

···

2016-04-22 11:58 GMT+02:00 Robert [email protected]:

Hi!

After multiplying a line with a constant (several orders of magnitude). I want to add another axis, set the previous line to be invisible and add another line which has the new axis affixed to it.

I try to do this by:

figure_obj.extra_y_ranges = {“add_y”: Range1d(start = np.amin(dataset[“y”]),

  				        end = np.amax(dataset["y"]))}

figure_obj.add_layout(LogAxis(y_range_name = “add_y”, axis_label = dataset[“y_unit”]), “right”)

line_obj.glyph.line_alpha = 0

new_line_renderer = figure_obj.line(“x”, “y”, source = source_local, line_width = 2,

  					line_color = getattr(self, attrname+"_"+dataset["sample_element"]+"color"),
  					legend = dataset["sample_element"],
  					name = dataset["sample_element"],
  					y_range_name = "add_y")

Which runs, but does not add an additional axis.

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

To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/f0fUiWtyW5I/unsubscribe.

To unsubscribe from this group and all its topics, 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/9c868041-7b06-4aee-b661-b77424269db6%40continuum.io.

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

Robert,

Nothing with that code looks amiss, offhand. It's possible there is some event plumbing that is not hooked up properly such that new axes don't get rendered as expected. Certainly we'd like to fix that if that is the case (or whatever the root issue is). If you can provide a minimal complete example that reproduces this behavior and put it in a GH issue, that will go a tremendous way towards helping anyone who looks into the issue.

Thanks,

Bryan

···

On Apr 22, 2016, at 5:37 AM, Robert Solli <[email protected]> wrote:

A note is that the above is run as a callback on an .on_change trigger in a document hosted by a bokeh server.

2016-04-22 11:58 GMT+02:00 Robert <[email protected]>:
Hi!

After multiplying a line with a constant (several orders of magnitude). I want to add another axis, set the previous line to be invisible and add another line which has the new axis affixed to it.
I try to do this by:

  figure_obj.extra_y_ranges = {"add_y": Range1d(start = np.amin(dataset["y"]),
                    end = np.amax(dataset["y"]))}
        figure_obj.add_layout(LogAxis(y_range_name = "add_y", axis_label = dataset["y_unit"]), "right")

  line_obj.glyph.line_alpha = 0

  new_line_renderer = figure_obj.line("x", "y", source = source_local, line_width = 2,
              line_color = getattr(self, attrname+"_"+dataset["sample_element"]+"color"),
              legend = dataset["sample_element"],
              name = dataset["sample_element"],
              y_range_name = "add_y")

Which runs, but does not add an additional axis.

--
You received this message because you are subscribed to a topic in the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/f0fUiWtyW5I/unsubscribe.
To unsubscribe from this group and all its topics, 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/9c868041-7b06-4aee-b661-b77424269db6%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/CA%2BAkX3_-QxJE8bZTYr_jXdiP98Eou2U-am7e3-nMeoDedHAdUg%40mail.gmail.com.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

I’m working on writing a bit of code that replicates the problem. Meanwhile I see that the server outputs this message:

2016-04-23 17:30:53,642 JSON had attr ‘y_range_name’ on obj <bokeh.models.glyphs.Line object at 0x7f715ea13c88>, which is a client-only or invalid attribute that shouldn’t have been sent

Could that have anything to do with my problem?

Cheers,

Robert

···

2016-04-22 16:56 GMT+02:00 Bryan Van de Ven [email protected]:

Robert,

Nothing with that code looks amiss, offhand. It’s possible there is some event plumbing that is not hooked up properly such that new axes don’t get rendered as expected. Certainly we’d like to fix that if that is the case (or whatever the root issue is). If you can provide a minimal complete example that reproduces this behavior and put it in a GH issue, that will go a tremendous way towards helping anyone who looks into the issue.

Thanks,

Bryan

On Apr 22, 2016, at 5:37 AM, Robert Solli [email protected] wrote:

A note is that the above is run as a callback on an .on_change trigger in a document hosted by a bokeh server.

2016-04-22 11:58 GMT+02:00 Robert [email protected]:

Hi!

After multiplying a line with a constant (several orders of magnitude). I want to add another axis, set the previous line to be invisible and add another line which has the new axis affixed to it.

I try to do this by:

  figure_obj.extra_y_ranges =  {"add_y": Range1d(start = np.amin(dataset["y"]),
                                                  end = np.amax(dataset["y"]))}
    figure_obj.add_layout(LogAxis(y_range_name = "add_y", axis_label = dataset["y_unit"]), "right")
  line_obj.glyph.line_alpha = 0
  new_line_renderer = figure_obj.line("x", "y", source = source_local, line_width = 2,
                                                  line_color = getattr(self, attrname+"_"+dataset["sample_element"]+"color"),
                                                  legend = dataset["sample_element"],
                                                  name = dataset["sample_element"],
                                                  y_range_name = "add_y")

Which runs, but does not add an additional axis.

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

To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/f0fUiWtyW5I/unsubscribe.

To unsubscribe from this group and all its topics, 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/9c868041-7b06-4aee-b661-b77424269db6%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/CA%2BAkX3_-QxJE8bZTYr_jXdiP98Eou2U-am7e3-nMeoDedHAdUg%40mail.gmail.com.

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

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

To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/f0fUiWtyW5I/unsubscribe.

To unsubscribe from this group and all its topics, 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/86FF21D5-5DF9-4904-AAB7-DD7679386C75%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

My guess would be that that is not the problem.

Sarah Bird
[email protected]

···

2016-04-22 16:56 GMT+02:00 Bryan Van de Ven [email protected]:

Robert,

Nothing with that code looks amiss, offhand. It’s possible there is some event plumbing that is not hooked up properly such that new axes don’t get rendered as expected. Certainly we’d like to fix that if that is the case (or whatever the root issue is). If you can provide a minimal complete example that reproduces this behavior and put it in a GH issue, that will go a tremendous way towards helping anyone who looks into the issue.

Thanks,

Bryan

On Apr 22, 2016, at 5:37 AM, Robert Solli [email protected] wrote:

A note is that the above is run as a callback on an .on_change trigger in a document hosted by a bokeh server.

2016-04-22 11:58 GMT+02:00 Robert [email protected]:

Hi!

After multiplying a line with a constant (several orders of magnitude). I want to add another axis, set the previous line to be invisible and add another line which has the new axis affixed to it.

I try to do this by:

  figure_obj.extra_y_ranges =  {"add_y": Range1d(start = np.amin(dataset["y"]),
                                                  end = np.amax(dataset["y"]))}
    figure_obj.add_layout(LogAxis(y_range_name = "add_y", axis_label = dataset["y_unit"]), "right")
  line_obj.glyph.line_alpha = 0
  new_line_renderer = figure_obj.line("x", "y", source = source_local, line_width = 2,
                                                  line_color = getattr(self, attrname+"_"+dataset["sample_element"]+"color"),
                                                  legend = dataset["sample_element"],
                                                  name = dataset["sample_element"],
                                                  y_range_name = "add_y")

Which runs, but does not add an additional axis.

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

To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/f0fUiWtyW5I/unsubscribe.

To unsubscribe from this group and all its topics, 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/9c868041-7b06-4aee-b661-b77424269db6%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/CA%2BAkX3_-QxJE8bZTYr_jXdiP98Eou2U-am7e3-nMeoDedHAdUg%40mail.gmail.com.

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

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

To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/f0fUiWtyW5I/unsubscribe.

To unsubscribe from this group and all its topics, 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/86FF21D5-5DF9-4904-AAB7-DD7679386C75%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

http://pastebin.com/RRN8mgay

This script has a couple of problems, when run on 0.12.0dev8 it does not update the plot at all, meanwhile the server outputs:

JSON had attr ‘level’ on obj <bokeh.models.glyphs.Line object at 0x7f39276792e8>, which is a client-only or invalid attribute that shouldn’t have been sent

On version 0.11.1 the figure dissapears after inputing a float in the text-window and triggering the .on_change.

Cheers,

Robert

···

2016-04-27 5:51 GMT+02:00 Sarah Bird [email protected]:

My guess would be that that is not the problem.

Sarah Bird
[email protected]

On Apr 23, 2016, at 8:33 AM, Robert Solli [email protected] wrote:

I’m working on writing a bit of code that replicates the problem. Meanwhile I see that the server outputs this message:

2016-04-23 17:30:53,642 JSON had attr ‘y_range_name’ on obj <bokeh.models.glyphs.Line object at 0x7f715ea13c88>, which is a client-only or invalid attribute that shouldn’t have been sent

Could that have anything to do with my problem?

Cheers,

Robert

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/CA%2BAkX3_rG1sdCCKjTUw8yrR4O%2BxgW-Z%3Dd7BVW14utKJ_uvt7XA%40mail.gmail.com.

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

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

To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/f0fUiWtyW5I/unsubscribe.

To unsubscribe from this group and all its topics, 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/FE1B1C6C-E82F-4AB3-A1FF-442F28067D76%40continuum.io.

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

2016-04-22 16:56 GMT+02:00 Bryan Van de Ven [email protected]:

Robert,

Nothing with that code looks amiss, offhand. It’s possible there is some event plumbing that is not hooked up properly such that new axes don’t get rendered as expected. Certainly we’d like to fix that if that is the case (or whatever the root issue is). If you can provide a minimal complete example that reproduces this behavior and put it in a GH issue, that will go a tremendous way towards helping anyone who looks into the issue.

Thanks,

Bryan

On Apr 22, 2016, at 5:37 AM, Robert Solli [email protected] wrote:

A note is that the above is run as a callback on an .on_change trigger in a document hosted by a bokeh server.

2016-04-22 11:58 GMT+02:00 Robert [email protected]:

Hi!

After multiplying a line with a constant (several orders of magnitude). I want to add another axis, set the previous line to be invisible and add another line which has the new axis affixed to it.

I try to do this by:

  figure_obj.extra_y_ranges =  {"add_y": Range1d(start = np.amin(dataset["y"]),
                                                  end = np.amax(dataset["y"]))}
    figure_obj.add_layout(LogAxis(y_range_name = "add_y", axis_label = dataset["y_unit"]), "right")
  line_obj.glyph.line_alpha = 0
  new_line_renderer = figure_obj.line("x", "y", source = source_local, line_width = 2,
                                                  line_color = getattr(self, attrname+"_"+dataset["sample_element"]+"color"),
                                                  legend = dataset["sample_element"],
                                                  name = dataset["sample_element"],
                                                  y_range_name = "add_y")

Which runs, but does not add an additional axis.

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

To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/f0fUiWtyW5I/unsubscribe.

To unsubscribe from this group and all its topics, 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/9c868041-7b06-4aee-b661-b77424269db6%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/CA%2BAkX3_-QxJE8bZTYr_jXdiP98Eou2U-am7e3-nMeoDedHAdUg%40mail.gmail.com.

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

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

To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/f0fUiWtyW5I/unsubscribe.

To unsubscribe from this group and all its topics, 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/86FF21D5-5DF9-4904-AAB7-DD7679386C75%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.