Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 21 Nov 2014, 12:49
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
Create graph paper with mtpaint
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 3 Posts_count   Goto page: 1, 2, 3 Next
Author Message
don570


Joined: 10 Mar 2010
Posts: 3378
Location: Ontario

PostPosted: Wed 11 Dec 2013, 21:15    Post_subject:  Create graph paper with mtpaint  

Mtpaint - Tutorial graph paper

In this tutorial graph paper is created ---> 10 points by 10 points

1) Select RGB or indexed color document ---> any size

2) View > Show dock should be chosen

3) Right click on Place Gradient to create a custom gradient.
Click 'Edit Custom'.
There should be 10 points. 9 white and the last one black.
Click OK to close 'Custom' window.See image...




4) Choose 'Linear' and 'Repeat' ---> a repeat length of 9 rather than 10
gives better results. See image....



5) Click Apply and OK


6) Click in settings dock for gradient mode to be active

7) Click 'Place gradient' icon and place the gradient. Be careful to observe
numbers at bottom of window to make the gradient vertical and a length of 10 points.
Tip: Hold down Shift or CTRL-shift keys to achieve 90 degree angles

8 ) Colors

A ----> white
B ----> black

9) Right click on Flood fill icon. Set the Flood fill ----> to highest number .
'Gradient driven' can be set on or off.




10) Click in document with Flood fill. See results.






11) Make a new upper layer
Transparent color 7
Show all layers




12) In the upper layer, click on the Place Gradient.
place horizontally a distance of 10 points for the vertical lines

13) Make sure Gradient mode is active and do a flood fill



14) Save the result to your hard disk by
Layers > Save Composite image

Transparency set to -1

_______________________________________________
Back to top
View user's profile Send_private_message 
wjaguar

Joined: 21 Jun 2006
Posts: 291

PostPosted: Thu 12 Dec 2013, 15:24    Post_subject: Re: Create graph paper with mtpaint  

Some steps can be done easier.

don570 wrote:
10 points. 9 white and the last one black.

11 points, 9 white and 2 black, with last 3 set to "constant", work better: no halftones can appear.

Quote:
Right click on Flood fill icon. Set the Flood fill ----> to highest number .
Quote:
Make a new upper layer

No need of floodfill and layers here.
For first step, Select all - Fill selection.
Then rotate gradient placement 90 degrees.
Then mask the color black in palette window.
And again, Select all - Fill selection.

Or another way: copy the first step image (lines), rotate clipboard and paste back - either with masking (protecting) black in image, or you can mask (ignore) white on clipboard instead.

Or instead of masking, use "Darken" blend mode for the second step (with either gradient or clipboard).

Or the simplest way of them all: just make an image of a single grid cell, and Resize Canvas (Tile) it into any size you want. Smile
Back to top
View user's profile Send_private_message 
don570


Joined: 10 Mar 2010
Posts: 3378
Location: Ontario

PostPosted: Sat 14 Dec 2013, 13:41    Post_subject:  

I should have realised that I can rotate the image 90 degrees
and then make the lines again. Embarassed

... or just use the clipboard to paste a copy to a top layer and
rotate there.

That would have speeded up the work since the placing of the gradient
is the hard part.
___________________________________________________________
Back to top
View user's profile Send_private_message 
vovchik


Joined: 23 Oct 2006
Posts: 1287
Location: Ukraine

PostPosted: Sat 14 Dec 2013, 15:40    Post_subject:  

Dear all,

I know this might be off-topic a bit, but not really, I think. This is an svg way of doing it:

Code:

<svg width="500" height="500">
<style type="text/css">.blue {fill:none;stroke:lightblue;}
    .maingridx {stroke-dasharray:0.5,49,0.5,0;stroke-width:500;}
    .maingridy {stroke-dasharray:0.5,49,0.5,0;stroke-width:500;}
    .gridx {stroke-dasharray:0.2,9.6,0.2,0;stroke-width:500;}
    .gridy {stroke-dasharray:0.2,9.6,0.2,0;stroke-width:500;}
    #labels {font-size:10px;fill:gray;font-family:Sans;}
    .center {text-anchor:middle;}
    .rj {text-anchor:end;}</style>
<g transform="translate(0) scale(1)">
<line class="blue gridx" y1="250" y2="250" x2="500"/>
<line class="blue gridy" x1="250" y2="500" x2="250"/>
<line class="blue maingridx" y1="250" y2="250" x2="500"/>
<line class="blue maingridy" x1="250" y2="500" x2="250"/>
<g id="labels">
<g class="center" transform="translate(0,261)">
<text x="50" y="0" id="x1">-20</text>
<text x="100" y="0" id="x2">-15</text>
<text x="150" y="0" id="x3">-10</text>
<text x="200" y="0" id="x4">-5</text>
<text x="250" y="0" id="x5">0</text>
<text x="300" y="0" id="x6">5</text>
<text x="350" y="0" id="x7">10</text>
<text x="400" y="0" id="x8">15</text>
<text x="450" y="0" id="x9">20</text>
</g>
<g class="rj" transform="translate(246,4)">
<text x="0" y="450" id="y1">-20</text>
<text x="0" y="400" id="y2">-15</text>
<text x="0" y="350" id="y3">-10</text>
<text x="0" y="300" id="y4">-5</text>
<text x="0" y="250" id="y5">0</text>
<text x="0" y="200" id="y6">5</text>
<text x="0" y="150" id="y7">10</text>
<text x="0" y="100" id="y8">15</text>
<text x="0" y="50" id="y9">20</text>
</g>
</g>
</g>
</svg>


With kind regards,
vovchik
Back to top
View user's profile Send_private_message 
don570


Joined: 10 Mar 2010
Posts: 3378
Location: Ontario

PostPosted: Sat 14 Dec 2013, 15:52    Post_subject:  

Interesting Cool

A BASH script could generate the SVG image.

____________________________________________
Back to top
View user's profile Send_private_message 
vovchik


Joined: 23 Oct 2006
Posts: 1287
Location: Ukraine

PostPosted: Sat 14 Dec 2013, 16:03    Post_subject:  

Dear Don,

I was also thinking exactly along those lines - and all very small and tidy .... Smile

With kind regards,
vovchik
Back to top
View user's profile Send_private_message 
gcmartin

Joined: 14 Oct 2005
Posts: 4435
Location: Earth

PostPosted: Sat 14 Dec 2013, 17:14    Post_subject:  

could someone offer a script. And if so, could the very first post, which I think is presented in an excellent fashion, reference the script and other method as alternative(s). This could be done via links to the internal posts from the opening post.

Thanks @Don570 for authoring this thread.

_________________
Get ACTIVE Create Circles; Do those good things which benefit people's needs!
We are all related ... Its time to show that we know this!
3 Different Puppy Search Engine or use DogPile
Back to top
View user's profile Send_private_message 
wjaguar

Joined: 21 Jun 2006
Posts: 291

PostPosted: Sat 14 Dec 2013, 18:52    Post_subject:  

don570 wrote:
A BASH script could generate the SVG image.

Speaking of scripts - a Bash script could generate an XPM image of same thing, and do it about 50 times simpler than SVG. Smile
Back to top
View user's profile Send_private_message 
vovchik


Joined: 23 Oct 2006
Posts: 1287
Location: Ukraine

PostPosted: Sat 14 Dec 2013, 19:09    Post_subject:  

Dear wjaguar,

Just thinking out loud. Xpms are raster representations and do not scale readily - although you can do that with plain ASCII chars, I know, so bash could do them easily. However, the SVG is intrinsically much smaller - and if the grid text and superfluous "id=" are thrown out, the svg file is really tiny. Also, a graph can be generated easily using a path, without having to calculate all the pixel positions that you would have to do with xpm...and bash ain't great at or fast with arithmetic, as we all know. If you have a decent example, please post.... Smile

With kind regards,
vovchik
Back to top
View user's profile Send_private_message 
rcrsn51


Joined: 05 Sep 2006
Posts: 9255
Location: Stratford, Ontario

PostPosted: Sat 14 Dec 2013, 20:03    Post_subject:  

The key issue here is the final destination of the graphic. Is it to be printed on a sheet of paper?
Back to top
View user's profile Send_private_message 
wjaguar

Joined: 21 Jun 2006
Posts: 291

PostPosted: Sat 14 Dec 2013, 20:38    Post_subject:  

vovchik wrote:
However, the SVG is intrinsically much smaller - and if the grid text and superfluous "id=" are thrown out, the svg file is really tiny. Also, a graph can be generated easily using a path, without having to calculate all the pixel positions that you would have to do with xpm...

What these nice words do in fact mean, is that you need to learn programming in SVG language to do anything worthwhile with SVGs.
And thing is, if programming it is, I can fire up my Perl, load Postscript::Simple, and with it produce a scalable and directly printable file in a tiny fraction of time. Wink
SVG is frequently a solution in search of problem.

Quote:
and bash ain't great at or fast with arithmetic, as we all know. If you have a decent example, please post.... Smile

Here it is! Laughing
Code:
#!/bin/sh
perl -MGD::Graph -e ....

http://gdgraph.com/samples.html
Back to top
View user's profile Send_private_message 
gcmartin

Joined: 14 Oct 2005
Posts: 4435
Location: Earth

PostPosted: Sun 15 Dec 2013, 01:18    Post_subject: Uses for graph paper  

This could become a Watermark in printing or a form used in printing. Of course, there are other creative uses not to mention its uses in Geometry and Trigonometry or guide for placing nails in wall or slices in a board or ???

Just some not so fancy uses.

_________________
Get ACTIVE Create Circles; Do those good things which benefit people's needs!
We are all related ... Its time to show that we know this!
3 Different Puppy Search Engine or use DogPile
Back to top
View user's profile Send_private_message 
vovchik


Joined: 23 Oct 2006
Posts: 1287
Location: Ukraine

PostPosted: Sun 15 Dec 2013, 09:22    Post_subject:  

Dear wjaguar (et al.),

The perl GD module, as far as I know, isn't present in most puppy distributions Sad And as for svg, there is no real programming involved, just a few basic concepts relating to syntax (we could also parametrize the grid and scaling here, too, with very little effort, as well as axis annotation). The main thing is to construct the path strings properly, which isn't really hard.

With kind regards,
vovchik

Code:

#!/bin/sh

# ******************
# INIT VARS
# ******************

img_w="500"
img_h="500"
grid_color="lightblue"
line_path="M 10 490 200 350 250 250 350 350 490 490"
line_color="gray"
curve_path="M 10 490 S 200 350 250 250 350 350 490 490"
curve_color="red"
title="WINDOWS USERS WORLDWIDE"
font_name="sans-serif"
font_size="24"
font_weight="900"
font_color="firebrick"
temp_file="/tmp/temp.svg"

# ******************
# MAKE SVG
# ******************

svg="<svg width='$img_w' height='$img_h'>
  <g style='fill:none;stroke:$grid_color;stroke-width:500'>
    <g id='light' stroke-dasharray='0.2,9.6,0.2,0'>
      <line class='sub_x' y1='250' y2='250' x1='0' x2='500'/>
      <line class='sub_y' y1='0' x1='250' y2='500' x2='250'/>
    </g>
    <g id='heavy' stroke-dasharray='0.5,49,0.5,0'>
      <line class='main_x' y1='250' y2='250' x1='0' x2='500'/>
      <line class='main_y' y1='0' x1='250' y2='500' x2='250'/>
    </g>
  </g>
  <g id='windows'>
    <path id='curve' stroke-width='4' stroke='$curve_color' fill='none'
      d='$curve_path'/>
    <path id='line' stroke-width='2' stroke-dasharray='5,5' stroke='$line_color'
      fill='none' opacity='0.75' d='$line_path'/>
    <text id='title' text-anchor='middle' x='250' y='50' stroke='none'
      fill='$font_color' font-family='$font_name'
      font-size='$font_size' font-weight='$font_weight'>$title</text>
  </g>
</svg>"

echo "$svg" > "$temp_file"

defaultimageviewer "$temp_file"
Back to top
View user's profile Send_private_message 
seaside

Joined: 11 Apr 2007
Posts: 887

PostPosted: Sun 15 Dec 2013, 13:32    Post_subject:  

Here's a quick 13X10 grid graph paper style svg maker-

Code:
#!/bin/sh
# 13X10 grid

box_size="48"
square_h="13"
square_v="10"

svg_width=$((box_size*square_h))
svg_height=$((box_size*square_v))


svg_grid="<svg  width='$svg_width' height='$svg_height'>
  <defs>
    <pattern id='grid' width='$box_size' height='$box_size' patternUnits='userSpaceOnUse'>
      <rect fill='white' stroke='black' x='0' y='0' width='$box_size' height='$box_size'/>
    </pattern>
  </defs>
  <rect fill='url(#grid)' stroke='black' x='0' y='0' width='100%' height='100%'/>
</svg>"

echo "$svg_grid" > /tmp/svg_grid

defaultimageviewer /tmp/svg_grid


You can vary the box size and the number of horizontal and vertical boxes.

Cheers,
s
Back to top
View user's profile Send_private_message 
vovchik


Joined: 23 Oct 2006
Posts: 1287
Location: Ukraine

PostPosted: Sun 15 Dec 2013, 17:30    Post_subject:  

Dear all,

What about this? A bit of mine and a bit of seaside?

With kind regards,
vovchik

Code:

#!/bin/sh

box_size="10"
square_h="100"
square_v="70"
units=""
svg_width=$((box_size*square_h))
svg_height=$((box_size*square_v))
maj_grid=$((box_size*5))

svg_grid="<svg  width='$svg_width$units' height='$svg_height$units'>
  <defs>
    <pattern id='grid' width='$box_size' height='$box_size' patternUnits='userSpaceOnUse'>
      <rect fill='white' stroke-width='0.5' stroke='lightblue' x='0' y='0' width='$box_size' height='$box_size'/>
    </pattern>
    <pattern id='gridbig' width='$maj_grid' height='$maj_grid' patternUnits='userSpaceOnUse'>
      <rect fill='none' stroke-width='0.7' stroke='lightblue' x='0' y='0' width='$maj_grid' height='$maj_grid'/>
    </pattern>
  </defs>
  <rect fill='url(#grid)' stroke='lightblue' x='0' y='0' width='100%' height='100%'/>
  <rect fill='url(#gridbig)' stroke-width='3' stroke='lightblue' x='0' y='0' width='100%' height='100%'/>
</svg>"

echo "$svg_grid" > /tmp/svg_grid2.svg

defaultimageviewer /tmp/svg_grid2.svg
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 3 Posts_count   Goto page: 1, 2, 3 Next
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1089s ][ Queries: 12 (0.0046s) ][ GZIP on ]