Re: [julia-users] errorbar plot in Plots.jl

2016-11-09 Thread Li Zhang
the default color is all black, how to set the colors for errorbars?

On Friday, October 14, 2016 at 10:23:34 PM UTC-7, franck...@gmail.com wrote:
>
> Beautiful, thank you!
>
> On Saturday, October 15, 2016 at 12:06:39 AM UTC+2, Tom Breloff wrote:
>>
>> Already implemented as attributes: yerror and xerror
>>
>> On Friday, October 14, 2016,  wrote:
>>
>>> I have just discovered Plots, which I use mostly with the PlotlyJS 
>>> backend because of the inline interactivity in Juliabox, and I have been 
>>> spoiled by it: thank you Tom and Spencer.
>>>
>>> I need an errorbar plot (something like 
>>> http://matplotlib.org/examples/statistics/errorbar_demo_features.html): 
>>> is there any plan to add it? I could use the OHLC plot, but I cannot figure 
>>> out how to remove the horizontal bars.
>>>
>>>

[julia-users] Re: `axis(:equal)` or `axis(:scaled)` with Gadfly

2015-08-31 Thread Li Zhang
plot(x=x,y=y,Coord.Cartesian(aspect_ratio=1))

On Wednesday, June 25, 2014 at 7:51:50 AM UTC-4, Tomas Lycken wrote:
>
> When plotting in e.g. PyPlot I can do e.g. axis(:equal) or axis(:scaled) 
> (my favorite) to get a plot where the axes are scaled so that the distance 
> 1 is equally long in the x and y direction on the resulting image, and e.g. 
> the unit circle is actually a circle. Is there any way to do the same in 
> Gadfly?
>
> The only way I’ve found to control the relative scaling of the axes is to 
> set the absolute size of the plot, and (a lot of) trial and error I can 
> find something that is at least close to what I need…
>
> // T
> ​
>


[julia-users] transparent color in gadfly

2015-09-23 Thread Li Zhang
Hi there,

 i found no way to get transparent colors in gadfly, anyone have done this, 
or a issue should be filed?


[julia-users] Re: transparent color in gadfly

2015-09-23 Thread Li Zhang
Hi Tim,

I Checked out the Compose and Gadfly, and set transparent color works in 
```
theme(default_color=RGBA(1.0,0.0,0.0,0.3))
```
but stack overflowed when set transparent color in 
```
Guide.manual_color_key("legend",["label"],[RGBA(1.0,0.0,0.0,0.3)]), and 
Scale.color_discrete_manual(RGBA(1.0,0.0,0.0,0.3))
```

stack overflow
while loading In[45], in expression starting on line 2

 in vcat at abstractarray.jl:517
 in to_vec at /home/alex/.julia/v0.3/Compose/src/Compose.jl:52
 in parse_colorant_vec at /home/alex/.julia/v0.3/Compose/src/Compose.jl:51
 in ManualColorKey at /home/alex/.julia/v0.3/Gadfly/src/guide.jl:490 (repeats 
34898 times)


On Wednesday, September 23, 2015 at 9:39:30 PM UTC-4, Li Zhang wrote:
>
> Hi there,
>
>  i found no way to get transparent colors in gadfly, anyone have done 
> this, or a issue should be filed?
>


[julia-users] readtable produce wrong column name

2015-04-30 Thread Li Zhang
hi all,

I first use writetable to write a dataframe to a csv file. some of the 
column names are "(somename)", or "name & other".

the output csv file showed exact name headers, but when i use readtable to 
read the csv file back to a dataframe, column names become "_somename_" and 
"name_other".

I am not sure if i missed some optional parameters that would do the right 
work or this is bug?

any thought?


[julia-users] Interact.jl widgets does not show up when IJulia and Ipython updated to the latest version

2015-04-30 Thread Li Zhang
anyone have same problems? or an issue needs to be filed.


[julia-users] Re: readtable produce wrong column name

2015-04-30 Thread Li Zhang
but in my original dataframe, julia doesn't complain when i add a column 
using df[symbol("(somename)")]=dataarray.

On Thursday, April 30, 2015 at 2:43:19 PM UTC-4, Li Zhang wrote:
>
> hi all,
>
> I first use writetable to write a dataframe to a csv file. some of the 
> column names are "(somename)", or "name & other".
>
> the output csv file showed exact name headers, but when i use readtable to 
> read the csv file back to a dataframe, column names become "_somename_" and 
> "name_other".
>
> I am not sure if i missed some optional parameters that would do the right 
> work or this is bug?
>
> any thought?
>


[julia-users] does GLM support orthogonal regression, deming regression

2015-05-29 Thread Li Zhang
hi, all

i just run into a situation that the Total least squares is prefered 
instead of ordinary least squares, which shows a slightly smaller slope 
line fitted to my data.

is relevant functions already baked in some packages or there is a quick 
way to do this?


[julia-users] a simple visualization of all the described color strings in Color packge

2015-05-30 Thread Li Zhang
hi folks,

i run into a lot of color usage lately, and always wanted to have a color 
palette to help me choose right and convenient color strings already listed 
in Color package, so that end up a simple palette which i thought someone 
may think it useful.

cheers 

ipython notebook: 
https://www.dropbox.com/s/memvq0ew6143tdm/ColorPalette.ipynb?dl=0




[julia-users] Re: IJulia best practices when defining types

2015-06-01 Thread Li Zhang
i am not sure fully understand your problem, but i found it's usually 
better to create a normal julia file that define your module, and then you 
could include("your module file.jl").

On Monday, June 1, 2015 at 12:54:11 PM UTC-4, Adam Labadorf wrote:
>
> Hi,
>
> I am using julia 0.3.8 + IJulia, and have been using ipython notebook for 
> sometime to perform my research activities. For my current project, I 
> define and export a number of types and methods wrapped in a module in one 
> of the cells, import the module, and refer explicitly to those types and 
> methods elsewhere in the notebook. I have found that redefining/reimporting 
> the module does not seem to work as expected (code excerpt only):
>
> module mt
>
> export ResultSet, start, next, done
>
> type ResultSet
> models::Array{Any}
> sample_inds::Array{Int64}
> failed::Array{Int64}
> num_fails::Int64
> end
> start(x::ResultSet) = 1
> next(x::ResultSet,i::Int64) = (x.models[i],i+1)
> done(x::ResultSet,i::Int64) = (i == length(x.models)+1)
>
> end
>
> import mt;
>
> It works the first time after kernel restart:
>
> mt.start(HD1_HDvC_batch)
>
> 1
>
>
> Later, after editing and rerunning the code:
>
> # model_batch is a ResultSet object
> state = mt.start(model_batch)
>
> `start` has no method matching start(::ResultSet)
> while loading In[10], in expression starting on line 7
>
>
> Eventhough:
>
>
> methods(mt.start)
> 1 method for generic function *start*:
>
>- start(x::*ResultSet*) at In[9]:33
>
>
> I have to restart the kernel basically every time I change any of the types 
> or their methods. This is currently just an annoyance, but when I start 
> running larger analyses in IJulia it will become prohibitive. I am aware of 
> the issues with redefining types in the main namespace of an active kernel 
> REPL, the workspace() function seems to be practically the same as a kernel 
> restart, and defining my types in a module in a cell doesn't seem to fix the 
> resolution issues. To my question:
>
> Is there currently a best practice for using IJulia in this way when 
> developing with custom types? At least one that does not require a kernel 
> restart every time?
>
> I'm still pretty new to julia, so if I am doing anything incorrectly here I'm 
> keen to learn. I'd love to use julia+IJulia exclusively for my work as I once 
> did for python, but it seems there are some of these issues that are 
> presently a barrier to doing that effectively. Does anyone have any 
> suggestions?
>
> Thanks.
>
>
>

[julia-users] DataArray Concatenation

2014-09-23 Thread Li Zhang


a=@data([NA,3,5,7,NA,3,7])
i want to do this:
b=[NA,a[1:end-1]]

but julia says no convert methods.

is there anyone know some other ways?


[julia-users] Re: DataArray Concatenation

2014-09-24 Thread Li Zhang
i tried methods in base for Dequeues, but it seems some of them are not 
implemented for DataArray.
For example:

a=@data([NA,3,5,7,NA,3,7])
b=copy(a[2:end])
append!(b,[NA]) 

append! works, but prepend! gives no methods error.
also deleteat! works but insert! no methods. 

anyway, other methods works well.

Thanks


On Tuesday, September 23, 2014 9:11:20 PM UTC-4, Li Zhang wrote:
>
>
>
> a=@data([NA,3,5,7,NA,3,7])
> i want to do this:
> b=[NA,a[1:end-1]]
>
> but julia says no convert methods.
>
> is there anyone know some other ways?
>


[julia-users] Re: DataArray Concatenation

2014-09-25 Thread Li Zhang
I would very much like to contribute, but i am not sure if i had time, some 
projects are keeping me busy. would to look at it when i have spare time. 

By the way, john, great work for julia statistics:)

On Tuesday, September 23, 2014 9:11:20 PM UTC-4, Li Zhang wrote:
>
>
>
> a=@data([NA,3,5,7,NA,3,7])
> i want to do this:
> b=[NA,a[1:end-1]]
>
> but julia says no convert methods.
>
> is there anyone know some other ways?
>


[julia-users] set DPI of output figure

2015-01-28 Thread Li Zhang
Hi fellows,

I just encounter a scenario that i want to set the DPI of PNG output of 
gadfly plot.

There seems no direct way to control what i want

```
draw(PNG(path, width, height))
```

Any one have experience or way to do this?


[julia-users] Re: set DPI of output figure

2015-01-29 Thread Li Zhang
it works, thanks!

On Wednesday, January 28, 2015 at 6:40:10 PM UTC-5, Avik Sengupta wrote:
>
> I believe you can do it this way: 
>
> draw(PNG("hi_res.png", 1inch, 1inch, dpi=300), p)
>
> See here for more:  https://github.com/dcjones/Compose.jl/pull/94
>
> You might have to run the latest master of Gadfly.. not sure this is in a 
> released version of Gadfly yet. 
> Run Pkg.checkout("Gadfly") to get the latest master. Pkg.free("Gadfly") to 
> set it back to the released version. 
>
>
>
> On Wednesday, 28 January 2015 23:35:01 UTC, Li Zhang wrote:
>>
>> Hi fellows,
>>
>> I just encounter a scenario that i want to set the DPI of PNG output of 
>> gadfly plot.
>>
>> There seems no direct way to control what i want
>>
>> ```
>> draw(PNG(path, width, height))
>> ```
>>
>> Any one have experience or way to do this?
>>
>