# TkCanvas

**URL:** <https://www.ruby-forum.com/t/tkcanvas/79815>\
**Category:** Ruby\
**Created:** [December 19, 2006, 1:29pm UTC](https://www.ruby-forum.com/t/tkcanvas/79815 "2006-12-19T13:29:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lynchnco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/c77e96/32.png) [@lynchnco](https://www.ruby-forum.com/u/lynchnco)\
**Post date:** [December 19, 2006, 1:29pm UTC](https://www.ruby-forum.com/t/tkcanvas/79815/1 "2006-12-19T13:29:51Z")

</div>

Good morning,  
I’m trying to translate the example on pp 341-345 in "Mastering Perl/TK’  
to Ruby.

On page 344 a method $cp-\>CreatePlotAxis(…) is used. Is there a method  
in TkCanvas that I can use that will produce the same result, namely,  
placing labels on the x axis and y axis?

Thx,  
Pat

---

<div class="post-metadata">

**Author:** ![lynchnco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/c77e96/32.png) [@lynchnco](https://www.ruby-forum.com/u/lynchnco)\
**Post date:** [December 20, 2006, 7:24pm UTC](https://www.ruby-forum.com/t/tkcanvas/79815/2 "2006-12-20T19:24:57Z")

</div>

Hello,

I try to edit a .svg file with RMagick, but the result of just importing  
the file and then saving it as a .jpg is a black&white image (the shapes  
are still there but the colors are not).  
Here is the code

require ‘RMagick’  
include Magick

canvas = Image.read(‘d:\test.svg’).first  
canvas.write(‘d:\test.jpg’)

Any pointers will be greatly appreciated.  
If you know any other way (another image library maybe) I can edit a  
.svg file from ruby please let me know.

Thanks,  
Mihai

---

<div class="post-metadata">

**Author:** ![lynchnco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/c77e96/32.png) [@lynchnco](https://www.ruby-forum.com/u/lynchnco)\
**Post date:** [December 20, 2006, 7:24pm UTC](https://www.ruby-forum.com/t/tkcanvas/79815/3 "2006-12-20T19:24:57Z")

</div>

Mihai Frisan wrote:

> canvas = Image.read(‘d:\test.svg’).first  
> canvas.write(‘d:\test.jpg’)
> 
> Any pointers will be greatly appreciated.  
> If you know any other way (another image library maybe) I can edit a  
> .svg file from ruby please let me know.
> 
> Thanks,  
> Mihai

Mihai,

I see your Support Request on RubyForge. Could you please attach the  
problem SVG file to the request? If you scroll all the way to the bottom  
of the page you’ll see a checkbox that says “Check to Upload & Attach  
File” and a place to select the file. Thanks!

---

<div class="post-metadata">

**Author:** ![lynchnco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/c77e96/32.png) [@lynchnco](https://www.ruby-forum.com/u/lynchnco)\
**Post date:** [December 20, 2006, 7:26pm UTC](https://www.ruby-forum.com/t/tkcanvas/79815/4 "2006-12-20T19:26:59Z")

</div>

On Dec 19, 2006, at 7:41 AM, Patrick L. wrote:

> Good morning,  
> I’m trying to translate the example on pp 341-345 in "Mastering  
> Perl/TK’  
> to Ruby.
> 
> On page 344 a method $cp-\>CreatePlotAxis(…) is used. Is there a  
> method  
> in TkCanvas that I can use that will produce the same result, namely,  
> placing labels on the x axis and y axis?

Uh, didn’t we go through this back is September? And didn’t you get a  
detailed answer from Hidetoshi NAGAI? I can only refer you to:

```
http://www.code-hosting.com/Ruby/1508039-CanvasPlot--

```

createPlotAxis-and-createLinePlot-

AFAIK, there is no one more expert in this area than NAGAI san. I  
don’t think you are going to get a better answer than you already got.

Regards, Morton
