Re: [R] plotly

2023-07-26 Thread Kimmo Elo
Hi,

ke, 2023-07-26 kello 02:04 +, Thomas Subia via R-help kirjoitti:
> Question 1:How can I save the plotly graph with a specific graph
> size?Using ggsave, one can define the height, width and unit of
> measure, is there something similar in plotly?Since I am creating the
> same gauge plot but with different data, I'd like all the resulting
> graphs to have the same size. I've googled this but to no avail,

Maybe this: plotly_IMAGE

See ?plotly_IMAGE for details, especially 'height' and 'width' should
be of interest for you.

> Question 2:How can I adjust the tick marks of the gauge? Ideally the
> tick marks should be set at seq(0,9600,1200)

Try this (notice 'tickvals' in gauge/axis:

--- snip ---

plot_ly(
domain = list(x = c(0, .5), y = c(0,0.5)),
value = 319,
title = list(text = "Example\n4,800 Target",font=t),
type = "indicator",
mode = "gauge+number+delta",
number = list(valueformat = "%.2f",font=t5), 
delta = list(reference = 4800, valueformat = "%.2f",font=t3),
gauge = list(
axis = list(range = list(NULL, 9600), 
tickformat = "%d",
tickvals = seq(0,9600,1200),
tickfont = list(size = 12, face="bold",family =
"Arial")),
bar = list(color = "black"),
steps = list(
list(range = seq(0, 4800,1200), color = 'AAFF00'),
list(range = seq(4800, 9600,1200), color = 'ffb2b2')),
threshold = list(
line = list(color = "black", width = 8),
thickness = 0.75,
value = 4800)))

--- snip ---

HTH,

Kimmo

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] plotly

2023-07-25 Thread Thomas Subia via R-help
 Colleagues,
Here is my reproducible code.
library(plotly)

t <- list(
  family = "Arial",
  size = 12,
  color = "black",
  face="bold")


t3 <- list(
  family = "Arial",
  size = 12,
  color = "black",
  face="bold")

t5 <- list(
  family = "Arial",
  size = 12,
  color = "black",
  face="bold")

plot_ly(
  domain = list(x = c(0, .5), y = c(0,0.5)),
  value = 319,
  title = list(text = "Example\n4,800 Target",font=t),
  type = "indicator",
  mode = "gauge+number+delta",
  number = list(valueformat = "%.2f",font=t5), 
  delta = list(reference = 4800, valueformat = "%.2f",font=t3),
  gauge = list(
    axis = list(range = list(NULL, 9600), 
    tickfont = list(size = 12, face="bold",family = "Arial")),
    bar = list(color = "black"),
    steps = list(
  list(range = c(0, 4800), color = 'AAFF00'),
  list(range = c(4800, 9600), color = 'ffb2b2')),
    threshold = list(
  line = list(color = "black", width = 8),
  thickness = 0.75,
  value = 4800)))
Question 1:How can I save the plotly graph with a specific graph size?Using 
ggsave, one can define the height, width and unit of measure, is there 
something similar in plotly?Since I am creating the same gauge plot but with 
different data, I'd like all the resulting graphs to have the same size. I've 
googled this but to no avail,
Question 2:How can I adjust the tick marks of the gauge? Ideally the tick marks 
should be set at seq(0,9600,1200)
Thanks everyone!
Thomas Subia

On Saturday, July 22, 2023 at 08:10:52 AM PDT, Boris Steipe 
 wrote:  
 
 ChatGPT-4:

-- Query:  --

Thank you. The `value` in the code example is 2874. The plot shows a large 
number at the center and a smaller value computed as a delta relative to the 
`reference` of 4800. But the large value is given as 2870, and the smaller 
value is given as -1930 i.e. both values are rounded. Can I control the 
precision of these two numbers?


-- Response:  ---

In Plotly, you can control the precision of the numbers by specifying the 
`valueformat` and `delta.valueformat` parameters. These parameters accept a 
string in the format that is used by the C `printf` function. For example, 
`%.2f` specifies a number with two digits after the decimal point. Here is an 
example:

```R
plotly::plot_ly(
  domain = list(x = c(0, 1), y = c(0, 1)),
  value = 2874,
  title = list(text = "Generic"),
  type = "indicator",
  mode = "gauge+number+delta",
  number = list(valueformat = "%.2f"), 
  delta = list(reference = 4800, valueformat = "%.2f"),
  gauge = list(
    axis = list(range = list(NULL, 5000), 
                tickfont = list(size = 20, family = "Arial")),
    bar = list(color = "blue"),
    steps = list(
      list(range = c(0, 4800), color = "white"),
      list(range = c(4800, 6000), color = "red")),
    threshold = list(
      line = list(color = "black", width = 6),
      thickness = 0.75,
      value = 4800)))
```
In this example, both the main number and the delta value will be displayed 
with two decimal places. You can adjust these strings to display the numbers 
with the precision you prefer.

-

Here you go. I have no idea how it does this, and have a discussion on elements 
of "Sein und Zeit" and book 19 of the Odyssey, and tutor me in Italian 
conversation, and draft Mermaid mind-maps - but here we are.


:-)






> 
> \In this example, the value was 2324, the gauge displays 2320.
> I'm not sure why this occurs. Changing the statement to 56, results in the 
> gauge reading 60. I'm not sure what needs to be changed in the script or the 
> environment to stop rounding.




> On Jul 22, 2023, at 10:43, Boris Steipe  wrote:
> 
> What do you mean "Rounded"?
> What do you expect, what do you get instead?
> 
> ?
> 
> 
> 
> 
> 
>> On Jul 22, 2023, at 10:40, Thomas Subia via R-help  
>> wrote:
>> 
>> Colleagues,
>> Thanks for the update.
>> My colleagues at work have run this script but the resulting graph output 
>> for value is rounded. How can one turn this annoying feature off?
>> I've googled this but to no avail.
>> 
>> 
>> 
>> 
>> [[alternative HTML version deleted]]
>> 
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

  
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and 

Re: [R] plotly

2023-07-22 Thread Thomas Subia via R-help
 Many thanks for this! This is an elegant solution!
After looking at my script, I still do not understand is how the rounding 
occurs. After reading the plotly documentation, unless I am missing something, 
this wasn't covered.


On Saturday, July 22, 2023 at 08:10:52 AM PDT, Boris Steipe 
 wrote:  
 
 ChatGPT-4:

-- Query:  --

Thank you. The `value` in the code example is 2874. The plot shows a large 
number at the center and a smaller value computed as a delta relative to the 
`reference` of 4800. But the large value is given as 2870, and the smaller 
value is given as -1930 i.e. both values are rounded. Can I control the 
precision of these two numbers?


-- Response:  ---

In Plotly, you can control the precision of the numbers by specifying the 
`valueformat` and `delta.valueformat` parameters. These parameters accept a 
string in the format that is used by the C `printf` function. For example, 
`%.2f` specifies a number with two digits after the decimal point. Here is an 
example:

```R
plotly::plot_ly(
  domain = list(x = c(0, 1), y = c(0, 1)),
  value = 2874,
  title = list(text = "Generic"),
  type = "indicator",
  mode = "gauge+number+delta",
  number = list(valueformat = "%.2f"), 
  delta = list(reference = 4800, valueformat = "%.2f"),
  gauge = list(
    axis = list(range = list(NULL, 5000), 
                tickfont = list(size = 20, family = "Arial")),
    bar = list(color = "blue"),
    steps = list(
      list(range = c(0, 4800), color = "white"),
      list(range = c(4800, 6000), color = "red")),
    threshold = list(
      line = list(color = "black", width = 6),
      thickness = 0.75,
      value = 4800)))
```
In this example, both the main number and the delta value will be displayed 
with two decimal places. You can adjust these strings to display the numbers 
with the precision you prefer.

-

Here you go. I have no idea how it does this, and have a discussion on elements 
of "Sein und Zeit" and book 19 of the Odyssey, and tutor me in Italian 
conversation, and draft Mermaid mind-maps - but here we are.


:-)






> 
> \In this example, the value was 2324, the gauge displays 2320.
> I'm not sure why this occurs. Changing the statement to 56, results in the 
> gauge reading 60. I'm not sure what needs to be changed in the script or the 
> environment to stop rounding.




> On Jul 22, 2023, at 10:43, Boris Steipe  wrote:
> 
> What do you mean "Rounded"?
> What do you expect, what do you get instead?
> 
> ?
> 
> 
> 
> 
> 
>> On Jul 22, 2023, at 10:40, Thomas Subia via R-help  
>> wrote:
>> 
>> Colleagues,
>> Thanks for the update.
>> My colleagues at work have run this script but the resulting graph output 
>> for value is rounded. How can one turn this annoying feature off?
>> I've googled this but to no avail.
>> 
>> 
>> 
>> 
>> [[alternative HTML version deleted]]
>> 
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

  
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] plotly

2023-07-22 Thread Boris Steipe
ChatGPT-4:

-- Query:  --

Thank you. The `value` in the code example is 2874. The plot shows a large 
number at the center and a smaller value computed as a delta relative to the 
`reference` of 4800. But the large value is given as 2870, and the smaller 
value is given as -1930 i.e. both values are rounded. Can I control the 
precision of these two numbers?


-- Response:  ---

In Plotly, you can control the precision of the numbers by specifying the 
`valueformat` and `delta.valueformat` parameters. These parameters accept a 
string in the format that is used by the C `printf` function. For example, 
`%.2f` specifies a number with two digits after the decimal point. Here is an 
example:

```R
plotly::plot_ly(
  domain = list(x = c(0, 1), y = c(0, 1)),
  value = 2874,
  title = list(text = "Generic"),
  type = "indicator",
  mode = "gauge+number+delta",
  number = list(valueformat = "%.2f"), 
  delta = list(reference = 4800, valueformat = "%.2f"),
  gauge = list(
axis = list(range = list(NULL, 5000), 
tickfont = list(size = 20, family = "Arial")),
bar = list(color = "blue"),
steps = list(
  list(range = c(0, 4800), color = "white"),
  list(range = c(4800, 6000), color = "red")),
threshold = list(
  line = list(color = "black", width = 6),
  thickness = 0.75,
  value = 4800)))
```
In this example, both the main number and the delta value will be displayed 
with two decimal places. You can adjust these strings to display the numbers 
with the precision you prefer.

-

Here you go. I have no idea how it does this, and have a discussion on elements 
of "Sein und Zeit" and book 19 of the Odyssey, and tutor me in Italian 
conversation, and draft Mermaid mind-maps - but here we are.


:-)





> On Jul 22, 2023, at 10:50, Thomas Subia  wrote:
> 
> \In this example, the value was 2324, the gauge displays 2320.
> I'm not sure why this occurs. Changing the statement to 56, results in the 
> gauge reading 60. I'm not sure what needs to be changed in the script or the 
> environment to stop rounding.




> On Jul 22, 2023, at 10:43, Boris Steipe  wrote:
> 
> What do you mean "Rounded"?
> What do you expect, what do you get instead?
> 
> ?
> 
> 
> 
> 
> 
>> On Jul 22, 2023, at 10:40, Thomas Subia via R-help  
>> wrote:
>> 
>> Colleagues,
>> Thanks for the update.
>> My colleagues at work have run this script but the resulting graph output 
>> for value is rounded. How can one turn this annoying feature off?
>> I've googled this but to no avail.
>> 
>> 
>> 
>> 
>> [[alternative HTML version deleted]]
>> 
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] plotly

2023-07-22 Thread Boris Steipe
What do you mean "Rounded"?
What do you expect, what do you get instead?

?





> On Jul 22, 2023, at 10:40, Thomas Subia via R-help  
> wrote:
> 
> Colleagues,
> Thanks for the update.
> My colleagues at work have run this script but the resulting graph output for 
> value is rounded. How can one turn this annoying feature off?
> I've googled this but to no avail.
> 
> 
> 
> 
> [[alternative HTML version deleted]]
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] plotly

2023-07-22 Thread Thomas Subia via R-help
Colleagues,
Thanks for the update.
My colleagues at work have run this script but the resulting graph output for 
value is rounded. How can one turn this annoying feature off?
I've googled this but to no avail.




[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] plotly question

2023-07-22 Thread CALUM POLWART
I was just replying to say which bit do you consider the indicator.

But I see Boris has provided a Chat GPT solution.

Running it hopefully shows you how to change colours on various parts.



On Fri, 21 Jul 2023, 22:43 Jeff Newmiller,  wrote:

> plotly is _not_ associated with posit. I think you are unlikely to find
> expertise with plotly in their forums. You might find help at
> stackoverflow.com.
>
> On July 21, 2023 1:40:49 PM PDT, Bert Gunter 
> wrote:
> >As you apparently haven't received any responses yet, I'll try to
> >suggest something useful. However, I have absolutely zero experience
> >with plotly, so this is just from general principles and reading the
> >plot_ly Help file, which says for the "..." arguments:
> >
> >"Arguments (i.e., attributes) passed along to the trace type. See
> >schema() for a list of acceptable attributes for a given trace type
> >(by going to traces -> type -> attributes). Note that attributes
> >provided at this level may override other arguments (e.g. plot_ly(x =
> >1:10, y = 1:10, color = I("red"), marker = list(color = "blue")))."
> >
> >So I would **guess** that you needs to go to ?schema to see if the
> >further attributes of your "gauge" type that you wish to change are
> >there.
> >
> >Alternatively, plotly is a package from posit.co, formerly RStudio;
> >they have an extensive support site and community here:
> >https://posit.co/support/
> >So you may have success there.
> >
> >Finally, I assume you have tried web searching appropriate search
> >queries, but if not, you should do so. It is sometimes surprising how
> >much you can find that way.
> >
> >... and, again, apologies if my ignorance means my suggestions are
> useless.
> >
> >Cheers,
> >Bert
> >
> >
> >On Fri, Jul 21, 2023 at 6:19 AM Thomas Subia via R-help
> > wrote:
> >>
> >> Colleagues
> >>
> >> Here is my reproducible code
> >>
> >> plot_ly(
> >>   domain = list(x = c(0, 1), y = c(0, 1)),
> >>   value = 2874,
> >>   title = list(text = "Generic"),
> >>   type = "indicator",
> >>   mode = "gauge+number+delta",
> >>   delta = list(reference = 4800),
> >>   gauge = list(
> >> axis =list(range = list(NULL, 5000)),
> >> steps = list(
> >> list(range = c(0, 4800), color = "white"),
> >> list(range = c(4800, 6000), color = "red")),
> >> threshold = list(
> >> line = list(color = "black", width = 6),
> >> thickness = 0.75,
> >> value = 4800)))
> >>
> >> How can I change the indicator color from green to some other color?
> >>
> >> How can I change the typeface and font size of the speedometer tick
> mark font size?
> >>
> >> Thomas Subia
> >>
> >> [[alternative HTML version deleted]]
> >>
> >> __
> >> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> >> https://stat.ethz.ch/mailman/listinfo/r-help
> >> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> >> and provide commented, minimal, self-contained, reproducible code.
> >
> >__
> >R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> >https://stat.ethz.ch/mailman/listinfo/r-help
> >PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> >and provide commented, minimal, self-contained, reproducible code.
>
> --
> Sent from my phone. Please excuse my brevity.
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] plotly question

2023-07-21 Thread Boris Steipe
Since it is 2023, I asked that question to ChatGPT-4 and got the following 
response.

-

The `plotly` library in R uses the `gauge` argument inside the `plot_ly` 
function to specify the properties of the gauge plot. You can change the 
indicator color of the arc (also known as the bar) by setting the `bar` 
property inside `gauge`, and the `font` property for modifying the typeface and 
font size of the tick marks on the arc.

Below is an example that modifies your code to change the indicator color of 
the arc to blue and sets the font to Arial with a size of 20:

```R
plotly::plot_ly(
  domain = list(x = c(0, 1), y = c(0, 1)),
  value = 2874,
  title = list(text = "Generic"),
  type = "indicator",
  mode = "gauge+number+delta",
  delta = list(reference = 4800),
  gauge = list(
axis = list(range = list(NULL, 5000), 
tickfont = list(size = 20, family = "Arial")),
bar = list(color = "blue"),
steps = list(
  list(range = c(0, 4800), color = "white"),
  list(range = c(4800, 6000), color = "red")),
threshold = list(
  line = list(color = "black", width = 6),
  thickness = 0.75,
  value = 4800)))
```

Please note that the colors are specified by strings that can either be a 
CSS-acceptable color name or a hexadecimal color code. You can adjust the 
`tickfont` size and family properties according to your preferences.

---

That seems to do what was requested - the bar is blue now, and changing "Arial" 
to "Times" in the code indeed has the expected effect.

Nice.




Boris





> On Jul 21, 2023, at 17:43, Jeff Newmiller  wrote:
> 
> plotly is _not_ associated with posit. I think you are unlikely to find 
> expertise with plotly in their forums. You might find help at 
> stackoverflow.com.
> 
> On July 21, 2023 1:40:49 PM PDT, Bert Gunter  wrote:
>> As you apparently haven't received any responses yet, I'll try to
>> suggest something useful. However, I have absolutely zero experience
>> with plotly, so this is just from general principles and reading the
>> plot_ly Help file, which says for the "..." arguments:
>> 
>> "Arguments (i.e., attributes) passed along to the trace type. See
>> schema() for a list of acceptable attributes for a given trace type
>> (by going to traces -> type -> attributes). Note that attributes
>> provided at this level may override other arguments (e.g. plot_ly(x =
>> 1:10, y = 1:10, color = I("red"), marker = list(color = "blue")))."
>> 
>> So I would **guess** that you needs to go to ?schema to see if the
>> further attributes of your "gauge" type that you wish to change are
>> there.
>> 
>> Alternatively, plotly is a package from posit.co, formerly RStudio;
>> they have an extensive support site and community here:
>> https://posit.co/support/
>> So you may have success there.
>> 
>> Finally, I assume you have tried web searching appropriate search
>> queries, but if not, you should do so. It is sometimes surprising how
>> much you can find that way.
>> 
>> ... and, again, apologies if my ignorance means my suggestions are useless.
>> 
>> Cheers,
>> Bert
>> 
>> 
>> On Fri, Jul 21, 2023 at 6:19 AM Thomas Subia via R-help
>>  wrote:
>>> 
>>> Colleagues
>>> 
>>> Here is my reproducible code
>>> 
>>> plot_ly(
>>>  domain = list(x = c(0, 1), y = c(0, 1)),
>>>  value = 2874,
>>>  title = list(text = "Generic"),
>>>  type = "indicator",
>>>  mode = "gauge+number+delta",
>>>  delta = list(reference = 4800),
>>>  gauge = list(
>>>axis =list(range = list(NULL, 5000)),
>>>steps = list(
>>>list(range = c(0, 4800), color = "white"),
>>>list(range = c(4800, 6000), color = "red")),
>>>threshold = list(
>>>line = list(color = "black", width = 6),
>>>thickness = 0.75,
>>>value = 4800)))
>>> 
>>> How can I change the indicator color from green to some other color?
>>> 
>>> How can I change the typeface and font size of the speedometer tick mark 
>>> font size?
>>> 
>>> Thomas Subia
>>> 
>>>[[alternative HTML version deleted]]
>>> 
>>> __
>>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
>> 
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
> 
> -- 
> Sent from my phone. Please excuse my brevity.
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide 

Re: [R] plotly question

2023-07-21 Thread Jeff Newmiller
plotly is _not_ associated with posit. I think you are unlikely to find 
expertise with plotly in their forums. You might find help at stackoverflow.com.

On July 21, 2023 1:40:49 PM PDT, Bert Gunter  wrote:
>As you apparently haven't received any responses yet, I'll try to
>suggest something useful. However, I have absolutely zero experience
>with plotly, so this is just from general principles and reading the
>plot_ly Help file, which says for the "..." arguments:
>
>"Arguments (i.e., attributes) passed along to the trace type. See
>schema() for a list of acceptable attributes for a given trace type
>(by going to traces -> type -> attributes). Note that attributes
>provided at this level may override other arguments (e.g. plot_ly(x =
>1:10, y = 1:10, color = I("red"), marker = list(color = "blue")))."
>
>So I would **guess** that you needs to go to ?schema to see if the
>further attributes of your "gauge" type that you wish to change are
>there.
>
>Alternatively, plotly is a package from posit.co, formerly RStudio;
>they have an extensive support site and community here:
>https://posit.co/support/
>So you may have success there.
>
>Finally, I assume you have tried web searching appropriate search
>queries, but if not, you should do so. It is sometimes surprising how
>much you can find that way.
>
>... and, again, apologies if my ignorance means my suggestions are useless.
>
>Cheers,
>Bert
>
>
>On Fri, Jul 21, 2023 at 6:19 AM Thomas Subia via R-help
> wrote:
>>
>> Colleagues
>>
>> Here is my reproducible code
>>
>> plot_ly(
>>   domain = list(x = c(0, 1), y = c(0, 1)),
>>   value = 2874,
>>   title = list(text = "Generic"),
>>   type = "indicator",
>>   mode = "gauge+number+delta",
>>   delta = list(reference = 4800),
>>   gauge = list(
>> axis =list(range = list(NULL, 5000)),
>> steps = list(
>> list(range = c(0, 4800), color = "white"),
>> list(range = c(4800, 6000), color = "red")),
>> threshold = list(
>> line = list(color = "black", width = 6),
>> thickness = 0.75,
>> value = 4800)))
>>
>> How can I change the indicator color from green to some other color?
>>
>> How can I change the typeface and font size of the speedometer tick mark 
>> font size?
>>
>> Thomas Subia
>>
>> [[alternative HTML version deleted]]
>>
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>
>__
>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

-- 
Sent from my phone. Please excuse my brevity.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] plotly question

2023-07-21 Thread Bert Gunter
As you apparently haven't received any responses yet, I'll try to
suggest something useful. However, I have absolutely zero experience
with plotly, so this is just from general principles and reading the
plot_ly Help file, which says for the "..." arguments:

"Arguments (i.e., attributes) passed along to the trace type. See
schema() for a list of acceptable attributes for a given trace type
(by going to traces -> type -> attributes). Note that attributes
provided at this level may override other arguments (e.g. plot_ly(x =
1:10, y = 1:10, color = I("red"), marker = list(color = "blue")))."

So I would **guess** that you needs to go to ?schema to see if the
further attributes of your "gauge" type that you wish to change are
there.

Alternatively, plotly is a package from posit.co, formerly RStudio;
they have an extensive support site and community here:
https://posit.co/support/
So you may have success there.

Finally, I assume you have tried web searching appropriate search
queries, but if not, you should do so. It is sometimes surprising how
much you can find that way.

... and, again, apologies if my ignorance means my suggestions are useless.

Cheers,
Bert


On Fri, Jul 21, 2023 at 6:19 AM Thomas Subia via R-help
 wrote:
>
> Colleagues
>
> Here is my reproducible code
>
> plot_ly(
>   domain = list(x = c(0, 1), y = c(0, 1)),
>   value = 2874,
>   title = list(text = "Generic"),
>   type = "indicator",
>   mode = "gauge+number+delta",
>   delta = list(reference = 4800),
>   gauge = list(
> axis =list(range = list(NULL, 5000)),
> steps = list(
> list(range = c(0, 4800), color = "white"),
> list(range = c(4800, 6000), color = "red")),
> threshold = list(
> line = list(color = "black", width = 6),
> thickness = 0.75,
> value = 4800)))
>
> How can I change the indicator color from green to some other color?
>
> How can I change the typeface and font size of the speedometer tick mark font 
> size?
>
> Thomas Subia
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Plotly

2021-11-08 Thread Jeff Reichman
Bert

Ok I'll give that a shot too.

Jeff

-Original Message-
From: Bert Gunter  
Sent: Monday, November 8, 2021 1:16 PM
To: reichm...@sbcglobal.net
Cc: R-help 
Subject: Re: [R] Plotly

As Plotly for R is a product of private company, your query is off topic here 
(though you may get a response if you are lucky). They have their own Help 
forum to which you should post instead:

https://community.plotly.com/c/graphing-libraries/r/9


Bert Gunter

"The trouble with having an open mind is that people keep coming along and 
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

On Mon, Nov 8, 2021 at 10:25 AM Jeff Reichman  wrote:
>
> R Help Forum
>
>
>
> Anyone know if there are Plotly issues ones need to be aware of. For 
> example I quite often receive the following error "Error in 
> dirname(to) : path too long." I find there is no one fix. Is there 
> some sort of Windows /Plotly naming restrictions???
>
>
>
> # create a line chart displaying launches by agency type, with 
> highlighting
>
> shared_launches %>%
>
>   plot_ly(x = ~launch_year, y = ~n, color = ~agency_type) %>%
>
>   add_lines() %>%
>
>   highlight()
>
>
>
> Jeff
>
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Plotly

2021-11-08 Thread Jeff Newmiller
I don't know any details of Plotly, but Windows does have a directory depth 
limit that can be very frustrating. I think there is a registry setting that 
can help alleviate, but it breaks some things so it is highly dependent on how 
you use your computer as to whether you can take advantage of that setting.

On November 8, 2021 11:15:59 AM PST, Bert Gunter  wrote:
>As Plotly for R is a product of private company, your query is off
>topic here (though you may get a response if you are lucky). They have
>their own Help forum to which you should post instead:
>
>https://community.plotly.com/c/graphing-libraries/r/9
>
>
>Bert Gunter
>
>"The trouble with having an open mind is that people keep coming along
>and sticking things into it."
>-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>
>On Mon, Nov 8, 2021 at 10:25 AM Jeff Reichman  wrote:
>>
>> R Help Forum
>>
>>
>>
>> Anyone know if there are Plotly issues ones need to be aware of. For example
>> I quite often receive the following error "Error in dirname(to) : path too
>> long." I find there is no one fix. Is there some sort of Windows /Plotly
>> naming restrictions???
>>
>>
>>
>> # create a line chart displaying launches by agency type, with highlighting
>>
>> shared_launches %>%
>>
>>   plot_ly(x = ~launch_year, y = ~n, color = ~agency_type) %>%
>>
>>   add_lines() %>%
>>
>>   highlight()
>>
>>
>>
>> Jeff
>>
>>
>> [[alternative HTML version deleted]]
>>
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>
>__
>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

-- 
Sent from my phone. Please excuse my brevity.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Plotly

2021-11-08 Thread Bert Gunter
As Plotly for R is a product of private company, your query is off
topic here (though you may get a response if you are lucky). They have
their own Help forum to which you should post instead:

https://community.plotly.com/c/graphing-libraries/r/9


Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

On Mon, Nov 8, 2021 at 10:25 AM Jeff Reichman  wrote:
>
> R Help Forum
>
>
>
> Anyone know if there are Plotly issues ones need to be aware of. For example
> I quite often receive the following error "Error in dirname(to) : path too
> long." I find there is no one fix. Is there some sort of Windows /Plotly
> naming restrictions???
>
>
>
> # create a line chart displaying launches by agency type, with highlighting
>
> shared_launches %>%
>
>   plot_ly(x = ~launch_year, y = ~n, color = ~agency_type) %>%
>
>   add_lines() %>%
>
>   highlight()
>
>
>
> Jeff
>
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] plotly

2014-07-22 Thread Matt Sundquist
Hey Shane,

Sorry you're having trouble.

The quick start is here and walks through installation: https://plot.ly/r/.

A note. If you're on Windows, you'll need Rtools to install devtools:
http://cran.rstudio.com/bin/windows/Rtools/. As Sarah noted, Plotly isn't
on CRAN.

If you're having trouble, please let us know and we're happy to try and
help, or open an issue on GitHub: https://github.com/ropensci/plotly/issues.

M


On Mon, Jul 21, 2014 at 4:05 AM, Sarah Goslee sarah.gos...@gmail.com
wrote:

 Hi,

 On Monday, July 21, 2014, Shane Carey careys...@gmail.com wrote:

  Hey,
 
  What version of R is required to use the plotly library?
 
  I have R version 3.0.1 and it will not allow me to install the devtools
  package or the ploty package.
 
  I have googled and searched to see what version of R I should be running
  but could not find anything.


 It's always a good idea to upgrade to the current release of R before
 asking questions like that (3.1.1). But in general, packages on CRAN
 clearly state what version of R is needed, as in

 http://cran.r-project.org/web/packages/devtools/index.html
 devtools: Tools to make developing R code easier

 Collection of package development tools

 Version:1.5Depends:R (≥ 3.0.2)

 For packages not on CRAN, like plotly, you may need to download the package
 and check the DESCRIPTION file.

 Sarah


 --
 Sarah Goslee
 http://www.stringpage.com
 http://www.sarahgoslee.com
 http://www.functionaldiversity.org

 [[alternative HTML version deleted]]


 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] plotly

2014-07-21 Thread Sarah Goslee
Hi,

On Monday, July 21, 2014, Shane Carey careys...@gmail.com wrote:

 Hey,

 What version of R is required to use the plotly library?

 I have R version 3.0.1 and it will not allow me to install the devtools
 package or the ploty package.

 I have googled and searched to see what version of R I should be running
 but could not find anything.


It's always a good idea to upgrade to the current release of R before
asking questions like that (3.1.1). But in general, packages on CRAN
clearly state what version of R is needed, as in

http://cran.r-project.org/web/packages/devtools/index.html
devtools: Tools to make developing R code easier

Collection of package development tools

Version:1.5Depends:R (≥ 3.0.2)

For packages not on CRAN, like plotly, you may need to download the package
and check the DESCRIPTION file.

Sarah


-- 
Sarah Goslee
http://www.stringpage.com
http://www.sarahgoslee.com
http://www.functionaldiversity.org

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.