I threw this together really quickly... excuse the mess:
using Plots
# initial plot
plot(linspace(10,34,100), 30rand(100,2).+[0 60],
leg=false, ylim=(-60,150), axis=nothing,
xguide="Time(ms)", yguide="current(mA)")
# lines and annotations
x,y = 12,-40
plot!([x,x,x+10], [y+10,y,y], c=:black,
ann=[(x+5,y,text("10 ms",:top,10)),
(x,y+5,text("10 mA",:right,10))])
png("/tmp/tmp")
On Wed, Aug 10, 2016 at 10:31 AM, Willem Hekman <[email protected]>
wrote:
> If you'd try to do this using PyPlot you can remove the x- and y-axis by
> translating the necesarry matplotlib code i.e.
> http://www.shocksolution.com/2011/08/removing-an-axis-or-
> both-axes-from-a-matplotlib-plot/
> to the syntax that PyPlot takes, which is slightly different. You would
> get something like
>
> plot(x,y) # some 2D plot call
> ax = gca() # get current axes (the drawing area in PyPlot, dont confuse
> axes with axis here)
> ax[:get_xaxis][:set_visible](false) # make x-axis invisible
>
> for inspiration you can have a look at https://gist.github.com/
> gizmaa/7214002
>
> Adding the scale bars I cant seem to come up with a solution straight away
> unfortunately, anyone has an idea?
>
>
> On Monday, August 8, 2016 at 6:33:14 PM UTC+2, Islam Badreldin wrote:
>>
>>
>>
>> Hello,
>>
>> Is there a simple way in Julia to add scale bars with labels to plots and
>> to hide the x-y axes as well? The way to do in MATLAB involves a lot of
>> manual tweaking as described here
>> http://www.mathworks.com/matlabcentral/answers/151248-add-a-
>> scale-bar-to-my-plot
>>
>> I'm hoping to find a more elegant way in Julia!
>>
>> Thanks,
>> Islam
>>
>