Plot Workbench/ru: Difference between revisions
(Updating to match new version of source page) |
(Updating to match new version of source page) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
[[Image:Workbench_Plot.svg|thumb|128px|Plot workbench icon]] |
[[Image:Workbench_Plot.svg|thumb|128px|Plot workbench icon]] |
||
⚫ | |||
{{TOCright}} |
{{TOCright}} |
||
⚫ | |||
FreeCAD is able to perform plots using the [https://matplotlib.org/ matplotlib] [[Python|Python]] library. A module is provided to this end, as an external add-on in version 0.19 and as a core component from version 0.20 on. Older versions of FreeCAD are not covered in this documentation. |
FreeCAD is able to perform plots using the [https://matplotlib.org/ matplotlib] [[Python|Python]] library. A module is provided to this end, as an external add-on in version 0.19 and as a core component from version 0.20 on. Older versions of FreeCAD are not covered in this documentation. |
||
The produced plots offer the standard [https://matplotlib.org/ matplotlib] tools to edit and save. On top of that, a [[Image:Workbench_Plot.svg|24px]] [[ |
The produced plots offer the standard [https://matplotlib.org/ matplotlib] tools to edit and save. On top of that, a [[Image:Workbench_Plot.svg|24px]] [[Plot_Workbench|Plot Workbench]] is provided as an external add-on offering more complete tools to edit the plot and save it. The add-on can be installed with the [[Std_AddonMgr|Add-on manager]]. |
||
==Module== |
==Module== |
||
The module can be invoked in a Python console or in a [[ |
The module can be invoked in a Python console or in a [[Macros|macro]]. The first thing you must do is importing the module. In FreeCAD 0.19 you must first install the [[Image:Workbench_Plot.svg|24px]] [[Plot_Workbench|Plot Workbench]] using the [[Std_AddonMgr|Add-on manager]], and then you can import Plot by typing: |
||
In FreeCAD 0.19 you must first install the [[Image:Workbench_Plot.svg|24px]] [[Plot Workbench|Plot Workbench]] using the [[Std_AddonMgr|Add-on manager]], and then you can import Plot typing |
|||
{{Code|code= |
{{Code|code= |
||
Line 19: | Line 19: | ||
}} |
}} |
||
Since FreeCAD 0.20 the plot module is already packaged with the program, so you don't need to install any add-on, but just type: |
|||
{{Code|code= |
{{Code|code= |
||
Line 25: | Line 25: | ||
}} |
}} |
||
After that, you can plot a straight line from (0,0) to (1,2) just simply typing |
After that, you can plot a straight line from (0,0) to (1,2) just simply typing: |
||
{{Code|code= |
{{Code|code= |
||
Line 31: | Line 31: | ||
}} |
}} |
||
You can find more complex examples in the [[Plot Basic tutorial]] and the [[Plot MultiAxes tutorial]]. |
You can find more complex examples in the [[Plot_Basic_tutorial|Plot Basic tutorial]] and the [[Plot_MultiAxes_tutorial|Plot MultiAxes tutorial]]. |
||
<div class="mw-translate-fuzzy"> |
|||
== Инструменты == |
== Инструменты == |
||
</div> |
|||
If you decide to install the [[Image:Workbench_Plot.svg|24px]] [[ |
If you decide to install the [[Image:Workbench_Plot.svg|24px]] [[Plot_Workbench|Plot Workbench]] using the [[Std_AddonMgr|Add-on manager]], you will have the following tools available to manage the plots created with the module: |
||
<div class="mw-translate-fuzzy"> |
|||
Доступные инструменты. |
Доступные инструменты. |
||
* [[Image:Plot_Save.png|32px]] [[Plot_Save/ru|Сохранить диаграмму]]: Сохраняет диаграмму в нескольких форматах. Вы так же можете выбрать размер и разрешение на выходе. |
* [[Image:Plot_Save.png|32px]] [[Plot_Save/ru|Сохранить диаграмму]]: Сохраняет диаграмму в нескольких форматах. Вы так же можете выбрать размер и разрешение на выходе. |
||
Line 48: | Line 45: | ||
* [[Image:Plot_Labels.png|32px]] [[Plot_Labels/ru|Настроить подписи]]: Редактирует подписи. |
* [[Image:Plot_Labels.png|32px]] [[Plot_Labels/ru|Настроить подписи]]: Редактирует подписи. |
||
* [[Image:Plot_Positions.png|32px]] [[Plot_Positions/ru|Настройка расположения и размеров]]: Устанавливает позиции элементов. |
* [[Image:Plot_Positions.png|32px]] [[Plot_Positions/ru|Настройка расположения и размеров]]: Устанавливает позиции элементов. |
||
</div> |
|||
==Scripting== |
==Scripting== |
||
Since the Plot Workbench is a layer on top of {{incode|matplotlib}}, you are free to use any function from this library on plot instances. See [[Scripting_and_macros|Scripting and macros]] for examples. |
Since the Plot Workbench is a layer on top of {{incode|matplotlib}}, you are free to use any function from this library on plot instances. See [[Scripting_and_macros|Scripting and macros]] for examples. |
||
==Tutorial== |
|||
==Учебники== |
==Учебники== |
Latest revision as of 16:50, 25 June 2022
Introduction
FreeCAD is able to perform plots using the matplotlib Python library. A module is provided to this end, as an external add-on in version 0.19 and as a core component from version 0.20 on. Older versions of FreeCAD are not covered in this documentation.
The produced plots offer the standard matplotlib tools to edit and save. On top of that, a Plot Workbench is provided as an external add-on offering more complete tools to edit the plot and save it. The add-on can be installed with the Add-on manager.
Module
The module can be invoked in a Python console or in a macro. The first thing you must do is importing the module. In FreeCAD 0.19 you must first install the Plot Workbench using the Add-on manager, and then you can import Plot by typing:
from freecad.plot import Plot
Since FreeCAD 0.20 the plot module is already packaged with the program, so you don't need to install any add-on, but just type:
from FreeCAD.Plot import Plot
After that, you can plot a straight line from (0,0) to (1,2) just simply typing:
Plot.plot([0, 1], [0, 2])
You can find more complex examples in the Plot Basic tutorial and the Plot MultiAxes tutorial.
Инструменты
If you decide to install the Plot Workbench using the Add-on manager, you will have the following tools available to manage the plots created with the module:
Доступные инструменты.
- Сохранить диаграмму: Сохраняет диаграмму в нескольких форматах. Вы так же можете выбрать размер и разрешение на выходе.
- Настройка осей: Добавить, убрать или редактировать оси диаграммы.
- Настройка числовых рядов: Редактирует последовательности чисел в титлах и их стиль.
- Показать/скрыть сетку: Показывает/скрывает сетку.
- Показать/скрыть легенду: Показывает/скрывает легенду.
- Настроить подписи: Редактирует подписи.
- Настройка расположения и размеров: Устанавливает позиции элементов.
Scripting
Since the Plot Workbench is a layer on top of matplotlib
, you are free to use any function from this library on plot instances. See Scripting and macros for examples.
Tutorial
Учебники
- Начинающим
- Установка: Загрузка, Windows, Linux, Mac, Дополнительных компонентов, Docker, AppImage, Ubuntu Snap
- Базовая: О FreeCAD, Интерфейс, Навигация мыши, Методы выделения, Имя объекта, Настройки, Верстаки, Структура документа, Свойства, Помоги FreeCAD, Пожертвования
- Помощь: Учебники, Видео учебники
- Верстаки: Std Base, Arch, Assembly, CAM, Draft, FEM, Inspection, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Surface, TechDraw, Test Framework